1/*! ***************************************************************************** 2Copyright (c) Microsoft Corporation. All rights reserved. 3Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4this file except in compliance with the License. You may obtain a copy of the 5License at http://www.apache.org/licenses/LICENSE-2.0 6 7THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10MERCHANTABLITY OR NON-INFRINGEMENT. 11 12See the Apache Version 2.0 License for specific language governing permissions 13and limitations under the License. 14***************************************************************************** */ 15 16 17"use strict"; 18var __create = Object.create; 19var __defProp = Object.defineProperty; 20var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 21var __getOwnPropNames = Object.getOwnPropertyNames; 22var __getProtoOf = Object.getPrototypeOf; 23var __hasOwnProp = Object.prototype.hasOwnProperty; 24var __export = (target, all) => { 25 for (var name in all) 26 __defProp(target, name, { get: all[name], enumerable: true }); 27}; 28var __copyProps = (to, from, except, desc) => { 29 if (from && typeof from === "object" || typeof from === "function") { 30 for (let key of __getOwnPropNames(from)) 31 if (!__hasOwnProp.call(to, key) && key !== except) 32 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); 33 } 34 return to; 35}; 36var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( 37 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, 38 mod 39)); 40var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); 41 42// src/typingsInstaller/nodeTypingsInstaller.ts 43var nodeTypingsInstaller_exports = {}; 44__export(nodeTypingsInstaller_exports, { 45 NodeTypingsInstaller: () => NodeTypingsInstaller 46}); 47module.exports = __toCommonJS(nodeTypingsInstaller_exports); 48var fs = __toESM(require("fs")); 49var path = __toESM(require("path")); 50 51// src/compiler/corePublic.ts 52var versionMajorMinor = "4.9"; 53var version = `${versionMajorMinor}.5`; 54var NativeCollections; 55((NativeCollections2) => { 56 const globals = typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : void 0; 57 function tryGetNativeMap() { 58 const gMap = globals == null ? void 0 : globals.Map; 59 const constructor = typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : void 0; 60 if (!constructor) { 61 throw new Error("No compatible Map implementation found."); 62 } 63 return constructor; 64 } 65 NativeCollections2.tryGetNativeMap = tryGetNativeMap; 66 function tryGetNativeSet() { 67 const gSet = globals == null ? void 0 : globals.Set; 68 const constructor = typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : void 0; 69 if (!constructor) { 70 throw new Error("No compatible Set implementation found."); 71 } 72 return constructor; 73 } 74 NativeCollections2.tryGetNativeSet = tryGetNativeSet; 75})(NativeCollections || (NativeCollections = {})); 76var Map2 = NativeCollections.tryGetNativeMap(); 77var Set2 = NativeCollections.tryGetNativeSet(); 78 79// src/compiler/core.ts 80var emptyArray = []; 81var emptyMap = new Map2(); 82var emptySet = new Set2(); 83function length(array) { 84 return array ? array.length : 0; 85} 86function forEach(array, callback) { 87 if (array) { 88 for (let i = 0; i < array.length; i++) { 89 const result = callback(array[i], i); 90 if (result) { 91 return result; 92 } 93 } 94 } 95 return void 0; 96} 97function zipWith(arrayA, arrayB, callback) { 98 const result = []; 99 Debug.assertEqual(arrayA.length, arrayB.length); 100 for (let i = 0; i < arrayA.length; i++) { 101 result.push(callback(arrayA[i], arrayB[i], i)); 102 } 103 return result; 104} 105function every(array, callback) { 106 if (array) { 107 for (let i = 0; i < array.length; i++) { 108 if (!callback(array[i], i)) { 109 return false; 110 } 111 } 112 } 113 return true; 114} 115function find(array, predicate, startIndex) { 116 if (array === void 0) 117 return void 0; 118 for (let i = startIndex != null ? startIndex : 0; i < array.length; i++) { 119 const value = array[i]; 120 if (predicate(value, i)) { 121 return value; 122 } 123 } 124 return void 0; 125} 126function findIndex(array, predicate, startIndex) { 127 if (array === void 0) 128 return -1; 129 for (let i = startIndex != null ? startIndex : 0; i < array.length; i++) { 130 if (predicate(array[i], i)) { 131 return i; 132 } 133 } 134 return -1; 135} 136function contains(array, value, equalityComparer = equateValues) { 137 if (array) { 138 for (const v of array) { 139 if (equalityComparer(v, value)) { 140 return true; 141 } 142 } 143 } 144 return false; 145} 146function indexOfAnyCharCode(text, charCodes, start) { 147 for (let i = start || 0; i < text.length; i++) { 148 if (contains(charCodes, text.charCodeAt(i))) { 149 return i; 150 } 151 } 152 return -1; 153} 154function filter(array, f) { 155 if (array) { 156 const len = array.length; 157 let i = 0; 158 while (i < len && f(array[i])) 159 i++; 160 if (i < len) { 161 const result = array.slice(0, i); 162 i++; 163 while (i < len) { 164 const item = array[i]; 165 if (f(item)) { 166 result.push(item); 167 } 168 i++; 169 } 170 return result; 171 } 172 } 173 return array; 174} 175function map(array, f) { 176 let result; 177 if (array) { 178 result = []; 179 for (let i = 0; i < array.length; i++) { 180 result.push(f(array[i], i)); 181 } 182 } 183 return result; 184} 185function mapIterator(iter, mapFn) { 186 return { 187 next() { 188 const iterRes = iter.next(); 189 return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false }; 190 } 191 }; 192} 193function sameMap(array, f) { 194 if (array) { 195 for (let i = 0; i < array.length; i++) { 196 const item = array[i]; 197 const mapped = f(item, i); 198 if (item !== mapped) { 199 const result = array.slice(0, i); 200 result.push(mapped); 201 for (i++; i < array.length; i++) { 202 result.push(f(array[i], i)); 203 } 204 return result; 205 } 206 } 207 } 208 return array; 209} 210function flatten(array) { 211 const result = []; 212 for (const v of array) { 213 if (v) { 214 if (isArray(v)) { 215 addRange(result, v); 216 } else { 217 result.push(v); 218 } 219 } 220 } 221 return result; 222} 223function flatMap(array, mapfn) { 224 let result; 225 if (array) { 226 for (let i = 0; i < array.length; i++) { 227 const v = mapfn(array[i], i); 228 if (v) { 229 if (isArray(v)) { 230 result = addRange(result, v); 231 } else { 232 result = append(result, v); 233 } 234 } 235 } 236 } 237 return result || emptyArray; 238} 239function sameFlatMap(array, mapfn) { 240 let result; 241 if (array) { 242 for (let i = 0; i < array.length; i++) { 243 const item = array[i]; 244 const mapped = mapfn(item, i); 245 if (result || item !== mapped || isArray(mapped)) { 246 if (!result) { 247 result = array.slice(0, i); 248 } 249 if (isArray(mapped)) { 250 addRange(result, mapped); 251 } else { 252 result.push(mapped); 253 } 254 } 255 } 256 } 257 return result || array; 258} 259function mapDefined(array, mapFn) { 260 const result = []; 261 if (array) { 262 for (let i = 0; i < array.length; i++) { 263 const mapped = mapFn(array[i], i); 264 if (mapped !== void 0) { 265 result.push(mapped); 266 } 267 } 268 } 269 return result; 270} 271function mapDefinedIterator(iter, mapFn) { 272 return { 273 next() { 274 while (true) { 275 const res = iter.next(); 276 if (res.done) { 277 return res; 278 } 279 const value = mapFn(res.value); 280 if (value !== void 0) { 281 return { value, done: false }; 282 } 283 } 284 } 285 }; 286} 287function some(array, predicate) { 288 if (array) { 289 if (predicate) { 290 for (const v of array) { 291 if (predicate(v)) { 292 return true; 293 } 294 } 295 } else { 296 return array.length > 0; 297 } 298 } 299 return false; 300} 301function getRangesWhere(arr, pred, cb) { 302 let start; 303 for (let i = 0; i < arr.length; i++) { 304 if (pred(arr[i])) { 305 start = start === void 0 ? i : start; 306 } else { 307 if (start !== void 0) { 308 cb(start, i); 309 start = void 0; 310 } 311 } 312 } 313 if (start !== void 0) 314 cb(start, arr.length); 315} 316function concatenate(array1, array2) { 317 if (!some(array2)) 318 return array1; 319 if (!some(array1)) 320 return array2; 321 return [...array1, ...array2]; 322} 323function selectIndex(_, i) { 324 return i; 325} 326function indicesOf(array) { 327 return array.map(selectIndex); 328} 329function deduplicateRelational(array, equalityComparer, comparer) { 330 const indices = indicesOf(array); 331 stableSortIndices(array, indices, comparer); 332 let last2 = array[indices[0]]; 333 const deduplicated = [indices[0]]; 334 for (let i = 1; i < indices.length; i++) { 335 const index = indices[i]; 336 const item = array[index]; 337 if (!equalityComparer(last2, item)) { 338 deduplicated.push(index); 339 last2 = item; 340 } 341 } 342 deduplicated.sort(); 343 return deduplicated.map((i) => array[i]); 344} 345function deduplicateEquality(array, equalityComparer) { 346 const result = []; 347 for (const item of array) { 348 pushIfUnique(result, item, equalityComparer); 349 } 350 return result; 351} 352function deduplicate(array, equalityComparer, comparer) { 353 return array.length === 0 ? [] : array.length === 1 ? array.slice() : comparer ? deduplicateRelational(array, equalityComparer, comparer) : deduplicateEquality(array, equalityComparer); 354} 355function append(to, value) { 356 if (value === void 0) 357 return to; 358 if (to === void 0) 359 return [value]; 360 to.push(value); 361 return to; 362} 363function toOffset(array, offset) { 364 return offset < 0 ? array.length + offset : offset; 365} 366function addRange(to, from, start, end) { 367 if (from === void 0 || from.length === 0) 368 return to; 369 if (to === void 0) 370 return from.slice(start, end); 371 start = start === void 0 ? 0 : toOffset(from, start); 372 end = end === void 0 ? from.length : toOffset(from, end); 373 for (let i = start; i < end && i < from.length; i++) { 374 if (from[i] !== void 0) { 375 to.push(from[i]); 376 } 377 } 378 return to; 379} 380function pushIfUnique(array, toAdd, equalityComparer) { 381 if (contains(array, toAdd, equalityComparer)) { 382 return false; 383 } else { 384 array.push(toAdd); 385 return true; 386 } 387} 388function appendIfUnique(array, toAdd, equalityComparer) { 389 if (array) { 390 pushIfUnique(array, toAdd, equalityComparer); 391 return array; 392 } else { 393 return [toAdd]; 394 } 395} 396function stableSortIndices(array, indices, comparer) { 397 indices.sort((x, y) => comparer(array[x], array[y]) || compareValues(x, y)); 398} 399function sort(array, comparer) { 400 return array.length === 0 ? array : array.slice().sort(comparer); 401} 402function stableSort(array, comparer) { 403 const indices = indicesOf(array); 404 stableSortIndices(array, indices, comparer); 405 return indices.map((i) => array[i]); 406} 407function firstOrUndefined(array) { 408 return array === void 0 || array.length === 0 ? void 0 : array[0]; 409} 410function lastOrUndefined(array) { 411 return array === void 0 || array.length === 0 ? void 0 : array[array.length - 1]; 412} 413function last(array) { 414 Debug.assert(array.length !== 0); 415 return array[array.length - 1]; 416} 417function singleOrUndefined(array) { 418 return array && array.length === 1 ? array[0] : void 0; 419} 420function binarySearch(array, value, keySelector, keyComparer, offset) { 421 return binarySearchKey(array, keySelector(value), keySelector, keyComparer, offset); 422} 423function binarySearchKey(array, key, keySelector, keyComparer, offset) { 424 if (!some(array)) { 425 return -1; 426 } 427 let low = offset || 0; 428 let high = array.length - 1; 429 while (low <= high) { 430 const middle = low + (high - low >> 1); 431 const midKey = keySelector(array[middle], middle); 432 switch (keyComparer(midKey, key)) { 433 case -1 /* LessThan */: 434 low = middle + 1; 435 break; 436 case 0 /* EqualTo */: 437 return middle; 438 case 1 /* GreaterThan */: 439 high = middle - 1; 440 break; 441 } 442 } 443 return ~low; 444} 445function reduceLeft(array, f, initial, start, count) { 446 if (array && array.length > 0) { 447 const size = array.length; 448 if (size > 0) { 449 let pos = start === void 0 || start < 0 ? 0 : start; 450 const end = count === void 0 || pos + count > size - 1 ? size - 1 : pos + count; 451 let result; 452 if (arguments.length <= 2) { 453 result = array[pos]; 454 pos++; 455 } else { 456 result = initial; 457 } 458 while (pos <= end) { 459 result = f(result, array[pos], pos); 460 pos++; 461 } 462 return result; 463 } 464 } 465 return initial; 466} 467var hasOwnProperty = Object.prototype.hasOwnProperty; 468function hasProperty(map2, key) { 469 return hasOwnProperty.call(map2, key); 470} 471function getProperty(map2, key) { 472 return hasOwnProperty.call(map2, key) ? map2[key] : void 0; 473} 474function getOwnKeys(map2) { 475 const keys = []; 476 for (const key in map2) { 477 if (hasOwnProperty.call(map2, key)) { 478 keys.push(key); 479 } 480 } 481 return keys; 482} 483var _entries = Object.entries || ((obj) => { 484 const keys = getOwnKeys(obj); 485 const result = Array(keys.length); 486 for (let i = 0; i < keys.length; i++) { 487 result[i] = [keys[i], obj[keys[i]]]; 488 } 489 return result; 490}); 491function getEntries(obj) { 492 return obj ? _entries(obj) : []; 493} 494function arrayFrom(iterator, map2) { 495 const result = []; 496 for (let iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) { 497 result.push(map2 ? map2(iterResult.value) : iterResult.value); 498 } 499 return result; 500} 501function arrayToMap(array, makeKey, makeValue = identity) { 502 const result = new Map2(); 503 for (const value of array) { 504 const key = makeKey(value); 505 if (key !== void 0) 506 result.set(key, makeValue(value)); 507 } 508 return result; 509} 510function clone(object) { 511 const result = {}; 512 for (const id in object) { 513 if (hasOwnProperty.call(object, id)) { 514 result[id] = object[id]; 515 } 516 } 517 return result; 518} 519function createMultiMap() { 520 const map2 = new Map2(); 521 map2.add = multiMapAdd; 522 map2.remove = multiMapRemove; 523 return map2; 524} 525function multiMapAdd(key, value) { 526 let values = this.get(key); 527 if (values) { 528 values.push(value); 529 } else { 530 this.set(key, values = [value]); 531 } 532 return values; 533} 534function multiMapRemove(key, value) { 535 const values = this.get(key); 536 if (values) { 537 unorderedRemoveItem(values, value); 538 if (!values.length) { 539 this.delete(key); 540 } 541 } 542} 543function createQueue(items) { 544 const elements = (items == null ? void 0 : items.slice()) || []; 545 let headIndex = 0; 546 function isEmpty() { 547 return headIndex === elements.length; 548 } 549 function enqueue(...items2) { 550 elements.push(...items2); 551 } 552 function dequeue() { 553 if (isEmpty()) { 554 throw new Error("Queue is empty"); 555 } 556 const result = elements[headIndex]; 557 elements[headIndex] = void 0; 558 headIndex++; 559 if (headIndex > 100 && headIndex > elements.length >> 1) { 560 const newLength = elements.length - headIndex; 561 elements.copyWithin(0, headIndex); 562 elements.length = newLength; 563 headIndex = 0; 564 } 565 return result; 566 } 567 return { 568 enqueue, 569 dequeue, 570 isEmpty 571 }; 572} 573function isArray(value) { 574 return Array.isArray ? Array.isArray(value) : value instanceof Array; 575} 576function toArray(value) { 577 return isArray(value) ? value : [value]; 578} 579function isString(text) { 580 return typeof text === "string"; 581} 582function tryCast(value, test) { 583 return value !== void 0 && test(value) ? value : void 0; 584} 585function cast(value, test) { 586 if (value !== void 0 && test(value)) 587 return value; 588 return Debug.fail(`Invalid cast. The supplied value ${value} did not pass the test '${Debug.getFunctionName(test)}'.`); 589} 590function noop(_) { 591} 592function returnTrue() { 593 return true; 594} 595function identity(x) { 596 return x; 597} 598function toLowerCase(x) { 599 return x.toLowerCase(); 600} 601var fileNameLowerCaseRegExp = /[^\u0130\u0131\u00DFa-z0-9\\/:\-_\. ]+/g; 602function toFileNameLowerCase(x) { 603 return fileNameLowerCaseRegExp.test(x) ? x.replace(fileNameLowerCaseRegExp, toLowerCase) : x; 604} 605function notImplemented() { 606 throw new Error("Not implemented"); 607} 608function memoize(callback) { 609 let value; 610 return () => { 611 if (callback) { 612 value = callback(); 613 callback = void 0; 614 } 615 return value; 616 }; 617} 618function memoizeOne(callback) { 619 const map2 = new Map2(); 620 return (arg) => { 621 const key = `${typeof arg}:${arg}`; 622 let value = map2.get(key); 623 if (value === void 0 && !map2.has(key)) { 624 value = callback(arg); 625 map2.set(key, value); 626 } 627 return value; 628 }; 629} 630function equateValues(a, b) { 631 return a === b; 632} 633function equateStringsCaseInsensitive(a, b) { 634 return a === b || a !== void 0 && b !== void 0 && a.toUpperCase() === b.toUpperCase(); 635} 636function equateStringsCaseSensitive(a, b) { 637 return equateValues(a, b); 638} 639function compareComparableValues(a, b) { 640 return a === b ? 0 /* EqualTo */ : a === void 0 ? -1 /* LessThan */ : b === void 0 ? 1 /* GreaterThan */ : a < b ? -1 /* LessThan */ : 1 /* GreaterThan */; 641} 642function compareValues(a, b) { 643 return compareComparableValues(a, b); 644} 645function compareStringsCaseInsensitive(a, b) { 646 if (a === b) 647 return 0 /* EqualTo */; 648 if (a === void 0) 649 return -1 /* LessThan */; 650 if (b === void 0) 651 return 1 /* GreaterThan */; 652 a = a.toUpperCase(); 653 b = b.toUpperCase(); 654 return a < b ? -1 /* LessThan */ : a > b ? 1 /* GreaterThan */ : 0 /* EqualTo */; 655} 656function compareStringsCaseSensitive(a, b) { 657 return compareComparableValues(a, b); 658} 659function getStringComparer(ignoreCase) { 660 return ignoreCase ? compareStringsCaseInsensitive : compareStringsCaseSensitive; 661} 662var createUIStringComparer = (() => { 663 let defaultComparer; 664 let enUSComparer; 665 const stringComparerFactory = getStringComparerFactory(); 666 return createStringComparer; 667 function compareWithCallback(a, b, comparer) { 668 if (a === b) 669 return 0 /* EqualTo */; 670 if (a === void 0) 671 return -1 /* LessThan */; 672 if (b === void 0) 673 return 1 /* GreaterThan */; 674 const value = comparer(a, b); 675 return value < 0 ? -1 /* LessThan */ : value > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */; 676 } 677 function createIntlCollatorStringComparer(locale) { 678 const comparer = new Intl.Collator(locale, { usage: "sort", sensitivity: "variant" }).compare; 679 return (a, b) => compareWithCallback(a, b, comparer); 680 } 681 function createLocaleCompareStringComparer(locale) { 682 if (locale !== void 0) 683 return createFallbackStringComparer(); 684 return (a, b) => compareWithCallback(a, b, compareStrings); 685 function compareStrings(a, b) { 686 return a.localeCompare(b); 687 } 688 } 689 function createFallbackStringComparer() { 690 return (a, b) => compareWithCallback(a, b, compareDictionaryOrder); 691 function compareDictionaryOrder(a, b) { 692 return compareStrings(a.toUpperCase(), b.toUpperCase()) || compareStrings(a, b); 693 } 694 function compareStrings(a, b) { 695 return a < b ? -1 /* LessThan */ : a > b ? 1 /* GreaterThan */ : 0 /* EqualTo */; 696 } 697 } 698 function getStringComparerFactory() { 699 if (typeof Intl === "object" && typeof Intl.Collator === "function") { 700 return createIntlCollatorStringComparer; 701 } 702 if (typeof String.prototype.localeCompare === "function" && typeof String.prototype.toLocaleUpperCase === "function" && "a".localeCompare("B") < 0) { 703 return createLocaleCompareStringComparer; 704 } 705 return createFallbackStringComparer; 706 } 707 function createStringComparer(locale) { 708 if (locale === void 0) { 709 return defaultComparer || (defaultComparer = stringComparerFactory(locale)); 710 } else if (locale === "en-US") { 711 return enUSComparer || (enUSComparer = stringComparerFactory(locale)); 712 } else { 713 return stringComparerFactory(locale); 714 } 715 } 716})(); 717function getSpellingSuggestion(name, candidates, getName) { 718 const maximumLengthDifference = Math.max(2, Math.floor(name.length * 0.34)); 719 let bestDistance = Math.floor(name.length * 0.4) + 1; 720 let bestCandidate; 721 for (const candidate of candidates) { 722 const candidateName = getName(candidate); 723 if (candidateName !== void 0 && Math.abs(candidateName.length - name.length) <= maximumLengthDifference) { 724 if (candidateName === name) { 725 continue; 726 } 727 if (candidateName.length < 3 && candidateName.toLowerCase() !== name.toLowerCase()) { 728 continue; 729 } 730 const distance = levenshteinWithMax(name, candidateName, bestDistance - 0.1); 731 if (distance === void 0) { 732 continue; 733 } 734 Debug.assert(distance < bestDistance); 735 bestDistance = distance; 736 bestCandidate = candidate; 737 } 738 } 739 return bestCandidate; 740} 741function levenshteinWithMax(s1, s2, max) { 742 let previous = new Array(s2.length + 1); 743 let current = new Array(s2.length + 1); 744 const big = max + 0.01; 745 for (let i = 0; i <= s2.length; i++) { 746 previous[i] = i; 747 } 748 for (let i = 1; i <= s1.length; i++) { 749 const c1 = s1.charCodeAt(i - 1); 750 const minJ = Math.ceil(i > max ? i - max : 1); 751 const maxJ = Math.floor(s2.length > max + i ? max + i : s2.length); 752 current[0] = i; 753 let colMin = i; 754 for (let j = 1; j < minJ; j++) { 755 current[j] = big; 756 } 757 for (let j = minJ; j <= maxJ; j++) { 758 const substitutionDistance = s1[i - 1].toLowerCase() === s2[j - 1].toLowerCase() ? previous[j - 1] + 0.1 : previous[j - 1] + 2; 759 const dist = c1 === s2.charCodeAt(j - 1) ? previous[j - 1] : Math.min(previous[j] + 1, current[j - 1] + 1, substitutionDistance); 760 current[j] = dist; 761 colMin = Math.min(colMin, dist); 762 } 763 for (let j = maxJ + 1; j <= s2.length; j++) { 764 current[j] = big; 765 } 766 if (colMin > max) { 767 return void 0; 768 } 769 const temp = previous; 770 previous = current; 771 current = temp; 772 } 773 const res = previous[s2.length]; 774 return res > max ? void 0 : res; 775} 776function endsWith(str, suffix) { 777 const expectedPos = str.length - suffix.length; 778 return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos; 779} 780function stringContains(str, substring) { 781 return str.indexOf(substring) !== -1; 782} 783function removeMinAndVersionNumbers(fileName) { 784 let end = fileName.length; 785 for (let pos = end - 1; pos > 0; pos--) { 786 let ch = fileName.charCodeAt(pos); 787 if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { 788 do { 789 --pos; 790 ch = fileName.charCodeAt(pos); 791 } while (pos > 0 && ch >= 48 /* _0 */ && ch <= 57 /* _9 */); 792 } else if (pos > 4 && (ch === 110 /* n */ || ch === 78 /* N */)) { 793 --pos; 794 ch = fileName.charCodeAt(pos); 795 if (ch !== 105 /* i */ && ch !== 73 /* I */) { 796 break; 797 } 798 --pos; 799 ch = fileName.charCodeAt(pos); 800 if (ch !== 109 /* m */ && ch !== 77 /* M */) { 801 break; 802 } 803 --pos; 804 ch = fileName.charCodeAt(pos); 805 } else { 806 break; 807 } 808 if (ch !== 45 /* minus */ && ch !== 46 /* dot */) { 809 break; 810 } 811 end = pos; 812 } 813 return end === fileName.length ? fileName : fileName.slice(0, end); 814} 815function orderedRemoveItem(array, item) { 816 for (let i = 0; i < array.length; i++) { 817 if (array[i] === item) { 818 orderedRemoveItemAt(array, i); 819 return true; 820 } 821 } 822 return false; 823} 824function orderedRemoveItemAt(array, index) { 825 for (let i = index; i < array.length - 1; i++) { 826 array[i] = array[i + 1]; 827 } 828 array.pop(); 829} 830function unorderedRemoveItemAt(array, index) { 831 array[index] = array[array.length - 1]; 832 array.pop(); 833} 834function unorderedRemoveItem(array, item) { 835 return unorderedRemoveFirstItemWhere(array, (element) => element === item); 836} 837function unorderedRemoveFirstItemWhere(array, predicate) { 838 for (let i = 0; i < array.length; i++) { 839 if (predicate(array[i])) { 840 unorderedRemoveItemAt(array, i); 841 return true; 842 } 843 } 844 return false; 845} 846function createGetCanonicalFileName(useCaseSensitiveFileNames) { 847 return useCaseSensitiveFileNames ? identity : toFileNameLowerCase; 848} 849function patternText({ prefix, suffix }) { 850 return `${prefix}*${suffix}`; 851} 852function matchedText(pattern, candidate) { 853 Debug.assert(isPatternMatch(pattern, candidate)); 854 return candidate.substring(pattern.prefix.length, candidate.length - pattern.suffix.length); 855} 856function findBestPatternMatch(values, getPattern, candidate) { 857 let matchedValue; 858 let longestMatchPrefixLength = -1; 859 for (const v of values) { 860 const pattern = getPattern(v); 861 if (isPatternMatch(pattern, candidate) && pattern.prefix.length > longestMatchPrefixLength) { 862 longestMatchPrefixLength = pattern.prefix.length; 863 matchedValue = v; 864 } 865 } 866 return matchedValue; 867} 868function startsWith(str, prefix) { 869 return str.lastIndexOf(prefix, 0) === 0; 870} 871function isPatternMatch({ prefix, suffix }, candidate) { 872 return candidate.length >= prefix.length + suffix.length && startsWith(candidate, prefix) && endsWith(candidate, suffix); 873} 874function and(f, g) { 875 return (arg) => f(arg) && g(arg); 876} 877function or(...fs2) { 878 return (...args) => { 879 let lastResult; 880 for (const f of fs2) { 881 lastResult = f(...args); 882 if (lastResult) { 883 return lastResult; 884 } 885 } 886 return lastResult; 887 }; 888} 889function enumerateInsertsAndDeletes(newItems, oldItems, comparer, inserted, deleted, unchanged) { 890 unchanged = unchanged || noop; 891 let newIndex = 0; 892 let oldIndex = 0; 893 const newLen = newItems.length; 894 const oldLen = oldItems.length; 895 let hasChanges = false; 896 while (newIndex < newLen && oldIndex < oldLen) { 897 const newItem = newItems[newIndex]; 898 const oldItem = oldItems[oldIndex]; 899 const compareResult = comparer(newItem, oldItem); 900 if (compareResult === -1 /* LessThan */) { 901 inserted(newItem); 902 newIndex++; 903 hasChanges = true; 904 } else if (compareResult === 1 /* GreaterThan */) { 905 deleted(oldItem); 906 oldIndex++; 907 hasChanges = true; 908 } else { 909 unchanged(oldItem, newItem); 910 newIndex++; 911 oldIndex++; 912 } 913 } 914 while (newIndex < newLen) { 915 inserted(newItems[newIndex++]); 916 hasChanges = true; 917 } 918 while (oldIndex < oldLen) { 919 deleted(oldItems[oldIndex++]); 920 hasChanges = true; 921 } 922 return hasChanges; 923} 924function padLeft(s, length2, padString = " ") { 925 return length2 <= s.length ? s : padString.repeat(length2 - s.length) + s; 926} 927var trimString = !!String.prototype.trim ? (s) => s.trim() : (s) => trimStringEnd(trimStringStart(s)); 928var trimStringEnd = !!String.prototype.trimEnd ? (s) => s.trimEnd() : trimEndImpl; 929var trimStringStart = !!String.prototype.trimStart ? (s) => s.trimStart() : (s) => s.replace(/^\s+/g, ""); 930function trimEndImpl(s) { 931 let end = s.length - 1; 932 while (end >= 0) { 933 if (!isWhiteSpaceLike(s.charCodeAt(end))) 934 break; 935 end--; 936 } 937 return s.slice(0, end + 1); 938} 939function isNodeLikeSystem() { 940 return typeof process !== "undefined" && process.nextTick && !process.browser && typeof require !== "undefined"; 941} 942 943// src/compiler/debug.ts 944var Debug; 945((Debug2) => { 946 let typeScriptVersion2; 947 let currentAssertionLevel = 0 /* None */; 948 Debug2.currentLogLevel = 2 /* Warning */; 949 Debug2.isDebugging = false; 950 Debug2.enableDeprecationWarnings = true; 951 function getTypeScriptVersion() { 952 return typeScriptVersion2 != null ? typeScriptVersion2 : typeScriptVersion2 = new Version(version); 953 } 954 Debug2.getTypeScriptVersion = getTypeScriptVersion; 955 function shouldLog(level) { 956 return Debug2.currentLogLevel <= level; 957 } 958 Debug2.shouldLog = shouldLog; 959 function logMessage(level, s) { 960 if (Debug2.loggingHost && shouldLog(level)) { 961 Debug2.loggingHost.log(level, s); 962 } 963 } 964 function log2(s) { 965 logMessage(3 /* Info */, s); 966 } 967 Debug2.log = log2; 968 ((_log) => { 969 function error(s) { 970 logMessage(1 /* Error */, s); 971 } 972 _log.error = error; 973 function warn(s) { 974 logMessage(2 /* Warning */, s); 975 } 976 _log.warn = warn; 977 function log3(s) { 978 logMessage(3 /* Info */, s); 979 } 980 _log.log = log3; 981 function trace2(s) { 982 logMessage(4 /* Verbose */, s); 983 } 984 _log.trace = trace2; 985 })(log2 = Debug2.log || (Debug2.log = {})); 986 const assertionCache = {}; 987 function getAssertionLevel() { 988 return currentAssertionLevel; 989 } 990 Debug2.getAssertionLevel = getAssertionLevel; 991 function setAssertionLevel(level) { 992 const prevAssertionLevel = currentAssertionLevel; 993 currentAssertionLevel = level; 994 if (level > prevAssertionLevel) { 995 for (const key of getOwnKeys(assertionCache)) { 996 const cachedFunc = assertionCache[key]; 997 if (cachedFunc !== void 0 && Debug2[key] !== cachedFunc.assertion && level >= cachedFunc.level) { 998 Debug2[key] = cachedFunc; 999 assertionCache[key] = void 0; 1000 } 1001 } 1002 } 1003 } 1004 Debug2.setAssertionLevel = setAssertionLevel; 1005 function shouldAssert(level) { 1006 return currentAssertionLevel >= level; 1007 } 1008 Debug2.shouldAssert = shouldAssert; 1009 function shouldAssertFunction(level, name) { 1010 if (!shouldAssert(level)) { 1011 assertionCache[name] = { level, assertion: Debug2[name] }; 1012 Debug2[name] = noop; 1013 return false; 1014 } 1015 return true; 1016 } 1017 function fail(message, stackCrawlMark) { 1018 debugger; 1019 const e = new Error(message ? `Debug Failure. ${message}` : "Debug Failure."); 1020 if (Error.captureStackTrace) { 1021 Error.captureStackTrace(e, stackCrawlMark || fail); 1022 } 1023 throw e; 1024 } 1025 Debug2.fail = fail; 1026 function failBadSyntaxKind(node, message, stackCrawlMark) { 1027 return fail( 1028 `${message || "Unexpected node."}\r 1029Node ${formatSyntaxKind(node.kind)} was unexpected.`, 1030 stackCrawlMark || failBadSyntaxKind 1031 ); 1032 } 1033 Debug2.failBadSyntaxKind = failBadSyntaxKind; 1034 function assert(expression, message, verboseDebugInfo, stackCrawlMark) { 1035 if (!expression) { 1036 message = message ? `False expression: ${message}` : "False expression."; 1037 if (verboseDebugInfo) { 1038 message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo()); 1039 } 1040 fail(message, stackCrawlMark || assert); 1041 } 1042 } 1043 Debug2.assert = assert; 1044 function assertEqual(a, b, msg, msg2, stackCrawlMark) { 1045 if (a !== b) { 1046 const message = msg ? msg2 ? `${msg} ${msg2}` : msg : ""; 1047 fail(`Expected ${a} === ${b}. ${message}`, stackCrawlMark || assertEqual); 1048 } 1049 } 1050 Debug2.assertEqual = assertEqual; 1051 function assertLessThan(a, b, msg, stackCrawlMark) { 1052 if (a >= b) { 1053 fail(`Expected ${a} < ${b}. ${msg || ""}`, stackCrawlMark || assertLessThan); 1054 } 1055 } 1056 Debug2.assertLessThan = assertLessThan; 1057 function assertLessThanOrEqual(a, b, stackCrawlMark) { 1058 if (a > b) { 1059 fail(`Expected ${a} <= ${b}`, stackCrawlMark || assertLessThanOrEqual); 1060 } 1061 } 1062 Debug2.assertLessThanOrEqual = assertLessThanOrEqual; 1063 function assertGreaterThanOrEqual(a, b, stackCrawlMark) { 1064 if (a < b) { 1065 fail(`Expected ${a} >= ${b}`, stackCrawlMark || assertGreaterThanOrEqual); 1066 } 1067 } 1068 Debug2.assertGreaterThanOrEqual = assertGreaterThanOrEqual; 1069 function assertIsDefined(value, message, stackCrawlMark) { 1070 if (value === void 0 || value === null) { 1071 fail(message, stackCrawlMark || assertIsDefined); 1072 } 1073 } 1074 Debug2.assertIsDefined = assertIsDefined; 1075 function checkDefined(value, message, stackCrawlMark) { 1076 assertIsDefined(value, message, stackCrawlMark || checkDefined); 1077 return value; 1078 } 1079 Debug2.checkDefined = checkDefined; 1080 function assertEachIsDefined(value, message, stackCrawlMark) { 1081 for (const v of value) { 1082 assertIsDefined(v, message, stackCrawlMark || assertEachIsDefined); 1083 } 1084 } 1085 Debug2.assertEachIsDefined = assertEachIsDefined; 1086 function checkEachDefined(value, message, stackCrawlMark) { 1087 assertEachIsDefined(value, message, stackCrawlMark || checkEachDefined); 1088 return value; 1089 } 1090 Debug2.checkEachDefined = checkEachDefined; 1091 function assertNever(member, message = "Illegal value:", stackCrawlMark) { 1092 const detail = typeof member === "object" && hasProperty(member, "kind") && hasProperty(member, "pos") ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member); 1093 return fail(`${message} ${detail}`, stackCrawlMark || assertNever); 1094 } 1095 Debug2.assertNever = assertNever; 1096 function assertEachNode(nodes, test, message, stackCrawlMark) { 1097 if (shouldAssertFunction(1 /* Normal */, "assertEachNode")) { 1098 assert( 1099 test === void 0 || every(nodes, test), 1100 message || "Unexpected node.", 1101 () => `Node array did not pass test '${getFunctionName(test)}'.`, 1102 stackCrawlMark || assertEachNode 1103 ); 1104 } 1105 } 1106 Debug2.assertEachNode = assertEachNode; 1107 function assertNode(node, test, message, stackCrawlMark) { 1108 if (shouldAssertFunction(1 /* Normal */, "assertNode")) { 1109 assert( 1110 node !== void 0 && (test === void 0 || test(node)), 1111 message || "Unexpected node.", 1112 () => `Node ${formatSyntaxKind(node == null ? void 0 : node.kind)} did not pass test '${getFunctionName(test)}'.`, 1113 stackCrawlMark || assertNode 1114 ); 1115 } 1116 } 1117 Debug2.assertNode = assertNode; 1118 function assertNotNode(node, test, message, stackCrawlMark) { 1119 if (shouldAssertFunction(1 /* Normal */, "assertNotNode")) { 1120 assert( 1121 node === void 0 || test === void 0 || !test(node), 1122 message || "Unexpected node.", 1123 () => `Node ${formatSyntaxKind(node.kind)} should not have passed test '${getFunctionName(test)}'.`, 1124 stackCrawlMark || assertNotNode 1125 ); 1126 } 1127 } 1128 Debug2.assertNotNode = assertNotNode; 1129 function assertOptionalNode(node, test, message, stackCrawlMark) { 1130 if (shouldAssertFunction(1 /* Normal */, "assertOptionalNode")) { 1131 assert( 1132 test === void 0 || node === void 0 || test(node), 1133 message || "Unexpected node.", 1134 () => `Node ${formatSyntaxKind(node == null ? void 0 : node.kind)} did not pass test '${getFunctionName(test)}'.`, 1135 stackCrawlMark || assertOptionalNode 1136 ); 1137 } 1138 } 1139 Debug2.assertOptionalNode = assertOptionalNode; 1140 function assertOptionalToken(node, kind, message, stackCrawlMark) { 1141 if (shouldAssertFunction(1 /* Normal */, "assertOptionalToken")) { 1142 assert( 1143 kind === void 0 || node === void 0 || node.kind === kind, 1144 message || "Unexpected node.", 1145 () => `Node ${formatSyntaxKind(node == null ? void 0 : node.kind)} was not a '${formatSyntaxKind(kind)}' token.`, 1146 stackCrawlMark || assertOptionalToken 1147 ); 1148 } 1149 } 1150 Debug2.assertOptionalToken = assertOptionalToken; 1151 function assertMissingNode(node, message, stackCrawlMark) { 1152 if (shouldAssertFunction(1 /* Normal */, "assertMissingNode")) { 1153 assert( 1154 node === void 0, 1155 message || "Unexpected node.", 1156 () => `Node ${formatSyntaxKind(node.kind)} was unexpected'.`, 1157 stackCrawlMark || assertMissingNode 1158 ); 1159 } 1160 } 1161 Debug2.assertMissingNode = assertMissingNode; 1162 function type(_value) { 1163 } 1164 Debug2.type = type; 1165 function getFunctionName(func) { 1166 if (typeof func !== "function") { 1167 return ""; 1168 } else if (hasProperty(func, "name")) { 1169 return func.name; 1170 } else { 1171 const text = Function.prototype.toString.call(func); 1172 const match = /^function\s+([\w\$]+)\s*\(/.exec(text); 1173 return match ? match[1] : ""; 1174 } 1175 } 1176 Debug2.getFunctionName = getFunctionName; 1177 function formatSymbol(symbol) { 1178 return `{ name: ${unescapeLeadingUnderscores(symbol.escapedName)}; flags: ${formatSymbolFlags(symbol.flags)}; declarations: ${map(symbol.declarations, (node) => formatSyntaxKind(node.kind))} }`; 1179 } 1180 Debug2.formatSymbol = formatSymbol; 1181 function formatEnum(value = 0, enumObject, isFlags) { 1182 const members = getEnumMembers(enumObject); 1183 if (value === 0) { 1184 return members.length > 0 && members[0][0] === 0 ? members[0][1] : "0"; 1185 } 1186 if (isFlags) { 1187 const result = []; 1188 let remainingFlags = value; 1189 for (const [enumValue, enumName] of members) { 1190 if (enumValue > value) { 1191 break; 1192 } 1193 if (enumValue !== 0 && enumValue & value) { 1194 result.push(enumName); 1195 remainingFlags &= ~enumValue; 1196 } 1197 } 1198 if (remainingFlags === 0) { 1199 return result.join("|"); 1200 } 1201 } else { 1202 for (const [enumValue, enumName] of members) { 1203 if (enumValue === value) { 1204 return enumName; 1205 } 1206 } 1207 } 1208 return value.toString(); 1209 } 1210 Debug2.formatEnum = formatEnum; 1211 const enumMemberCache = new Map2(); 1212 function getEnumMembers(enumObject) { 1213 const existing = enumMemberCache.get(enumObject); 1214 if (existing) { 1215 return existing; 1216 } 1217 const result = []; 1218 for (const name in enumObject) { 1219 const value = enumObject[name]; 1220 if (typeof value === "number") { 1221 result.push([value, name]); 1222 } 1223 } 1224 const sorted = stableSort(result, (x, y) => compareValues(x[0], y[0])); 1225 enumMemberCache.set(enumObject, sorted); 1226 return sorted; 1227 } 1228 function formatSyntaxKind(kind) { 1229 return formatEnum(kind, SyntaxKind, false); 1230 } 1231 Debug2.formatSyntaxKind = formatSyntaxKind; 1232 function formatSnippetKind(kind) { 1233 return formatEnum(kind, SnippetKind, false); 1234 } 1235 Debug2.formatSnippetKind = formatSnippetKind; 1236 function formatNodeFlags(flags) { 1237 return formatEnum(flags, NodeFlags, true); 1238 } 1239 Debug2.formatNodeFlags = formatNodeFlags; 1240 function formatModifierFlags(flags) { 1241 return formatEnum(flags, ModifierFlags, true); 1242 } 1243 Debug2.formatModifierFlags = formatModifierFlags; 1244 function formatTransformFlags(flags) { 1245 return formatEnum(flags, TransformFlags, true); 1246 } 1247 Debug2.formatTransformFlags = formatTransformFlags; 1248 function formatEmitFlags(flags) { 1249 return formatEnum(flags, EmitFlags, true); 1250 } 1251 Debug2.formatEmitFlags = formatEmitFlags; 1252 function formatSymbolFlags(flags) { 1253 return formatEnum(flags, SymbolFlags, true); 1254 } 1255 Debug2.formatSymbolFlags = formatSymbolFlags; 1256 function formatTypeFlags(flags) { 1257 return formatEnum(flags, TypeFlags, true); 1258 } 1259 Debug2.formatTypeFlags = formatTypeFlags; 1260 function formatSignatureFlags(flags) { 1261 return formatEnum(flags, SignatureFlags, true); 1262 } 1263 Debug2.formatSignatureFlags = formatSignatureFlags; 1264 function formatObjectFlags(flags) { 1265 return formatEnum(flags, ObjectFlags, true); 1266 } 1267 Debug2.formatObjectFlags = formatObjectFlags; 1268 function formatFlowFlags(flags) { 1269 return formatEnum(flags, FlowFlags, true); 1270 } 1271 Debug2.formatFlowFlags = formatFlowFlags; 1272 function formatRelationComparisonResult(result) { 1273 return formatEnum(result, RelationComparisonResult, true); 1274 } 1275 Debug2.formatRelationComparisonResult = formatRelationComparisonResult; 1276 function formatCheckMode(mode) { 1277 return formatEnum(mode, CheckMode, true); 1278 } 1279 Debug2.formatCheckMode = formatCheckMode; 1280 function formatSignatureCheckMode(mode) { 1281 return formatEnum(mode, SignatureCheckMode, true); 1282 } 1283 Debug2.formatSignatureCheckMode = formatSignatureCheckMode; 1284 function formatTypeFacts(facts) { 1285 return formatEnum(facts, TypeFacts, true); 1286 } 1287 Debug2.formatTypeFacts = formatTypeFacts; 1288 let isDebugInfoEnabled = false; 1289 let flowNodeProto; 1290 function attachFlowNodeDebugInfoWorker(flowNode) { 1291 if (!("__debugFlowFlags" in flowNode)) { 1292 Object.defineProperties(flowNode, { 1293 __tsDebuggerDisplay: { 1294 value() { 1295 const flowHeader = this.flags & 2 /* Start */ ? "FlowStart" : this.flags & 4 /* BranchLabel */ ? "FlowBranchLabel" : this.flags & 8 /* LoopLabel */ ? "FlowLoopLabel" : this.flags & 16 /* Assignment */ ? "FlowAssignment" : this.flags & 32 /* TrueCondition */ ? "FlowTrueCondition" : this.flags & 64 /* FalseCondition */ ? "FlowFalseCondition" : this.flags & 128 /* SwitchClause */ ? "FlowSwitchClause" : this.flags & 256 /* ArrayMutation */ ? "FlowArrayMutation" : this.flags & 512 /* Call */ ? "FlowCall" : this.flags & 1024 /* ReduceLabel */ ? "FlowReduceLabel" : this.flags & 1 /* Unreachable */ ? "FlowUnreachable" : "UnknownFlow"; 1296 const remainingFlags = this.flags & ~(2048 /* Referenced */ - 1); 1297 return `${flowHeader}${remainingFlags ? ` (${formatFlowFlags(remainingFlags)})` : ""}`; 1298 } 1299 }, 1300 __debugFlowFlags: { get() { 1301 return formatEnum(this.flags, FlowFlags, true); 1302 } }, 1303 __debugToString: { value() { 1304 return formatControlFlowGraph(this); 1305 } } 1306 }); 1307 } 1308 } 1309 function attachFlowNodeDebugInfo(flowNode) { 1310 if (isDebugInfoEnabled) { 1311 if (typeof Object.setPrototypeOf === "function") { 1312 if (!flowNodeProto) { 1313 flowNodeProto = Object.create(Object.prototype); 1314 attachFlowNodeDebugInfoWorker(flowNodeProto); 1315 } 1316 Object.setPrototypeOf(flowNode, flowNodeProto); 1317 } else { 1318 attachFlowNodeDebugInfoWorker(flowNode); 1319 } 1320 } 1321 } 1322 Debug2.attachFlowNodeDebugInfo = attachFlowNodeDebugInfo; 1323 let nodeArrayProto; 1324 function attachNodeArrayDebugInfoWorker(array) { 1325 if (!("__tsDebuggerDisplay" in array)) { 1326 Object.defineProperties(array, { 1327 __tsDebuggerDisplay: { 1328 value(defaultValue) { 1329 defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]"); 1330 return `NodeArray ${defaultValue}`; 1331 } 1332 } 1333 }); 1334 } 1335 } 1336 function attachNodeArrayDebugInfo(array) { 1337 if (isDebugInfoEnabled) { 1338 if (typeof Object.setPrototypeOf === "function") { 1339 if (!nodeArrayProto) { 1340 nodeArrayProto = Object.create(Array.prototype); 1341 attachNodeArrayDebugInfoWorker(nodeArrayProto); 1342 } 1343 Object.setPrototypeOf(array, nodeArrayProto); 1344 } else { 1345 attachNodeArrayDebugInfoWorker(array); 1346 } 1347 } 1348 } 1349 Debug2.attachNodeArrayDebugInfo = attachNodeArrayDebugInfo; 1350 function enableDebugInfo() { 1351 if (isDebugInfoEnabled) 1352 return; 1353 let weakTypeTextMap; 1354 let weakNodeTextMap; 1355 function getWeakTypeTextMap() { 1356 if (weakTypeTextMap === void 0) { 1357 if (typeof WeakMap === "function") 1358 weakTypeTextMap = /* @__PURE__ */ new WeakMap(); 1359 } 1360 return weakTypeTextMap; 1361 } 1362 function getWeakNodeTextMap() { 1363 if (weakNodeTextMap === void 0) { 1364 if (typeof WeakMap === "function") 1365 weakNodeTextMap = /* @__PURE__ */ new WeakMap(); 1366 } 1367 return weakNodeTextMap; 1368 } 1369 Object.defineProperties(objectAllocator.getSymbolConstructor().prototype, { 1370 __tsDebuggerDisplay: { 1371 value() { 1372 const symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" : "Symbol"; 1373 const remainingSymbolFlags = this.flags & ~33554432 /* Transient */; 1374 return `${symbolHeader} '${symbolName(this)}'${remainingSymbolFlags ? ` (${formatSymbolFlags(remainingSymbolFlags)})` : ""}`; 1375 } 1376 }, 1377 __debugFlags: { get() { 1378 return formatSymbolFlags(this.flags); 1379 } } 1380 }); 1381 Object.defineProperties(objectAllocator.getTypeConstructor().prototype, { 1382 __tsDebuggerDisplay: { 1383 value() { 1384 const typeHeader = this.flags & 98304 /* Nullable */ ? "NullableType" : this.flags & 384 /* StringOrNumberLiteral */ ? `LiteralType ${JSON.stringify(this.value)}` : this.flags & 2048 /* BigIntLiteral */ ? `LiteralType ${this.value.negative ? "-" : ""}${this.value.base10Value}n` : this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" : this.flags & 32 /* Enum */ ? "EnumType" : this.flags & 67359327 /* Intrinsic */ ? `IntrinsicType ${this.intrinsicName}` : this.flags & 1048576 /* Union */ ? "UnionType" : this.flags & 2097152 /* Intersection */ ? "IntersectionType" : this.flags & 4194304 /* Index */ ? "IndexType" : this.flags & 8388608 /* IndexedAccess */ ? "IndexedAccessType" : this.flags & 16777216 /* Conditional */ ? "ConditionalType" : this.flags & 33554432 /* Substitution */ ? "SubstitutionType" : this.flags & 262144 /* TypeParameter */ ? "TypeParameter" : this.flags & 524288 /* Object */ ? this.objectFlags & 3 /* ClassOrInterface */ ? "InterfaceType" : this.objectFlags & 4 /* Reference */ ? "TypeReference" : this.objectFlags & 8 /* Tuple */ ? "TupleType" : this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" : this.objectFlags & 32 /* Mapped */ ? "MappedType" : this.objectFlags & 1024 /* ReverseMapped */ ? "ReverseMappedType" : this.objectFlags & 256 /* EvolvingArray */ ? "EvolvingArrayType" : "ObjectType" : "Type"; 1385 const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~1343 /* ObjectTypeKindMask */ : 0; 1386 return `${typeHeader}${this.symbol ? ` '${symbolName(this.symbol)}'` : ""}${remainingObjectFlags ? ` (${formatObjectFlags(remainingObjectFlags)})` : ""}`; 1387 } 1388 }, 1389 __debugFlags: { get() { 1390 return formatTypeFlags(this.flags); 1391 } }, 1392 __debugObjectFlags: { get() { 1393 return this.flags & 524288 /* Object */ ? formatObjectFlags(this.objectFlags) : ""; 1394 } }, 1395 __debugTypeToString: { 1396 value() { 1397 const map2 = getWeakTypeTextMap(); 1398 let text = map2 == null ? void 0 : map2.get(this); 1399 if (text === void 0) { 1400 text = this.checker.typeToString(this); 1401 map2 == null ? void 0 : map2.set(this, text); 1402 } 1403 return text; 1404 } 1405 } 1406 }); 1407 Object.defineProperties(objectAllocator.getSignatureConstructor().prototype, { 1408 __debugFlags: { get() { 1409 return formatSignatureFlags(this.flags); 1410 } }, 1411 __debugSignatureToString: { value() { 1412 var _a2; 1413 return (_a2 = this.checker) == null ? void 0 : _a2.signatureToString(this); 1414 } } 1415 }); 1416 const nodeConstructors = [ 1417 objectAllocator.getNodeConstructor(), 1418 objectAllocator.getIdentifierConstructor(), 1419 objectAllocator.getTokenConstructor(), 1420 objectAllocator.getSourceFileConstructor() 1421 ]; 1422 for (const ctor of nodeConstructors) { 1423 if (!hasProperty(ctor.prototype, "__debugKind")) { 1424 Object.defineProperties(ctor.prototype, { 1425 __tsDebuggerDisplay: { 1426 value() { 1427 const nodeHeader = isGeneratedIdentifier(this) ? "GeneratedIdentifier" : isIdentifier(this) ? `Identifier '${idText(this)}'` : isPrivateIdentifier(this) ? `PrivateIdentifier '${idText(this)}'` : isStringLiteral(this) ? `StringLiteral ${JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...")}` : isNumericLiteral(this) ? `NumericLiteral ${this.text}` : isBigIntLiteral(this) ? `BigIntLiteral ${this.text}n` : isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" : isParameter(this) ? "ParameterDeclaration" : isConstructorDeclaration(this) ? "ConstructorDeclaration" : isGetAccessorDeclaration(this) ? "GetAccessorDeclaration" : isSetAccessorDeclaration(this) ? "SetAccessorDeclaration" : isCallSignatureDeclaration(this) ? "CallSignatureDeclaration" : isConstructSignatureDeclaration(this) ? "ConstructSignatureDeclaration" : isIndexSignatureDeclaration(this) ? "IndexSignatureDeclaration" : isTypePredicateNode(this) ? "TypePredicateNode" : isTypeReferenceNode(this) ? "TypeReferenceNode" : isFunctionTypeNode(this) ? "FunctionTypeNode" : isConstructorTypeNode(this) ? "ConstructorTypeNode" : isTypeQueryNode(this) ? "TypeQueryNode" : isTypeLiteralNode(this) ? "TypeLiteralNode" : isArrayTypeNode(this) ? "ArrayTypeNode" : isTupleTypeNode(this) ? "TupleTypeNode" : isOptionalTypeNode(this) ? "OptionalTypeNode" : isRestTypeNode(this) ? "RestTypeNode" : isUnionTypeNode(this) ? "UnionTypeNode" : isIntersectionTypeNode(this) ? "IntersectionTypeNode" : isConditionalTypeNode(this) ? "ConditionalTypeNode" : isInferTypeNode(this) ? "InferTypeNode" : isParenthesizedTypeNode(this) ? "ParenthesizedTypeNode" : isThisTypeNode(this) ? "ThisTypeNode" : isTypeOperatorNode(this) ? "TypeOperatorNode" : isIndexedAccessTypeNode(this) ? "IndexedAccessTypeNode" : isMappedTypeNode(this) ? "MappedTypeNode" : isLiteralTypeNode(this) ? "LiteralTypeNode" : isNamedTupleMember(this) ? "NamedTupleMember" : isImportTypeNode(this) ? "ImportTypeNode" : formatSyntaxKind(this.kind); 1428 return `${nodeHeader}${this.flags ? ` (${formatNodeFlags(this.flags)})` : ""}`; 1429 } 1430 }, 1431 __debugKind: { get() { 1432 return formatSyntaxKind(this.kind); 1433 } }, 1434 __debugNodeFlags: { get() { 1435 return formatNodeFlags(this.flags); 1436 } }, 1437 __debugModifierFlags: { get() { 1438 return formatModifierFlags(getEffectiveModifierFlagsNoCache(this)); 1439 } }, 1440 __debugTransformFlags: { get() { 1441 return formatTransformFlags(this.transformFlags); 1442 } }, 1443 __debugIsParseTreeNode: { get() { 1444 return isParseTreeNode(this); 1445 } }, 1446 __debugEmitFlags: { get() { 1447 return formatEmitFlags(getEmitFlags(this)); 1448 } }, 1449 __debugGetText: { 1450 value(includeTrivia) { 1451 if (nodeIsSynthesized(this)) 1452 return ""; 1453 const map2 = getWeakNodeTextMap(); 1454 let text = map2 == null ? void 0 : map2.get(this); 1455 if (text === void 0) { 1456 const parseNode = getParseTreeNode(this); 1457 const sourceFile = parseNode && getSourceFileOfNode(parseNode); 1458 text = sourceFile ? getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : ""; 1459 map2 == null ? void 0 : map2.set(this, text); 1460 } 1461 return text; 1462 } 1463 } 1464 }); 1465 } 1466 } 1467 isDebugInfoEnabled = true; 1468 } 1469 Debug2.enableDebugInfo = enableDebugInfo; 1470 function formatDeprecationMessage(name, error, errorAfter, since, message) { 1471 let deprecationMessage = error ? "DeprecationError: " : "DeprecationWarning: "; 1472 deprecationMessage += `'${name}' `; 1473 deprecationMessage += since ? `has been deprecated since v${since}` : "is deprecated"; 1474 deprecationMessage += error ? " and can no longer be used." : errorAfter ? ` and will no longer be usable after v${errorAfter}.` : "."; 1475 deprecationMessage += message ? ` ${formatStringFromArgs(message, [name], 0)}` : ""; 1476 return deprecationMessage; 1477 } 1478 function createErrorDeprecation(name, errorAfter, since, message) { 1479 const deprecationMessage = formatDeprecationMessage(name, true, errorAfter, since, message); 1480 return () => { 1481 throw new TypeError(deprecationMessage); 1482 }; 1483 } 1484 function createWarningDeprecation(name, errorAfter, since, message) { 1485 let hasWrittenDeprecation = false; 1486 return () => { 1487 if (Debug2.enableDeprecationWarnings && !hasWrittenDeprecation) { 1488 log2.warn(formatDeprecationMessage(name, false, errorAfter, since, message)); 1489 hasWrittenDeprecation = true; 1490 } 1491 }; 1492 } 1493 function createDeprecation(name, options = {}) { 1494 var _a2, _b; 1495 const version2 = typeof options.typeScriptVersion === "string" ? new Version(options.typeScriptVersion) : (_a2 = options.typeScriptVersion) != null ? _a2 : getTypeScriptVersion(); 1496 const errorAfter = typeof options.errorAfter === "string" ? new Version(options.errorAfter) : options.errorAfter; 1497 const warnAfter = typeof options.warnAfter === "string" ? new Version(options.warnAfter) : options.warnAfter; 1498 const since = typeof options.since === "string" ? new Version(options.since) : (_b = options.since) != null ? _b : warnAfter; 1499 const error = options.error || errorAfter && version2.compareTo(errorAfter) <= 0; 1500 const warn = !warnAfter || version2.compareTo(warnAfter) >= 0; 1501 return error ? createErrorDeprecation(name, errorAfter, since, options.message) : warn ? createWarningDeprecation(name, errorAfter, since, options.message) : noop; 1502 } 1503 Debug2.createDeprecation = createDeprecation; 1504 function wrapFunction(deprecation, func) { 1505 return function() { 1506 deprecation(); 1507 return func.apply(this, arguments); 1508 }; 1509 } 1510 function deprecate(func, options) { 1511 var _a2; 1512 const deprecation = createDeprecation((_a2 = options == null ? void 0 : options.name) != null ? _a2 : getFunctionName(func), options); 1513 return wrapFunction(deprecation, func); 1514 } 1515 Debug2.deprecate = deprecate; 1516 function formatVariance(varianceFlags) { 1517 const variance = varianceFlags & 7 /* VarianceMask */; 1518 let result = variance === 0 /* Invariant */ ? "in out" : variance === 3 /* Bivariant */ ? "[bivariant]" : variance === 2 /* Contravariant */ ? "in" : variance === 1 /* Covariant */ ? "out" : variance === 4 /* Independent */ ? "[independent]" : ""; 1519 if (varianceFlags & 8 /* Unmeasurable */) { 1520 result += " (unmeasurable)"; 1521 } else if (varianceFlags & 16 /* Unreliable */) { 1522 result += " (unreliable)"; 1523 } 1524 return result; 1525 } 1526 Debug2.formatVariance = formatVariance; 1527 class DebugTypeMapper { 1528 __debugToString() { 1529 var _a2; 1530 type(this); 1531 switch (this.kind) { 1532 case 3 /* Function */: 1533 return ((_a2 = this.debugInfo) == null ? void 0 : _a2.call(this)) || "(function mapper)"; 1534 case 0 /* Simple */: 1535 return `${this.source.__debugTypeToString()} -> ${this.target.__debugTypeToString()}`; 1536 case 1 /* Array */: 1537 return zipWith( 1538 this.sources, 1539 this.targets || map(this.sources, () => "any"), 1540 (s, t) => `${s.__debugTypeToString()} -> ${typeof t === "string" ? t : t.__debugTypeToString()}` 1541 ).join(", "); 1542 case 2 /* Deferred */: 1543 return zipWith( 1544 this.sources, 1545 this.targets, 1546 (s, t) => `${s.__debugTypeToString()} -> ${t().__debugTypeToString()}` 1547 ).join(", "); 1548 case 5 /* Merged */: 1549 case 4 /* Composite */: 1550 return `m1: ${this.mapper1.__debugToString().split("\n").join("\n ")} 1551m2: ${this.mapper2.__debugToString().split("\n").join("\n ")}`; 1552 default: 1553 return assertNever(this); 1554 } 1555 } 1556 } 1557 Debug2.DebugTypeMapper = DebugTypeMapper; 1558 function attachDebugPrototypeIfDebug(mapper) { 1559 if (Debug2.isDebugging) { 1560 return Object.setPrototypeOf(mapper, DebugTypeMapper.prototype); 1561 } 1562 return mapper; 1563 } 1564 Debug2.attachDebugPrototypeIfDebug = attachDebugPrototypeIfDebug; 1565 function printControlFlowGraph(flowNode) { 1566 return console.log(formatControlFlowGraph(flowNode)); 1567 } 1568 Debug2.printControlFlowGraph = printControlFlowGraph; 1569 function formatControlFlowGraph(flowNode) { 1570 let nextDebugFlowId = -1; 1571 function getDebugFlowNodeId(f) { 1572 if (!f.id) { 1573 f.id = nextDebugFlowId; 1574 nextDebugFlowId--; 1575 } 1576 return f.id; 1577 } 1578 let BoxCharacter; 1579 ((BoxCharacter2) => { 1580 BoxCharacter2["lr"] = "\u2500"; 1581 BoxCharacter2["ud"] = "\u2502"; 1582 BoxCharacter2["dr"] = "\u256D"; 1583 BoxCharacter2["dl"] = "\u256E"; 1584 BoxCharacter2["ul"] = "\u256F"; 1585 BoxCharacter2["ur"] = "\u2570"; 1586 BoxCharacter2["udr"] = "\u251C"; 1587 BoxCharacter2["udl"] = "\u2524"; 1588 BoxCharacter2["dlr"] = "\u252C"; 1589 BoxCharacter2["ulr"] = "\u2534"; 1590 BoxCharacter2["udlr"] = "\u256B"; 1591 })(BoxCharacter || (BoxCharacter = {})); 1592 let Connection; 1593 ((Connection2) => { 1594 Connection2[Connection2["None"] = 0] = "None"; 1595 Connection2[Connection2["Up"] = 1] = "Up"; 1596 Connection2[Connection2["Down"] = 2] = "Down"; 1597 Connection2[Connection2["Left"] = 4] = "Left"; 1598 Connection2[Connection2["Right"] = 8] = "Right"; 1599 Connection2[Connection2["UpDown"] = 3] = "UpDown"; 1600 Connection2[Connection2["LeftRight"] = 12] = "LeftRight"; 1601 Connection2[Connection2["UpLeft"] = 5] = "UpLeft"; 1602 Connection2[Connection2["UpRight"] = 9] = "UpRight"; 1603 Connection2[Connection2["DownLeft"] = 6] = "DownLeft"; 1604 Connection2[Connection2["DownRight"] = 10] = "DownRight"; 1605 Connection2[Connection2["UpDownLeft"] = 7] = "UpDownLeft"; 1606 Connection2[Connection2["UpDownRight"] = 11] = "UpDownRight"; 1607 Connection2[Connection2["UpLeftRight"] = 13] = "UpLeftRight"; 1608 Connection2[Connection2["DownLeftRight"] = 14] = "DownLeftRight"; 1609 Connection2[Connection2["UpDownLeftRight"] = 15] = "UpDownLeftRight"; 1610 Connection2[Connection2["NoChildren"] = 16] = "NoChildren"; 1611 })(Connection || (Connection = {})); 1612 const hasAntecedentFlags = 16 /* Assignment */ | 96 /* Condition */ | 128 /* SwitchClause */ | 256 /* ArrayMutation */ | 512 /* Call */ | 1024 /* ReduceLabel */; 1613 const hasNodeFlags = 2 /* Start */ | 16 /* Assignment */ | 512 /* Call */ | 96 /* Condition */ | 256 /* ArrayMutation */; 1614 const links = /* @__PURE__ */ Object.create(null); 1615 const nodes = []; 1616 const edges = []; 1617 const root = buildGraphNode(flowNode, new Set2()); 1618 for (const node of nodes) { 1619 node.text = renderFlowNode(node.flowNode, node.circular); 1620 computeLevel(node); 1621 } 1622 const height = computeHeight(root); 1623 const columnWidths = computeColumnWidths(height); 1624 computeLanes(root, 0); 1625 return renderGraph(); 1626 function isFlowSwitchClause(f) { 1627 return !!(f.flags & 128 /* SwitchClause */); 1628 } 1629 function hasAntecedents(f) { 1630 return !!(f.flags & 12 /* Label */) && !!f.antecedents; 1631 } 1632 function hasAntecedent(f) { 1633 return !!(f.flags & hasAntecedentFlags); 1634 } 1635 function hasNode(f) { 1636 return !!(f.flags & hasNodeFlags); 1637 } 1638 function getChildren(node) { 1639 const children = []; 1640 for (const edge of node.edges) { 1641 if (edge.source === node) { 1642 children.push(edge.target); 1643 } 1644 } 1645 return children; 1646 } 1647 function getParents(node) { 1648 const parents = []; 1649 for (const edge of node.edges) { 1650 if (edge.target === node) { 1651 parents.push(edge.source); 1652 } 1653 } 1654 return parents; 1655 } 1656 function buildGraphNode(flowNode2, seen) { 1657 const id = getDebugFlowNodeId(flowNode2); 1658 let graphNode = links[id]; 1659 if (graphNode && seen.has(flowNode2)) { 1660 graphNode.circular = true; 1661 graphNode = { 1662 id: -1, 1663 flowNode: flowNode2, 1664 edges: [], 1665 text: "", 1666 lane: -1, 1667 endLane: -1, 1668 level: -1, 1669 circular: "circularity" 1670 }; 1671 nodes.push(graphNode); 1672 return graphNode; 1673 } 1674 seen.add(flowNode2); 1675 if (!graphNode) { 1676 links[id] = graphNode = { id, flowNode: flowNode2, edges: [], text: "", lane: -1, endLane: -1, level: -1, circular: false }; 1677 nodes.push(graphNode); 1678 if (hasAntecedents(flowNode2)) { 1679 for (const antecedent of flowNode2.antecedents) { 1680 buildGraphEdge(graphNode, antecedent, seen); 1681 } 1682 } else if (hasAntecedent(flowNode2)) { 1683 buildGraphEdge(graphNode, flowNode2.antecedent, seen); 1684 } 1685 } 1686 seen.delete(flowNode2); 1687 return graphNode; 1688 } 1689 function buildGraphEdge(source, antecedent, seen) { 1690 const target = buildGraphNode(antecedent, seen); 1691 const edge = { source, target }; 1692 edges.push(edge); 1693 source.edges.push(edge); 1694 target.edges.push(edge); 1695 } 1696 function computeLevel(node) { 1697 if (node.level !== -1) { 1698 return node.level; 1699 } 1700 let level = 0; 1701 for (const parent of getParents(node)) { 1702 level = Math.max(level, computeLevel(parent) + 1); 1703 } 1704 return node.level = level; 1705 } 1706 function computeHeight(node) { 1707 let height2 = 0; 1708 for (const child of getChildren(node)) { 1709 height2 = Math.max(height2, computeHeight(child)); 1710 } 1711 return height2 + 1; 1712 } 1713 function computeColumnWidths(height2) { 1714 const columns = fill(Array(height2), 0); 1715 for (const node of nodes) { 1716 columns[node.level] = Math.max(columns[node.level], node.text.length); 1717 } 1718 return columns; 1719 } 1720 function computeLanes(node, lane) { 1721 if (node.lane === -1) { 1722 node.lane = lane; 1723 node.endLane = lane; 1724 const children = getChildren(node); 1725 for (let i = 0; i < children.length; i++) { 1726 if (i > 0) { 1727 lane++; 1728 } 1729 const child = children[i]; 1730 computeLanes(child, lane); 1731 if (child.endLane > node.endLane) { 1732 lane = child.endLane; 1733 } 1734 } 1735 node.endLane = lane; 1736 } 1737 } 1738 function getHeader(flags) { 1739 if (flags & 2 /* Start */) 1740 return "Start"; 1741 if (flags & 4 /* BranchLabel */) 1742 return "Branch"; 1743 if (flags & 8 /* LoopLabel */) 1744 return "Loop"; 1745 if (flags & 16 /* Assignment */) 1746 return "Assignment"; 1747 if (flags & 32 /* TrueCondition */) 1748 return "True"; 1749 if (flags & 64 /* FalseCondition */) 1750 return "False"; 1751 if (flags & 128 /* SwitchClause */) 1752 return "SwitchClause"; 1753 if (flags & 256 /* ArrayMutation */) 1754 return "ArrayMutation"; 1755 if (flags & 512 /* Call */) 1756 return "Call"; 1757 if (flags & 1024 /* ReduceLabel */) 1758 return "ReduceLabel"; 1759 if (flags & 1 /* Unreachable */) 1760 return "Unreachable"; 1761 throw new Error(); 1762 } 1763 function getNodeText(node) { 1764 const sourceFile = getSourceFileOfNode(node); 1765 return getSourceTextOfNodeFromSourceFile(sourceFile, node, false); 1766 } 1767 function renderFlowNode(flowNode2, circular) { 1768 let text = getHeader(flowNode2.flags); 1769 if (circular) { 1770 text = `${text}#${getDebugFlowNodeId(flowNode2)}`; 1771 } 1772 if (hasNode(flowNode2)) { 1773 if (flowNode2.node) { 1774 text += ` (${getNodeText(flowNode2.node)})`; 1775 } 1776 } else if (isFlowSwitchClause(flowNode2)) { 1777 const clauses = []; 1778 for (let i = flowNode2.clauseStart; i < flowNode2.clauseEnd; i++) { 1779 const clause = flowNode2.switchStatement.caseBlock.clauses[i]; 1780 if (isDefaultClause(clause)) { 1781 clauses.push("default"); 1782 } else { 1783 clauses.push(getNodeText(clause.expression)); 1784 } 1785 } 1786 text += ` (${clauses.join(", ")})`; 1787 } 1788 return circular === "circularity" ? `Circular(${text})` : text; 1789 } 1790 function renderGraph() { 1791 const columnCount = columnWidths.length; 1792 const laneCount = nodes.reduce((x, n) => Math.max(x, n.lane), 0) + 1; 1793 const lanes = fill(Array(laneCount), ""); 1794 const grid = columnWidths.map(() => Array(laneCount)); 1795 const connectors = columnWidths.map(() => fill(Array(laneCount), 0)); 1796 for (const node of nodes) { 1797 grid[node.level][node.lane] = node; 1798 const children = getChildren(node); 1799 for (let i = 0; i < children.length; i++) { 1800 const child = children[i]; 1801 let connector = 8 /* Right */; 1802 if (child.lane === node.lane) 1803 connector |= 4 /* Left */; 1804 if (i > 0) 1805 connector |= 1 /* Up */; 1806 if (i < children.length - 1) 1807 connector |= 2 /* Down */; 1808 connectors[node.level][child.lane] |= connector; 1809 } 1810 if (children.length === 0) { 1811 connectors[node.level][node.lane] |= 16 /* NoChildren */; 1812 } 1813 const parents = getParents(node); 1814 for (let i = 0; i < parents.length; i++) { 1815 const parent = parents[i]; 1816 let connector = 4 /* Left */; 1817 if (i > 0) 1818 connector |= 1 /* Up */; 1819 if (i < parents.length - 1) 1820 connector |= 2 /* Down */; 1821 connectors[node.level - 1][parent.lane] |= connector; 1822 } 1823 } 1824 for (let column = 0; column < columnCount; column++) { 1825 for (let lane = 0; lane < laneCount; lane++) { 1826 const left = column > 0 ? connectors[column - 1][lane] : 0; 1827 const above = lane > 0 ? connectors[column][lane - 1] : 0; 1828 let connector = connectors[column][lane]; 1829 if (!connector) { 1830 if (left & 8 /* Right */) 1831 connector |= 12 /* LeftRight */; 1832 if (above & 2 /* Down */) 1833 connector |= 3 /* UpDown */; 1834 connectors[column][lane] = connector; 1835 } 1836 } 1837 } 1838 for (let column = 0; column < columnCount; column++) { 1839 for (let lane = 0; lane < lanes.length; lane++) { 1840 const connector = connectors[column][lane]; 1841 const fill2 = connector & 4 /* Left */ ? "\u2500" /* lr */ : " "; 1842 const node = grid[column][lane]; 1843 if (!node) { 1844 if (column < columnCount - 1) { 1845 writeLane(lane, repeat(fill2, columnWidths[column] + 1)); 1846 } 1847 } else { 1848 writeLane(lane, node.text); 1849 if (column < columnCount - 1) { 1850 writeLane(lane, " "); 1851 writeLane(lane, repeat(fill2, columnWidths[column] - node.text.length)); 1852 } 1853 } 1854 writeLane(lane, getBoxCharacter(connector)); 1855 writeLane(lane, connector & 8 /* Right */ && column < columnCount - 1 && !grid[column + 1][lane] ? "\u2500" /* lr */ : " "); 1856 } 1857 } 1858 return ` 1859${lanes.join("\n")} 1860`; 1861 function writeLane(lane, text) { 1862 lanes[lane] += text; 1863 } 1864 } 1865 function getBoxCharacter(connector) { 1866 switch (connector) { 1867 case 3 /* UpDown */: 1868 return "\u2502" /* ud */; 1869 case 12 /* LeftRight */: 1870 return "\u2500" /* lr */; 1871 case 5 /* UpLeft */: 1872 return "\u256F" /* ul */; 1873 case 9 /* UpRight */: 1874 return "\u2570" /* ur */; 1875 case 6 /* DownLeft */: 1876 return "\u256E" /* dl */; 1877 case 10 /* DownRight */: 1878 return "\u256D" /* dr */; 1879 case 7 /* UpDownLeft */: 1880 return "\u2524" /* udl */; 1881 case 11 /* UpDownRight */: 1882 return "\u251C" /* udr */; 1883 case 13 /* UpLeftRight */: 1884 return "\u2534" /* ulr */; 1885 case 14 /* DownLeftRight */: 1886 return "\u252C" /* dlr */; 1887 case 15 /* UpDownLeftRight */: 1888 return "\u256B" /* udlr */; 1889 } 1890 return " "; 1891 } 1892 function fill(array, value) { 1893 if (array.fill) { 1894 array.fill(value); 1895 } else { 1896 for (let i = 0; i < array.length; i++) { 1897 array[i] = value; 1898 } 1899 } 1900 return array; 1901 } 1902 function repeat(ch, length2) { 1903 if (ch.repeat) { 1904 return length2 > 0 ? ch.repeat(length2) : ""; 1905 } 1906 let s = ""; 1907 while (s.length < length2) { 1908 s += ch; 1909 } 1910 return s; 1911 } 1912 } 1913 Debug2.formatControlFlowGraph = formatControlFlowGraph; 1914})(Debug || (Debug = {})); 1915 1916// src/compiler/semver.ts 1917var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i; 1918var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i; 1919var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i; 1920var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i; 1921var buildPartRegExp = /^[a-z0-9-]+$/i; 1922var numericIdentifierRegExp = /^(0|[1-9]\d*)$/; 1923var _Version = class { 1924 constructor(major, minor = 0, patch = 0, prerelease = "", build = "") { 1925 if (typeof major === "string") { 1926 const result = Debug.checkDefined(tryParseComponents(major), "Invalid version"); 1927 ({ major, minor, patch, prerelease, build } = result); 1928 } 1929 Debug.assert(major >= 0, "Invalid argument: major"); 1930 Debug.assert(minor >= 0, "Invalid argument: minor"); 1931 Debug.assert(patch >= 0, "Invalid argument: patch"); 1932 const prereleaseArray = prerelease ? isArray(prerelease) ? prerelease : prerelease.split(".") : emptyArray; 1933 const buildArray = build ? isArray(build) ? build : build.split(".") : emptyArray; 1934 Debug.assert(every(prereleaseArray, (s) => prereleasePartRegExp.test(s)), "Invalid argument: prerelease"); 1935 Debug.assert(every(buildArray, (s) => buildPartRegExp.test(s)), "Invalid argument: build"); 1936 this.major = major; 1937 this.minor = minor; 1938 this.patch = patch; 1939 this.prerelease = prereleaseArray; 1940 this.build = buildArray; 1941 } 1942 static tryParse(text) { 1943 const result = tryParseComponents(text); 1944 if (!result) 1945 return void 0; 1946 const { major, minor, patch, prerelease, build } = result; 1947 return new _Version(major, minor, patch, prerelease, build); 1948 } 1949 compareTo(other) { 1950 if (this === other) 1951 return 0 /* EqualTo */; 1952 if (other === void 0) 1953 return 1 /* GreaterThan */; 1954 return compareValues(this.major, other.major) || compareValues(this.minor, other.minor) || compareValues(this.patch, other.patch) || comparePrereleaseIdentifiers(this.prerelease, other.prerelease); 1955 } 1956 increment(field) { 1957 switch (field) { 1958 case "major": 1959 return new _Version(this.major + 1, 0, 0); 1960 case "minor": 1961 return new _Version(this.major, this.minor + 1, 0); 1962 case "patch": 1963 return new _Version(this.major, this.minor, this.patch + 1); 1964 default: 1965 return Debug.assertNever(field); 1966 } 1967 } 1968 with(fields) { 1969 const { 1970 major = this.major, 1971 minor = this.minor, 1972 patch = this.patch, 1973 prerelease = this.prerelease, 1974 build = this.build 1975 } = fields; 1976 return new _Version(major, minor, patch, prerelease, build); 1977 } 1978 toString() { 1979 let result = `${this.major}.${this.minor}.${this.patch}`; 1980 if (some(this.prerelease)) 1981 result += `-${this.prerelease.join(".")}`; 1982 if (some(this.build)) 1983 result += `+${this.build.join(".")}`; 1984 return result; 1985 } 1986}; 1987var Version = _Version; 1988Version.zero = new _Version(0, 0, 0, ["0"]); 1989function tryParseComponents(text) { 1990 const match = versionRegExp.exec(text); 1991 if (!match) 1992 return void 0; 1993 const [, major, minor = "0", patch = "0", prerelease = "", build = ""] = match; 1994 if (prerelease && !prereleaseRegExp.test(prerelease)) 1995 return void 0; 1996 if (build && !buildRegExp.test(build)) 1997 return void 0; 1998 return { 1999 major: parseInt(major, 10), 2000 minor: parseInt(minor, 10), 2001 patch: parseInt(patch, 10), 2002 prerelease, 2003 build 2004 }; 2005} 2006function comparePrereleaseIdentifiers(left, right) { 2007 if (left === right) 2008 return 0 /* EqualTo */; 2009 if (left.length === 0) 2010 return right.length === 0 ? 0 /* EqualTo */ : 1 /* GreaterThan */; 2011 if (right.length === 0) 2012 return -1 /* LessThan */; 2013 const length2 = Math.min(left.length, right.length); 2014 for (let i = 0; i < length2; i++) { 2015 const leftIdentifier = left[i]; 2016 const rightIdentifier = right[i]; 2017 if (leftIdentifier === rightIdentifier) 2018 continue; 2019 const leftIsNumeric = numericIdentifierRegExp.test(leftIdentifier); 2020 const rightIsNumeric = numericIdentifierRegExp.test(rightIdentifier); 2021 if (leftIsNumeric || rightIsNumeric) { 2022 if (leftIsNumeric !== rightIsNumeric) 2023 return leftIsNumeric ? -1 /* LessThan */ : 1 /* GreaterThan */; 2024 const result = compareValues(+leftIdentifier, +rightIdentifier); 2025 if (result) 2026 return result; 2027 } else { 2028 const result = compareStringsCaseSensitive(leftIdentifier, rightIdentifier); 2029 if (result) 2030 return result; 2031 } 2032 } 2033 return compareValues(left.length, right.length); 2034} 2035var VersionRange = class { 2036 constructor(spec) { 2037 this._alternatives = spec ? Debug.checkDefined(parseRange(spec), "Invalid range spec.") : emptyArray; 2038 } 2039 static tryParse(text) { 2040 const sets = parseRange(text); 2041 if (sets) { 2042 const range = new VersionRange(""); 2043 range._alternatives = sets; 2044 return range; 2045 } 2046 return void 0; 2047 } 2048 test(version2) { 2049 if (typeof version2 === "string") 2050 version2 = new Version(version2); 2051 return testDisjunction(version2, this._alternatives); 2052 } 2053 toString() { 2054 return formatDisjunction(this._alternatives); 2055 } 2056}; 2057var logicalOrRegExp = /\|\|/g; 2058var whitespaceRegExp = /\s+/g; 2059var partialRegExp = /^([xX*0]|[1-9]\d*)(?:\.([xX*0]|[1-9]\d*)(?:\.([xX*0]|[1-9]\d*)(?:-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i; 2060var hyphenRegExp = /^\s*([a-z0-9-+.*]+)\s+-\s+([a-z0-9-+.*]+)\s*$/i; 2061var rangeRegExp = /^(~|\^|<|<=|>|>=|=)?\s*([a-z0-9-+.*]+)$/i; 2062function parseRange(text) { 2063 const alternatives = []; 2064 for (let range of trimString(text).split(logicalOrRegExp)) { 2065 if (!range) 2066 continue; 2067 const comparators = []; 2068 range = trimString(range); 2069 const match = hyphenRegExp.exec(range); 2070 if (match) { 2071 if (!parseHyphen(match[1], match[2], comparators)) 2072 return void 0; 2073 } else { 2074 for (const simple of range.split(whitespaceRegExp)) { 2075 const match2 = rangeRegExp.exec(trimString(simple)); 2076 if (!match2 || !parseComparator(match2[1], match2[2], comparators)) 2077 return void 0; 2078 } 2079 } 2080 alternatives.push(comparators); 2081 } 2082 return alternatives; 2083} 2084function parsePartial(text) { 2085 const match = partialRegExp.exec(text); 2086 if (!match) 2087 return void 0; 2088 const [, major, minor = "*", patch = "*", prerelease, build] = match; 2089 const version2 = new Version( 2090 isWildcard(major) ? 0 : parseInt(major, 10), 2091 isWildcard(major) || isWildcard(minor) ? 0 : parseInt(minor, 10), 2092 isWildcard(major) || isWildcard(minor) || isWildcard(patch) ? 0 : parseInt(patch, 10), 2093 prerelease, 2094 build 2095 ); 2096 return { version: version2, major, minor, patch }; 2097} 2098function parseHyphen(left, right, comparators) { 2099 const leftResult = parsePartial(left); 2100 if (!leftResult) 2101 return false; 2102 const rightResult = parsePartial(right); 2103 if (!rightResult) 2104 return false; 2105 if (!isWildcard(leftResult.major)) { 2106 comparators.push(createComparator(">=", leftResult.version)); 2107 } 2108 if (!isWildcard(rightResult.major)) { 2109 comparators.push( 2110 isWildcard(rightResult.minor) ? createComparator("<", rightResult.version.increment("major")) : isWildcard(rightResult.patch) ? createComparator("<", rightResult.version.increment("minor")) : createComparator("<=", rightResult.version) 2111 ); 2112 } 2113 return true; 2114} 2115function parseComparator(operator, text, comparators) { 2116 const result = parsePartial(text); 2117 if (!result) 2118 return false; 2119 const { version: version2, major, minor, patch } = result; 2120 if (!isWildcard(major)) { 2121 switch (operator) { 2122 case "~": 2123 comparators.push(createComparator(">=", version2)); 2124 comparators.push(createComparator("<", version2.increment( 2125 isWildcard(minor) ? "major" : "minor" 2126 ))); 2127 break; 2128 case "^": 2129 comparators.push(createComparator(">=", version2)); 2130 comparators.push(createComparator("<", version2.increment( 2131 version2.major > 0 || isWildcard(minor) ? "major" : version2.minor > 0 || isWildcard(patch) ? "minor" : "patch" 2132 ))); 2133 break; 2134 case "<": 2135 case ">=": 2136 comparators.push( 2137 isWildcard(minor) || isWildcard(patch) ? createComparator(operator, version2.with({ prerelease: "0" })) : createComparator(operator, version2) 2138 ); 2139 break; 2140 case "<=": 2141 case ">": 2142 comparators.push( 2143 isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version2.increment("major").with({ prerelease: "0" })) : isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version2.increment("minor").with({ prerelease: "0" })) : createComparator(operator, version2) 2144 ); 2145 break; 2146 case "=": 2147 case void 0: 2148 if (isWildcard(minor) || isWildcard(patch)) { 2149 comparators.push(createComparator(">=", version2.with({ prerelease: "0" }))); 2150 comparators.push(createComparator("<", version2.increment(isWildcard(minor) ? "major" : "minor").with({ prerelease: "0" }))); 2151 } else { 2152 comparators.push(createComparator("=", version2)); 2153 } 2154 break; 2155 default: 2156 return false; 2157 } 2158 } else if (operator === "<" || operator === ">") { 2159 comparators.push(createComparator("<", Version.zero)); 2160 } 2161 return true; 2162} 2163function isWildcard(part) { 2164 return part === "*" || part === "x" || part === "X"; 2165} 2166function createComparator(operator, operand) { 2167 return { operator, operand }; 2168} 2169function testDisjunction(version2, alternatives) { 2170 if (alternatives.length === 0) 2171 return true; 2172 for (const alternative of alternatives) { 2173 if (testAlternative(version2, alternative)) 2174 return true; 2175 } 2176 return false; 2177} 2178function testAlternative(version2, comparators) { 2179 for (const comparator of comparators) { 2180 if (!testComparator(version2, comparator.operator, comparator.operand)) 2181 return false; 2182 } 2183 return true; 2184} 2185function testComparator(version2, operator, operand) { 2186 const cmp = version2.compareTo(operand); 2187 switch (operator) { 2188 case "<": 2189 return cmp < 0; 2190 case "<=": 2191 return cmp <= 0; 2192 case ">": 2193 return cmp > 0; 2194 case ">=": 2195 return cmp >= 0; 2196 case "=": 2197 return cmp === 0; 2198 default: 2199 return Debug.assertNever(operator); 2200 } 2201} 2202function formatDisjunction(alternatives) { 2203 return map(alternatives, formatAlternative).join(" || ") || "*"; 2204} 2205function formatAlternative(comparators) { 2206 return map(comparators, formatComparator).join(" "); 2207} 2208function formatComparator(comparator) { 2209 return `${comparator.operator}${comparator.operand}`; 2210} 2211 2212// src/compiler/performanceCore.ts 2213function hasRequiredAPI(performance2, PerformanceObserver2) { 2214 return typeof performance2 === "object" && typeof performance2.timeOrigin === "number" && typeof performance2.mark === "function" && typeof performance2.measure === "function" && typeof performance2.now === "function" && typeof performance2.clearMarks === "function" && typeof performance2.clearMeasures === "function" && typeof PerformanceObserver2 === "function"; 2215} 2216function tryGetWebPerformanceHooks() { 2217 if (typeof performance === "object" && typeof PerformanceObserver === "function" && hasRequiredAPI(performance, PerformanceObserver)) { 2218 return { 2219 shouldWriteNativeEvents: true, 2220 performance, 2221 PerformanceObserver 2222 }; 2223 } 2224} 2225function tryGetNodePerformanceHooks() { 2226 if (isNodeLikeSystem()) { 2227 try { 2228 let performance2; 2229 const { performance: nodePerformance, PerformanceObserver: PerformanceObserver2 } = require("perf_hooks"); 2230 if (hasRequiredAPI(nodePerformance, PerformanceObserver2)) { 2231 performance2 = nodePerformance; 2232 const version2 = new Version(process.versions.node); 2233 const range = new VersionRange("<12.16.3 || 13 <13.13"); 2234 if (range.test(version2)) { 2235 performance2 = { 2236 get timeOrigin() { 2237 return nodePerformance.timeOrigin; 2238 }, 2239 now() { 2240 return nodePerformance.now(); 2241 }, 2242 mark(name) { 2243 return nodePerformance.mark(name); 2244 }, 2245 measure(name, start = "nodeStart", end) { 2246 if (end === void 0) { 2247 end = "__performance.measure-fix__"; 2248 nodePerformance.mark(end); 2249 } 2250 nodePerformance.measure(name, start, end); 2251 if (end === "__performance.measure-fix__") { 2252 nodePerformance.clearMarks("__performance.measure-fix__"); 2253 } 2254 }, 2255 clearMarks(name) { 2256 return nodePerformance.clearMarks(name); 2257 }, 2258 clearMeasures(name) { 2259 return nodePerformance.clearMeasures(name); 2260 } 2261 }; 2262 } 2263 return { 2264 shouldWriteNativeEvents: false, 2265 performance: performance2, 2266 PerformanceObserver: PerformanceObserver2 2267 }; 2268 } 2269 } catch (e) { 2270 } 2271 } 2272} 2273var nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks(); 2274var nativePerformance = nativePerformanceHooks == null ? void 0 : nativePerformanceHooks.performance; 2275var timestamp = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +new Date(); 2276 2277// src/compiler/performanceDotting.ts 2278var PerformanceDotting; 2279((PerformanceDotting2) => { 2280 const eventStack = []; 2281 const timeStack = []; 2282 let tempMap = new Map2(); 2283 let recordMap = new Map2(); 2284 let timeHooks = require("perf_hooks"); 2285 let count = 0; 2286 const layerCount = 5; 2287 let advancedSwitch = false; 2288 let traceSwitch = false; 2289 const TIME_CONVERSION = 1e6; 2290 let AnalyzeMode; 2291 ((AnalyzeMode2) => { 2292 AnalyzeMode2[AnalyzeMode2["DEFAULT"] = 0] = "DEFAULT"; 2293 AnalyzeMode2[AnalyzeMode2["VERBOSE"] = 1] = "VERBOSE"; 2294 AnalyzeMode2[AnalyzeMode2["TRACE"] = 3] = "TRACE"; 2295 })(AnalyzeMode = PerformanceDotting2.AnalyzeMode || (PerformanceDotting2.AnalyzeMode = {})); 2296 function setPerformanceSwitch(projectConfigPerf) { 2297 if (projectConfigPerf === 1 /* VERBOSE */) { 2298 advancedSwitch = true; 2299 } 2300 if (projectConfigPerf === 3 /* TRACE */) { 2301 advancedSwitch = true; 2302 traceSwitch = true; 2303 } 2304 } 2305 PerformanceDotting2.setPerformanceSwitch = setPerformanceSwitch; 2306 function processSharedStart(eventName, fileName) { 2307 if (++count > layerCount) { 2308 return; 2309 } 2310 const currentEvent = eventName; 2311 const currentParentEvent = eventStack.length > 0 ? eventStack[eventStack.length - 1] : ""; 2312 const currentParentId = timeStack.length > 0 ? timeStack[timeStack.length - 1] : ""; 2313 const fullPath = eventStack.length > 0 ? `${eventStack.join("-")}-${eventName}` : eventName; 2314 let startTime = timeHooks.performance.now(); 2315 let id = startTime.toString(); 2316 const recordCurrentData = { 2317 startTime, 2318 endTime: -1, 2319 duration: 0, 2320 name: currentEvent, 2321 parentEvent: currentParentEvent, 2322 tier: count, 2323 fullPath, 2324 id, 2325 parentId: currentParentId, 2326 fileName 2327 }; 2328 addOrUpdateEventData(tempMap, eventName, recordCurrentData); 2329 eventStack.push(eventName); 2330 timeStack.push(id); 2331 } 2332 function processSharedStop(eventName) { 2333 if (count-- > layerCount) { 2334 return; 2335 } 2336 if (eventStack.length === 0 || eventStack[eventStack.length - 1] !== eventName) { 2337 throw new Error(`Event ${eventName} is not the current active event`); 2338 } 2339 const records = tempMap.get(eventName); 2340 if (records && records.length > 0) { 2341 const lastRecord = records.pop(); 2342 lastRecord.endTime = timeHooks.performance.now(); 2343 lastRecord.duration = lastRecord.endTime - lastRecord.startTime; 2344 addOrUpdateEventData(recordMap, eventName, lastRecord); 2345 } else { 2346 throw new Error(`No active record found for event ${eventName}`); 2347 } 2348 eventStack.pop(); 2349 timeStack.pop(); 2350 } 2351 function startAdvanced(eventName, fileName = "") { 2352 if (!advancedSwitch) { 2353 return; 2354 } 2355 processSharedStart(eventName, fileName); 2356 } 2357 PerformanceDotting2.startAdvanced = startAdvanced; 2358 function stopAdvanced(eventName) { 2359 if (!advancedSwitch) { 2360 return; 2361 } 2362 processSharedStop(eventName); 2363 } 2364 PerformanceDotting2.stopAdvanced = stopAdvanced; 2365 function start(eventName, fileName = "") { 2366 if (!traceSwitch) { 2367 return; 2368 } 2369 processSharedStart(eventName, fileName); 2370 } 2371 PerformanceDotting2.start = start; 2372 function addOrUpdateEventData(map2, eventName, data) { 2373 let records = map2.get(eventName); 2374 if (!records) { 2375 records = []; 2376 map2.set(eventName, records); 2377 } 2378 records.push(data); 2379 } 2380 function stop(eventName) { 2381 if (!traceSwitch) { 2382 return; 2383 } 2384 processSharedStop(eventName); 2385 } 2386 PerformanceDotting2.stop = stop; 2387 function getEventData() { 2388 const mergedRecordsMap = new Map2(); 2389 recordMap.forEach((records) => { 2390 records.forEach((record) => { 2391 const key = `${record.fullPath}-${record.fileName}-${record.parentId}`; 2392 if (mergedRecordsMap.has(key)) { 2393 const existingRecord = mergedRecordsMap.get(key); 2394 existingRecord.duration += record.duration; 2395 existingRecord.startTime = Math.min(existingRecord.startTime, record.startTime); 2396 existingRecord.endTime = Math.max(existingRecord.endTime, record.endTime); 2397 } else { 2398 mergedRecordsMap.set(key, record); 2399 } 2400 }); 2401 }); 2402 let mergedRecords = Array.from(mapValuesToArray(mergedRecordsMap)); 2403 mergedRecords = mergedRecords.map((record) => ({ 2404 ...record, 2405 duration: record.duration * TIME_CONVERSION 2406 })); 2407 clearEvent(); 2408 return mergedRecords; 2409 } 2410 PerformanceDotting2.getEventData = getEventData; 2411 function mapValuesToArray(map2) { 2412 const result = []; 2413 const iterator = map2.values(); 2414 let item; 2415 while (!(item = iterator.next()).done) { 2416 result.push(item.value); 2417 } 2418 return result; 2419 } 2420 function clearEvent() { 2421 recordMap.clear(); 2422 tempMap.clear(); 2423 eventStack.length = 0; 2424 timeStack.length = 0; 2425 count = 0; 2426 advancedSwitch = false; 2427 traceSwitch = false; 2428 } 2429 PerformanceDotting2.clearEvent = clearEvent; 2430})(PerformanceDotting || (PerformanceDotting = {})); 2431 2432// src/compiler/perfLogger.ts 2433var nullLogger = { 2434 logEvent: noop, 2435 logErrEvent: noop, 2436 logPerfEvent: noop, 2437 logInfoEvent: noop, 2438 logStartCommand: noop, 2439 logStopCommand: noop, 2440 logStartUpdateProgram: noop, 2441 logStopUpdateProgram: noop, 2442 logStartUpdateGraph: noop, 2443 logStopUpdateGraph: noop, 2444 logStartResolveModule: noop, 2445 logStopResolveModule: noop, 2446 logStartParseSourceFile: noop, 2447 logStopParseSourceFile: noop, 2448 logStartReadFile: noop, 2449 logStopReadFile: noop, 2450 logStartBindFile: noop, 2451 logStopBindFile: noop, 2452 logStartScheduledOperation: noop, 2453 logStopScheduledOperation: noop 2454}; 2455var etwModule; 2456var _a; 2457try { 2458 const etwModulePath = (_a = process.env.TS_ETW_MODULE_PATH) != null ? _a : "./node_modules/@microsoft/typescript-etw"; 2459 etwModule = require(etwModulePath); 2460} catch (e) { 2461 etwModule = void 0; 2462} 2463var perfLogger = (etwModule == null ? void 0 : etwModule.logEvent) ? etwModule : nullLogger; 2464 2465// src/compiler/performance.ts 2466var performanceImpl; 2467function createTimerIf(condition, measureName, startMarkName, endMarkName) { 2468 return condition ? createTimer(measureName, startMarkName, endMarkName) : nullTimer; 2469} 2470function createTimer(measureName, startMarkName, endMarkName) { 2471 let enterCount = 0; 2472 return { 2473 enter, 2474 exit 2475 }; 2476 function enter() { 2477 if (++enterCount === 1) { 2478 mark(startMarkName); 2479 } 2480 } 2481 function exit() { 2482 if (--enterCount === 0) { 2483 mark(endMarkName); 2484 measure(measureName, startMarkName, endMarkName); 2485 } else if (enterCount < 0) { 2486 Debug.fail("enter/exit count does not match."); 2487 } 2488 } 2489} 2490var nullTimer = { enter: noop, exit: noop }; 2491var enabled = false; 2492var timeorigin = timestamp(); 2493var marks = new Map2(); 2494var counts = new Map2(); 2495var durations = new Map2(); 2496function mark(markName) { 2497 var _a2; 2498 if (enabled) { 2499 const count = (_a2 = counts.get(markName)) != null ? _a2 : 0; 2500 counts.set(markName, count + 1); 2501 marks.set(markName, timestamp()); 2502 performanceImpl == null ? void 0 : performanceImpl.mark(markName); 2503 } 2504} 2505function measure(measureName, startMarkName, endMarkName) { 2506 var _a2, _b; 2507 if (enabled) { 2508 const end = (_a2 = endMarkName !== void 0 ? marks.get(endMarkName) : void 0) != null ? _a2 : timestamp(); 2509 const start = (_b = startMarkName !== void 0 ? marks.get(startMarkName) : void 0) != null ? _b : timeorigin; 2510 const previousDuration = durations.get(measureName) || 0; 2511 durations.set(measureName, previousDuration + (end - start)); 2512 performanceImpl == null ? void 0 : performanceImpl.measure(measureName, startMarkName, endMarkName); 2513 } 2514} 2515 2516// src/compiler/tracing.ts 2517var tracing; 2518var tracingEnabled; 2519((tracingEnabled2) => { 2520 let fs2; 2521 let traceCount = 0; 2522 let traceFd = 0; 2523 let mode; 2524 const typeCatalog = []; 2525 let legendPath; 2526 const legend = []; 2527 function startTracing2(tracingMode, traceDir, configFilePath) { 2528 Debug.assert(!tracing, "Tracing already started"); 2529 if (fs2 === void 0) { 2530 try { 2531 fs2 = require("fs"); 2532 } catch (e) { 2533 throw new Error(`tracing requires having fs 2534(original error: ${e.message || e})`); 2535 } 2536 } 2537 mode = tracingMode; 2538 typeCatalog.length = 0; 2539 if (legendPath === void 0) { 2540 legendPath = combinePaths(traceDir, "legend.json"); 2541 } 2542 if (!fs2.existsSync(traceDir)) { 2543 fs2.mkdirSync(traceDir, { recursive: true }); 2544 } 2545 const countPart = mode === "build" ? `.${process.pid}-${++traceCount}` : mode === "server" ? `.${process.pid}` : ``; 2546 const tracePath = combinePaths(traceDir, `trace${countPart}.json`); 2547 const typesPath = combinePaths(traceDir, `types${countPart}.json`); 2548 legend.push({ 2549 configFilePath, 2550 tracePath, 2551 typesPath 2552 }); 2553 traceFd = fs2.openSync(tracePath, "w"); 2554 tracing = tracingEnabled2; 2555 const meta = { cat: "__metadata", ph: "M", ts: 1e3 * timestamp(), pid: 1, tid: 1 }; 2556 fs2.writeSync( 2557 traceFd, 2558 "[\n" + [ 2559 { name: "process_name", args: { name: "tsc" }, ...meta }, 2560 { name: "thread_name", args: { name: "Main" }, ...meta }, 2561 { name: "TracingStartedInBrowser", ...meta, cat: "disabled-by-default-devtools.timeline" } 2562 ].map((v) => JSON.stringify(v)).join(",\n") 2563 ); 2564 } 2565 tracingEnabled2.startTracing = startTracing2; 2566 function stopTracing() { 2567 Debug.assert(tracing, "Tracing is not in progress"); 2568 Debug.assert(!!typeCatalog.length === (mode !== "server")); 2569 fs2.writeSync(traceFd, ` 2570] 2571`); 2572 fs2.closeSync(traceFd); 2573 tracing = void 0; 2574 if (typeCatalog.length) { 2575 dumpTypes(typeCatalog); 2576 } else { 2577 legend[legend.length - 1].typesPath = void 0; 2578 } 2579 } 2580 tracingEnabled2.stopTracing = stopTracing; 2581 function recordType(type) { 2582 if (mode !== "server") { 2583 typeCatalog.push(type); 2584 } 2585 } 2586 tracingEnabled2.recordType = recordType; 2587 let Phase; 2588 ((Phase2) => { 2589 Phase2["Parse"] = "parse"; 2590 Phase2["Program"] = "program"; 2591 Phase2["Bind"] = "bind"; 2592 Phase2["Check"] = "check"; 2593 Phase2["CheckTypes"] = "checkTypes"; 2594 Phase2["Emit"] = "emit"; 2595 Phase2["Session"] = "session"; 2596 })(Phase = tracingEnabled2.Phase || (tracingEnabled2.Phase = {})); 2597 function instant(phase, name, args) { 2598 writeEvent("I", phase, name, args, `"s":"g"`); 2599 } 2600 tracingEnabled2.instant = instant; 2601 const eventStack = []; 2602 function push(phase, name, args, separateBeginAndEnd = false) { 2603 if (separateBeginAndEnd) { 2604 writeEvent("B", phase, name, args); 2605 } 2606 eventStack.push({ phase, name, args, time: 1e3 * timestamp(), separateBeginAndEnd }); 2607 } 2608 tracingEnabled2.push = push; 2609 function pop(results) { 2610 Debug.assert(eventStack.length > 0); 2611 writeStackEvent(eventStack.length - 1, 1e3 * timestamp(), results); 2612 eventStack.length--; 2613 } 2614 tracingEnabled2.pop = pop; 2615 function popAll() { 2616 const endTime = 1e3 * timestamp(); 2617 for (let i = eventStack.length - 1; i >= 0; i--) { 2618 writeStackEvent(i, endTime); 2619 } 2620 eventStack.length = 0; 2621 } 2622 tracingEnabled2.popAll = popAll; 2623 const sampleInterval = 1e3 * 10; 2624 function writeStackEvent(index, endTime, results) { 2625 const { phase, name, args, time, separateBeginAndEnd } = eventStack[index]; 2626 if (separateBeginAndEnd) { 2627 Debug.assert(!results, "`results` are not supported for events with `separateBeginAndEnd`"); 2628 writeEvent("E", phase, name, args, void 0, endTime); 2629 } else if (sampleInterval - time % sampleInterval <= endTime - time) { 2630 writeEvent("X", phase, name, { ...args, results }, `"dur":${endTime - time}`, time); 2631 } 2632 } 2633 function writeEvent(eventType, phase, name, args, extras, time = 1e3 * timestamp()) { 2634 if (mode === "server" && phase === "checkTypes" /* CheckTypes */) 2635 return; 2636 mark("beginTracing"); 2637 fs2.writeSync(traceFd, `, 2638{"pid":1,"tid":1,"ph":"${eventType}","cat":"${phase}","ts":${time},"name":"${name}"`); 2639 if (extras) 2640 fs2.writeSync(traceFd, `,${extras}`); 2641 if (args) 2642 fs2.writeSync(traceFd, `,"args":${JSON.stringify(args)}`); 2643 fs2.writeSync(traceFd, `}`); 2644 mark("endTracing"); 2645 measure("Tracing", "beginTracing", "endTracing"); 2646 } 2647 function getLocation(node) { 2648 const file = getSourceFileOfNode(node); 2649 return !file ? void 0 : { 2650 path: file.path, 2651 start: indexFromOne(getLineAndCharacterOfPosition(file, node.pos)), 2652 end: indexFromOne(getLineAndCharacterOfPosition(file, node.end)) 2653 }; 2654 function indexFromOne(lc) { 2655 return { 2656 line: lc.line + 1, 2657 character: lc.character + 1 2658 }; 2659 } 2660 } 2661 function dumpTypes(types) { 2662 var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v; 2663 mark("beginDumpTypes"); 2664 const typesPath = legend[legend.length - 1].typesPath; 2665 const typesFd = fs2.openSync(typesPath, "w"); 2666 const recursionIdentityMap = new Map2(); 2667 fs2.writeSync(typesFd, "["); 2668 const numTypes = types.length; 2669 for (let i = 0; i < numTypes; i++) { 2670 const type = types[i]; 2671 const objectFlags = type.objectFlags; 2672 const symbol = (_a2 = type.aliasSymbol) != null ? _a2 : type.symbol; 2673 let display; 2674 if (objectFlags & 16 /* Anonymous */ | type.flags & 2944 /* Literal */) { 2675 try { 2676 display = (_b = type.checker) == null ? void 0 : _b.typeToString(type); 2677 } catch (e) { 2678 display = void 0; 2679 } 2680 } 2681 let indexedAccessProperties = {}; 2682 if (type.flags & 8388608 /* IndexedAccess */) { 2683 const indexedAccessType = type; 2684 indexedAccessProperties = { 2685 indexedAccessObjectType: (_c = indexedAccessType.objectType) == null ? void 0 : _c.id, 2686 indexedAccessIndexType: (_d = indexedAccessType.indexType) == null ? void 0 : _d.id 2687 }; 2688 } 2689 let referenceProperties = {}; 2690 if (objectFlags & 4 /* Reference */) { 2691 const referenceType = type; 2692 referenceProperties = { 2693 instantiatedType: (_e = referenceType.target) == null ? void 0 : _e.id, 2694 typeArguments: (_f = referenceType.resolvedTypeArguments) == null ? void 0 : _f.map((t) => t.id), 2695 referenceLocation: getLocation(referenceType.node) 2696 }; 2697 } 2698 let conditionalProperties = {}; 2699 if (type.flags & 16777216 /* Conditional */) { 2700 const conditionalType = type; 2701 conditionalProperties = { 2702 conditionalCheckType: (_g = conditionalType.checkType) == null ? void 0 : _g.id, 2703 conditionalExtendsType: (_h = conditionalType.extendsType) == null ? void 0 : _h.id, 2704 conditionalTrueType: (_j = (_i = conditionalType.resolvedTrueType) == null ? void 0 : _i.id) != null ? _j : -1, 2705 conditionalFalseType: (_l = (_k = conditionalType.resolvedFalseType) == null ? void 0 : _k.id) != null ? _l : -1 2706 }; 2707 } 2708 let substitutionProperties = {}; 2709 if (type.flags & 33554432 /* Substitution */) { 2710 const substitutionType = type; 2711 substitutionProperties = { 2712 substitutionBaseType: (_m = substitutionType.baseType) == null ? void 0 : _m.id, 2713 constraintType: (_n = substitutionType.constraint) == null ? void 0 : _n.id 2714 }; 2715 } 2716 let reverseMappedProperties = {}; 2717 if (objectFlags & 1024 /* ReverseMapped */) { 2718 const reverseMappedType = type; 2719 reverseMappedProperties = { 2720 reverseMappedSourceType: (_o = reverseMappedType.source) == null ? void 0 : _o.id, 2721 reverseMappedMappedType: (_p = reverseMappedType.mappedType) == null ? void 0 : _p.id, 2722 reverseMappedConstraintType: (_q = reverseMappedType.constraintType) == null ? void 0 : _q.id 2723 }; 2724 } 2725 let evolvingArrayProperties = {}; 2726 if (objectFlags & 256 /* EvolvingArray */) { 2727 const evolvingArrayType = type; 2728 evolvingArrayProperties = { 2729 evolvingArrayElementType: evolvingArrayType.elementType.id, 2730 evolvingArrayFinalType: (_r = evolvingArrayType.finalArrayType) == null ? void 0 : _r.id 2731 }; 2732 } 2733 let recursionToken; 2734 const recursionIdentity = type.checker.getRecursionIdentity(type); 2735 if (recursionIdentity) { 2736 recursionToken = recursionIdentityMap.get(recursionIdentity); 2737 if (!recursionToken) { 2738 recursionToken = recursionIdentityMap.size; 2739 recursionIdentityMap.set(recursionIdentity, recursionToken); 2740 } 2741 } 2742 const descriptor = { 2743 id: type.id, 2744 intrinsicName: type.intrinsicName, 2745 symbolName: (symbol == null ? void 0 : symbol.escapedName) && unescapeLeadingUnderscores(symbol.escapedName), 2746 recursionId: recursionToken, 2747 isTuple: objectFlags & 8 /* Tuple */ ? true : void 0, 2748 unionTypes: type.flags & 1048576 /* Union */ ? (_s = type.types) == null ? void 0 : _s.map((t) => t.id) : void 0, 2749 intersectionTypes: type.flags & 2097152 /* Intersection */ ? type.types.map((t) => t.id) : void 0, 2750 aliasTypeArguments: (_t = type.aliasTypeArguments) == null ? void 0 : _t.map((t) => t.id), 2751 keyofType: type.flags & 4194304 /* Index */ ? (_u = type.type) == null ? void 0 : _u.id : void 0, 2752 ...indexedAccessProperties, 2753 ...referenceProperties, 2754 ...conditionalProperties, 2755 ...substitutionProperties, 2756 ...reverseMappedProperties, 2757 ...evolvingArrayProperties, 2758 destructuringPattern: getLocation(type.pattern), 2759 firstDeclaration: getLocation((_v = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _v[0]), 2760 flags: Debug.formatTypeFlags(type.flags).split("|"), 2761 display 2762 }; 2763 fs2.writeSync(typesFd, JSON.stringify(descriptor)); 2764 if (i < numTypes - 1) { 2765 fs2.writeSync(typesFd, ",\n"); 2766 } 2767 } 2768 fs2.writeSync(typesFd, "]\n"); 2769 fs2.closeSync(typesFd); 2770 mark("endDumpTypes"); 2771 measure("Dump types", "beginDumpTypes", "endDumpTypes"); 2772 } 2773 function dumpLegend() { 2774 if (!legendPath) { 2775 return; 2776 } 2777 fs2.writeFileSync(legendPath, JSON.stringify(legend)); 2778 } 2779 tracingEnabled2.dumpLegend = dumpLegend; 2780})(tracingEnabled || (tracingEnabled = {})); 2781var startTracing = tracingEnabled.startTracing; 2782var dumpTracingLegend = tracingEnabled.dumpLegend; 2783 2784// src/compiler/types.ts 2785var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => { 2786 SyntaxKind4[SyntaxKind4["Unknown"] = 0] = "Unknown"; 2787 SyntaxKind4[SyntaxKind4["EndOfFileToken"] = 1] = "EndOfFileToken"; 2788 SyntaxKind4[SyntaxKind4["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia"; 2789 SyntaxKind4[SyntaxKind4["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; 2790 SyntaxKind4[SyntaxKind4["NewLineTrivia"] = 4] = "NewLineTrivia"; 2791 SyntaxKind4[SyntaxKind4["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; 2792 SyntaxKind4[SyntaxKind4["ShebangTrivia"] = 6] = "ShebangTrivia"; 2793 SyntaxKind4[SyntaxKind4["ConflictMarkerTrivia"] = 7] = "ConflictMarkerTrivia"; 2794 SyntaxKind4[SyntaxKind4["NumericLiteral"] = 8] = "NumericLiteral"; 2795 SyntaxKind4[SyntaxKind4["BigIntLiteral"] = 9] = "BigIntLiteral"; 2796 SyntaxKind4[SyntaxKind4["StringLiteral"] = 10] = "StringLiteral"; 2797 SyntaxKind4[SyntaxKind4["JsxText"] = 11] = "JsxText"; 2798 SyntaxKind4[SyntaxKind4["JsxTextAllWhiteSpaces"] = 12] = "JsxTextAllWhiteSpaces"; 2799 SyntaxKind4[SyntaxKind4["RegularExpressionLiteral"] = 13] = "RegularExpressionLiteral"; 2800 SyntaxKind4[SyntaxKind4["NoSubstitutionTemplateLiteral"] = 14] = "NoSubstitutionTemplateLiteral"; 2801 SyntaxKind4[SyntaxKind4["TemplateHead"] = 15] = "TemplateHead"; 2802 SyntaxKind4[SyntaxKind4["TemplateMiddle"] = 16] = "TemplateMiddle"; 2803 SyntaxKind4[SyntaxKind4["TemplateTail"] = 17] = "TemplateTail"; 2804 SyntaxKind4[SyntaxKind4["OpenBraceToken"] = 18] = "OpenBraceToken"; 2805 SyntaxKind4[SyntaxKind4["CloseBraceToken"] = 19] = "CloseBraceToken"; 2806 SyntaxKind4[SyntaxKind4["OpenParenToken"] = 20] = "OpenParenToken"; 2807 SyntaxKind4[SyntaxKind4["CloseParenToken"] = 21] = "CloseParenToken"; 2808 SyntaxKind4[SyntaxKind4["OpenBracketToken"] = 22] = "OpenBracketToken"; 2809 SyntaxKind4[SyntaxKind4["CloseBracketToken"] = 23] = "CloseBracketToken"; 2810 SyntaxKind4[SyntaxKind4["DotToken"] = 24] = "DotToken"; 2811 SyntaxKind4[SyntaxKind4["DotDotDotToken"] = 25] = "DotDotDotToken"; 2812 SyntaxKind4[SyntaxKind4["SemicolonToken"] = 26] = "SemicolonToken"; 2813 SyntaxKind4[SyntaxKind4["CommaToken"] = 27] = "CommaToken"; 2814 SyntaxKind4[SyntaxKind4["QuestionDotToken"] = 28] = "QuestionDotToken"; 2815 SyntaxKind4[SyntaxKind4["LessThanToken"] = 29] = "LessThanToken"; 2816 SyntaxKind4[SyntaxKind4["LessThanSlashToken"] = 30] = "LessThanSlashToken"; 2817 SyntaxKind4[SyntaxKind4["GreaterThanToken"] = 31] = "GreaterThanToken"; 2818 SyntaxKind4[SyntaxKind4["LessThanEqualsToken"] = 32] = "LessThanEqualsToken"; 2819 SyntaxKind4[SyntaxKind4["GreaterThanEqualsToken"] = 33] = "GreaterThanEqualsToken"; 2820 SyntaxKind4[SyntaxKind4["EqualsEqualsToken"] = 34] = "EqualsEqualsToken"; 2821 SyntaxKind4[SyntaxKind4["ExclamationEqualsToken"] = 35] = "ExclamationEqualsToken"; 2822 SyntaxKind4[SyntaxKind4["EqualsEqualsEqualsToken"] = 36] = "EqualsEqualsEqualsToken"; 2823 SyntaxKind4[SyntaxKind4["ExclamationEqualsEqualsToken"] = 37] = "ExclamationEqualsEqualsToken"; 2824 SyntaxKind4[SyntaxKind4["EqualsGreaterThanToken"] = 38] = "EqualsGreaterThanToken"; 2825 SyntaxKind4[SyntaxKind4["PlusToken"] = 39] = "PlusToken"; 2826 SyntaxKind4[SyntaxKind4["MinusToken"] = 40] = "MinusToken"; 2827 SyntaxKind4[SyntaxKind4["AsteriskToken"] = 41] = "AsteriskToken"; 2828 SyntaxKind4[SyntaxKind4["AsteriskAsteriskToken"] = 42] = "AsteriskAsteriskToken"; 2829 SyntaxKind4[SyntaxKind4["SlashToken"] = 43] = "SlashToken"; 2830 SyntaxKind4[SyntaxKind4["PercentToken"] = 44] = "PercentToken"; 2831 SyntaxKind4[SyntaxKind4["PlusPlusToken"] = 45] = "PlusPlusToken"; 2832 SyntaxKind4[SyntaxKind4["MinusMinusToken"] = 46] = "MinusMinusToken"; 2833 SyntaxKind4[SyntaxKind4["LessThanLessThanToken"] = 47] = "LessThanLessThanToken"; 2834 SyntaxKind4[SyntaxKind4["GreaterThanGreaterThanToken"] = 48] = "GreaterThanGreaterThanToken"; 2835 SyntaxKind4[SyntaxKind4["GreaterThanGreaterThanGreaterThanToken"] = 49] = "GreaterThanGreaterThanGreaterThanToken"; 2836 SyntaxKind4[SyntaxKind4["AmpersandToken"] = 50] = "AmpersandToken"; 2837 SyntaxKind4[SyntaxKind4["BarToken"] = 51] = "BarToken"; 2838 SyntaxKind4[SyntaxKind4["CaretToken"] = 52] = "CaretToken"; 2839 SyntaxKind4[SyntaxKind4["ExclamationToken"] = 53] = "ExclamationToken"; 2840 SyntaxKind4[SyntaxKind4["TildeToken"] = 54] = "TildeToken"; 2841 SyntaxKind4[SyntaxKind4["AmpersandAmpersandToken"] = 55] = "AmpersandAmpersandToken"; 2842 SyntaxKind4[SyntaxKind4["BarBarToken"] = 56] = "BarBarToken"; 2843 SyntaxKind4[SyntaxKind4["QuestionToken"] = 57] = "QuestionToken"; 2844 SyntaxKind4[SyntaxKind4["ColonToken"] = 58] = "ColonToken"; 2845 SyntaxKind4[SyntaxKind4["AtToken"] = 59] = "AtToken"; 2846 SyntaxKind4[SyntaxKind4["QuestionQuestionToken"] = 60] = "QuestionQuestionToken"; 2847 SyntaxKind4[SyntaxKind4["BacktickToken"] = 61] = "BacktickToken"; 2848 SyntaxKind4[SyntaxKind4["HashToken"] = 62] = "HashToken"; 2849 SyntaxKind4[SyntaxKind4["EqualsToken"] = 63] = "EqualsToken"; 2850 SyntaxKind4[SyntaxKind4["PlusEqualsToken"] = 64] = "PlusEqualsToken"; 2851 SyntaxKind4[SyntaxKind4["MinusEqualsToken"] = 65] = "MinusEqualsToken"; 2852 SyntaxKind4[SyntaxKind4["AsteriskEqualsToken"] = 66] = "AsteriskEqualsToken"; 2853 SyntaxKind4[SyntaxKind4["AsteriskAsteriskEqualsToken"] = 67] = "AsteriskAsteriskEqualsToken"; 2854 SyntaxKind4[SyntaxKind4["SlashEqualsToken"] = 68] = "SlashEqualsToken"; 2855 SyntaxKind4[SyntaxKind4["PercentEqualsToken"] = 69] = "PercentEqualsToken"; 2856 SyntaxKind4[SyntaxKind4["LessThanLessThanEqualsToken"] = 70] = "LessThanLessThanEqualsToken"; 2857 SyntaxKind4[SyntaxKind4["GreaterThanGreaterThanEqualsToken"] = 71] = "GreaterThanGreaterThanEqualsToken"; 2858 SyntaxKind4[SyntaxKind4["GreaterThanGreaterThanGreaterThanEqualsToken"] = 72] = "GreaterThanGreaterThanGreaterThanEqualsToken"; 2859 SyntaxKind4[SyntaxKind4["AmpersandEqualsToken"] = 73] = "AmpersandEqualsToken"; 2860 SyntaxKind4[SyntaxKind4["BarEqualsToken"] = 74] = "BarEqualsToken"; 2861 SyntaxKind4[SyntaxKind4["BarBarEqualsToken"] = 75] = "BarBarEqualsToken"; 2862 SyntaxKind4[SyntaxKind4["AmpersandAmpersandEqualsToken"] = 76] = "AmpersandAmpersandEqualsToken"; 2863 SyntaxKind4[SyntaxKind4["QuestionQuestionEqualsToken"] = 77] = "QuestionQuestionEqualsToken"; 2864 SyntaxKind4[SyntaxKind4["CaretEqualsToken"] = 78] = "CaretEqualsToken"; 2865 SyntaxKind4[SyntaxKind4["Identifier"] = 79] = "Identifier"; 2866 SyntaxKind4[SyntaxKind4["PrivateIdentifier"] = 80] = "PrivateIdentifier"; 2867 SyntaxKind4[SyntaxKind4["BreakKeyword"] = 81] = "BreakKeyword"; 2868 SyntaxKind4[SyntaxKind4["CaseKeyword"] = 82] = "CaseKeyword"; 2869 SyntaxKind4[SyntaxKind4["CatchKeyword"] = 83] = "CatchKeyword"; 2870 SyntaxKind4[SyntaxKind4["ClassKeyword"] = 84] = "ClassKeyword"; 2871 SyntaxKind4[SyntaxKind4["StructKeyword"] = 85] = "StructKeyword"; 2872 SyntaxKind4[SyntaxKind4["ConstKeyword"] = 86] = "ConstKeyword"; 2873 SyntaxKind4[SyntaxKind4["ContinueKeyword"] = 87] = "ContinueKeyword"; 2874 SyntaxKind4[SyntaxKind4["DebuggerKeyword"] = 88] = "DebuggerKeyword"; 2875 SyntaxKind4[SyntaxKind4["DefaultKeyword"] = 89] = "DefaultKeyword"; 2876 SyntaxKind4[SyntaxKind4["DeleteKeyword"] = 90] = "DeleteKeyword"; 2877 SyntaxKind4[SyntaxKind4["DoKeyword"] = 91] = "DoKeyword"; 2878 SyntaxKind4[SyntaxKind4["ElseKeyword"] = 92] = "ElseKeyword"; 2879 SyntaxKind4[SyntaxKind4["EnumKeyword"] = 93] = "EnumKeyword"; 2880 SyntaxKind4[SyntaxKind4["ExportKeyword"] = 94] = "ExportKeyword"; 2881 SyntaxKind4[SyntaxKind4["ExtendsKeyword"] = 95] = "ExtendsKeyword"; 2882 SyntaxKind4[SyntaxKind4["FalseKeyword"] = 96] = "FalseKeyword"; 2883 SyntaxKind4[SyntaxKind4["FinallyKeyword"] = 97] = "FinallyKeyword"; 2884 SyntaxKind4[SyntaxKind4["ForKeyword"] = 98] = "ForKeyword"; 2885 SyntaxKind4[SyntaxKind4["FunctionKeyword"] = 99] = "FunctionKeyword"; 2886 SyntaxKind4[SyntaxKind4["IfKeyword"] = 100] = "IfKeyword"; 2887 SyntaxKind4[SyntaxKind4["ImportKeyword"] = 101] = "ImportKeyword"; 2888 SyntaxKind4[SyntaxKind4["InKeyword"] = 102] = "InKeyword"; 2889 SyntaxKind4[SyntaxKind4["InstanceOfKeyword"] = 103] = "InstanceOfKeyword"; 2890 SyntaxKind4[SyntaxKind4["NewKeyword"] = 104] = "NewKeyword"; 2891 SyntaxKind4[SyntaxKind4["NullKeyword"] = 105] = "NullKeyword"; 2892 SyntaxKind4[SyntaxKind4["ReturnKeyword"] = 106] = "ReturnKeyword"; 2893 SyntaxKind4[SyntaxKind4["SuperKeyword"] = 107] = "SuperKeyword"; 2894 SyntaxKind4[SyntaxKind4["SwitchKeyword"] = 108] = "SwitchKeyword"; 2895 SyntaxKind4[SyntaxKind4["ThisKeyword"] = 109] = "ThisKeyword"; 2896 SyntaxKind4[SyntaxKind4["ThrowKeyword"] = 110] = "ThrowKeyword"; 2897 SyntaxKind4[SyntaxKind4["TrueKeyword"] = 111] = "TrueKeyword"; 2898 SyntaxKind4[SyntaxKind4["TryKeyword"] = 112] = "TryKeyword"; 2899 SyntaxKind4[SyntaxKind4["TypeOfKeyword"] = 113] = "TypeOfKeyword"; 2900 SyntaxKind4[SyntaxKind4["VarKeyword"] = 114] = "VarKeyword"; 2901 SyntaxKind4[SyntaxKind4["VoidKeyword"] = 115] = "VoidKeyword"; 2902 SyntaxKind4[SyntaxKind4["WhileKeyword"] = 116] = "WhileKeyword"; 2903 SyntaxKind4[SyntaxKind4["WithKeyword"] = 117] = "WithKeyword"; 2904 SyntaxKind4[SyntaxKind4["ImplementsKeyword"] = 118] = "ImplementsKeyword"; 2905 SyntaxKind4[SyntaxKind4["InterfaceKeyword"] = 119] = "InterfaceKeyword"; 2906 SyntaxKind4[SyntaxKind4["LetKeyword"] = 120] = "LetKeyword"; 2907 SyntaxKind4[SyntaxKind4["PackageKeyword"] = 121] = "PackageKeyword"; 2908 SyntaxKind4[SyntaxKind4["PrivateKeyword"] = 122] = "PrivateKeyword"; 2909 SyntaxKind4[SyntaxKind4["ProtectedKeyword"] = 123] = "ProtectedKeyword"; 2910 SyntaxKind4[SyntaxKind4["PublicKeyword"] = 124] = "PublicKeyword"; 2911 SyntaxKind4[SyntaxKind4["StaticKeyword"] = 125] = "StaticKeyword"; 2912 SyntaxKind4[SyntaxKind4["YieldKeyword"] = 126] = "YieldKeyword"; 2913 SyntaxKind4[SyntaxKind4["AbstractKeyword"] = 127] = "AbstractKeyword"; 2914 SyntaxKind4[SyntaxKind4["AccessorKeyword"] = 128] = "AccessorKeyword"; 2915 SyntaxKind4[SyntaxKind4["AsKeyword"] = 129] = "AsKeyword"; 2916 SyntaxKind4[SyntaxKind4["AssertsKeyword"] = 130] = "AssertsKeyword"; 2917 SyntaxKind4[SyntaxKind4["AssertKeyword"] = 131] = "AssertKeyword"; 2918 SyntaxKind4[SyntaxKind4["AnyKeyword"] = 132] = "AnyKeyword"; 2919 SyntaxKind4[SyntaxKind4["AsyncKeyword"] = 133] = "AsyncKeyword"; 2920 SyntaxKind4[SyntaxKind4["AwaitKeyword"] = 134] = "AwaitKeyword"; 2921 SyntaxKind4[SyntaxKind4["BooleanKeyword"] = 135] = "BooleanKeyword"; 2922 SyntaxKind4[SyntaxKind4["ConstructorKeyword"] = 136] = "ConstructorKeyword"; 2923 SyntaxKind4[SyntaxKind4["DeclareKeyword"] = 137] = "DeclareKeyword"; 2924 SyntaxKind4[SyntaxKind4["GetKeyword"] = 138] = "GetKeyword"; 2925 SyntaxKind4[SyntaxKind4["InferKeyword"] = 139] = "InferKeyword"; 2926 SyntaxKind4[SyntaxKind4["IntrinsicKeyword"] = 140] = "IntrinsicKeyword"; 2927 SyntaxKind4[SyntaxKind4["IsKeyword"] = 141] = "IsKeyword"; 2928 SyntaxKind4[SyntaxKind4["KeyOfKeyword"] = 142] = "KeyOfKeyword"; 2929 SyntaxKind4[SyntaxKind4["ModuleKeyword"] = 143] = "ModuleKeyword"; 2930 SyntaxKind4[SyntaxKind4["NamespaceKeyword"] = 144] = "NamespaceKeyword"; 2931 SyntaxKind4[SyntaxKind4["NeverKeyword"] = 145] = "NeverKeyword"; 2932 SyntaxKind4[SyntaxKind4["OutKeyword"] = 146] = "OutKeyword"; 2933 SyntaxKind4[SyntaxKind4["ReadonlyKeyword"] = 147] = "ReadonlyKeyword"; 2934 SyntaxKind4[SyntaxKind4["RequireKeyword"] = 148] = "RequireKeyword"; 2935 SyntaxKind4[SyntaxKind4["NumberKeyword"] = 149] = "NumberKeyword"; 2936 SyntaxKind4[SyntaxKind4["ObjectKeyword"] = 150] = "ObjectKeyword"; 2937 SyntaxKind4[SyntaxKind4["SatisfiesKeyword"] = 151] = "SatisfiesKeyword"; 2938 SyntaxKind4[SyntaxKind4["SetKeyword"] = 152] = "SetKeyword"; 2939 SyntaxKind4[SyntaxKind4["StringKeyword"] = 153] = "StringKeyword"; 2940 SyntaxKind4[SyntaxKind4["SymbolKeyword"] = 154] = "SymbolKeyword"; 2941 SyntaxKind4[SyntaxKind4["TypeKeyword"] = 155] = "TypeKeyword"; 2942 SyntaxKind4[SyntaxKind4["LazyKeyword"] = 156] = "LazyKeyword"; 2943 SyntaxKind4[SyntaxKind4["UndefinedKeyword"] = 157] = "UndefinedKeyword"; 2944 SyntaxKind4[SyntaxKind4["UniqueKeyword"] = 158] = "UniqueKeyword"; 2945 SyntaxKind4[SyntaxKind4["UnknownKeyword"] = 159] = "UnknownKeyword"; 2946 SyntaxKind4[SyntaxKind4["FromKeyword"] = 160] = "FromKeyword"; 2947 SyntaxKind4[SyntaxKind4["GlobalKeyword"] = 161] = "GlobalKeyword"; 2948 SyntaxKind4[SyntaxKind4["BigIntKeyword"] = 162] = "BigIntKeyword"; 2949 SyntaxKind4[SyntaxKind4["OverrideKeyword"] = 163] = "OverrideKeyword"; 2950 SyntaxKind4[SyntaxKind4["OfKeyword"] = 164] = "OfKeyword"; 2951 SyntaxKind4[SyntaxKind4["QualifiedName"] = 165] = "QualifiedName"; 2952 SyntaxKind4[SyntaxKind4["ComputedPropertyName"] = 166] = "ComputedPropertyName"; 2953 SyntaxKind4[SyntaxKind4["TypeParameter"] = 167] = "TypeParameter"; 2954 SyntaxKind4[SyntaxKind4["Parameter"] = 168] = "Parameter"; 2955 SyntaxKind4[SyntaxKind4["Decorator"] = 169] = "Decorator"; 2956 SyntaxKind4[SyntaxKind4["PropertySignature"] = 170] = "PropertySignature"; 2957 SyntaxKind4[SyntaxKind4["PropertyDeclaration"] = 171] = "PropertyDeclaration"; 2958 SyntaxKind4[SyntaxKind4["AnnotationPropertyDeclaration"] = 172] = "AnnotationPropertyDeclaration"; 2959 SyntaxKind4[SyntaxKind4["MethodSignature"] = 173] = "MethodSignature"; 2960 SyntaxKind4[SyntaxKind4["MethodDeclaration"] = 174] = "MethodDeclaration"; 2961 SyntaxKind4[SyntaxKind4["ClassStaticBlockDeclaration"] = 175] = "ClassStaticBlockDeclaration"; 2962 SyntaxKind4[SyntaxKind4["Constructor"] = 176] = "Constructor"; 2963 SyntaxKind4[SyntaxKind4["GetAccessor"] = 177] = "GetAccessor"; 2964 SyntaxKind4[SyntaxKind4["SetAccessor"] = 178] = "SetAccessor"; 2965 SyntaxKind4[SyntaxKind4["CallSignature"] = 179] = "CallSignature"; 2966 SyntaxKind4[SyntaxKind4["ConstructSignature"] = 180] = "ConstructSignature"; 2967 SyntaxKind4[SyntaxKind4["IndexSignature"] = 181] = "IndexSignature"; 2968 SyntaxKind4[SyntaxKind4["TypePredicate"] = 182] = "TypePredicate"; 2969 SyntaxKind4[SyntaxKind4["TypeReference"] = 183] = "TypeReference"; 2970 SyntaxKind4[SyntaxKind4["FunctionType"] = 184] = "FunctionType"; 2971 SyntaxKind4[SyntaxKind4["ConstructorType"] = 185] = "ConstructorType"; 2972 SyntaxKind4[SyntaxKind4["TypeQuery"] = 186] = "TypeQuery"; 2973 SyntaxKind4[SyntaxKind4["TypeLiteral"] = 187] = "TypeLiteral"; 2974 SyntaxKind4[SyntaxKind4["ArrayType"] = 188] = "ArrayType"; 2975 SyntaxKind4[SyntaxKind4["TupleType"] = 189] = "TupleType"; 2976 SyntaxKind4[SyntaxKind4["OptionalType"] = 190] = "OptionalType"; 2977 SyntaxKind4[SyntaxKind4["RestType"] = 191] = "RestType"; 2978 SyntaxKind4[SyntaxKind4["UnionType"] = 192] = "UnionType"; 2979 SyntaxKind4[SyntaxKind4["IntersectionType"] = 193] = "IntersectionType"; 2980 SyntaxKind4[SyntaxKind4["ConditionalType"] = 194] = "ConditionalType"; 2981 SyntaxKind4[SyntaxKind4["InferType"] = 195] = "InferType"; 2982 SyntaxKind4[SyntaxKind4["ParenthesizedType"] = 196] = "ParenthesizedType"; 2983 SyntaxKind4[SyntaxKind4["ThisType"] = 197] = "ThisType"; 2984 SyntaxKind4[SyntaxKind4["TypeOperator"] = 198] = "TypeOperator"; 2985 SyntaxKind4[SyntaxKind4["IndexedAccessType"] = 199] = "IndexedAccessType"; 2986 SyntaxKind4[SyntaxKind4["MappedType"] = 200] = "MappedType"; 2987 SyntaxKind4[SyntaxKind4["LiteralType"] = 201] = "LiteralType"; 2988 SyntaxKind4[SyntaxKind4["NamedTupleMember"] = 202] = "NamedTupleMember"; 2989 SyntaxKind4[SyntaxKind4["TemplateLiteralType"] = 203] = "TemplateLiteralType"; 2990 SyntaxKind4[SyntaxKind4["TemplateLiteralTypeSpan"] = 204] = "TemplateLiteralTypeSpan"; 2991 SyntaxKind4[SyntaxKind4["ImportType"] = 205] = "ImportType"; 2992 SyntaxKind4[SyntaxKind4["ObjectBindingPattern"] = 206] = "ObjectBindingPattern"; 2993 SyntaxKind4[SyntaxKind4["ArrayBindingPattern"] = 207] = "ArrayBindingPattern"; 2994 SyntaxKind4[SyntaxKind4["BindingElement"] = 208] = "BindingElement"; 2995 SyntaxKind4[SyntaxKind4["ArrayLiteralExpression"] = 209] = "ArrayLiteralExpression"; 2996 SyntaxKind4[SyntaxKind4["ObjectLiteralExpression"] = 210] = "ObjectLiteralExpression"; 2997 SyntaxKind4[SyntaxKind4["PropertyAccessExpression"] = 211] = "PropertyAccessExpression"; 2998 SyntaxKind4[SyntaxKind4["ElementAccessExpression"] = 212] = "ElementAccessExpression"; 2999 SyntaxKind4[SyntaxKind4["CallExpression"] = 213] = "CallExpression"; 3000 SyntaxKind4[SyntaxKind4["NewExpression"] = 214] = "NewExpression"; 3001 SyntaxKind4[SyntaxKind4["TaggedTemplateExpression"] = 215] = "TaggedTemplateExpression"; 3002 SyntaxKind4[SyntaxKind4["TypeAssertionExpression"] = 216] = "TypeAssertionExpression"; 3003 SyntaxKind4[SyntaxKind4["ParenthesizedExpression"] = 217] = "ParenthesizedExpression"; 3004 SyntaxKind4[SyntaxKind4["FunctionExpression"] = 218] = "FunctionExpression"; 3005 SyntaxKind4[SyntaxKind4["ArrowFunction"] = 219] = "ArrowFunction"; 3006 SyntaxKind4[SyntaxKind4["EtsComponentExpression"] = 220] = "EtsComponentExpression"; 3007 SyntaxKind4[SyntaxKind4["DeleteExpression"] = 221] = "DeleteExpression"; 3008 SyntaxKind4[SyntaxKind4["TypeOfExpression"] = 222] = "TypeOfExpression"; 3009 SyntaxKind4[SyntaxKind4["VoidExpression"] = 223] = "VoidExpression"; 3010 SyntaxKind4[SyntaxKind4["AwaitExpression"] = 224] = "AwaitExpression"; 3011 SyntaxKind4[SyntaxKind4["PrefixUnaryExpression"] = 225] = "PrefixUnaryExpression"; 3012 SyntaxKind4[SyntaxKind4["PostfixUnaryExpression"] = 226] = "PostfixUnaryExpression"; 3013 SyntaxKind4[SyntaxKind4["BinaryExpression"] = 227] = "BinaryExpression"; 3014 SyntaxKind4[SyntaxKind4["ConditionalExpression"] = 228] = "ConditionalExpression"; 3015 SyntaxKind4[SyntaxKind4["TemplateExpression"] = 229] = "TemplateExpression"; 3016 SyntaxKind4[SyntaxKind4["YieldExpression"] = 230] = "YieldExpression"; 3017 SyntaxKind4[SyntaxKind4["SpreadElement"] = 231] = "SpreadElement"; 3018 SyntaxKind4[SyntaxKind4["ClassExpression"] = 232] = "ClassExpression"; 3019 SyntaxKind4[SyntaxKind4["OmittedExpression"] = 233] = "OmittedExpression"; 3020 SyntaxKind4[SyntaxKind4["ExpressionWithTypeArguments"] = 234] = "ExpressionWithTypeArguments"; 3021 SyntaxKind4[SyntaxKind4["AsExpression"] = 235] = "AsExpression"; 3022 SyntaxKind4[SyntaxKind4["NonNullExpression"] = 236] = "NonNullExpression"; 3023 SyntaxKind4[SyntaxKind4["MetaProperty"] = 237] = "MetaProperty"; 3024 SyntaxKind4[SyntaxKind4["SyntheticExpression"] = 238] = "SyntheticExpression"; 3025 SyntaxKind4[SyntaxKind4["SatisfiesExpression"] = 239] = "SatisfiesExpression"; 3026 SyntaxKind4[SyntaxKind4["TemplateSpan"] = 240] = "TemplateSpan"; 3027 SyntaxKind4[SyntaxKind4["SemicolonClassElement"] = 241] = "SemicolonClassElement"; 3028 SyntaxKind4[SyntaxKind4["Block"] = 242] = "Block"; 3029 SyntaxKind4[SyntaxKind4["EmptyStatement"] = 243] = "EmptyStatement"; 3030 SyntaxKind4[SyntaxKind4["VariableStatement"] = 244] = "VariableStatement"; 3031 SyntaxKind4[SyntaxKind4["ExpressionStatement"] = 245] = "ExpressionStatement"; 3032 SyntaxKind4[SyntaxKind4["IfStatement"] = 246] = "IfStatement"; 3033 SyntaxKind4[SyntaxKind4["DoStatement"] = 247] = "DoStatement"; 3034 SyntaxKind4[SyntaxKind4["WhileStatement"] = 248] = "WhileStatement"; 3035 SyntaxKind4[SyntaxKind4["ForStatement"] = 249] = "ForStatement"; 3036 SyntaxKind4[SyntaxKind4["ForInStatement"] = 250] = "ForInStatement"; 3037 SyntaxKind4[SyntaxKind4["ForOfStatement"] = 251] = "ForOfStatement"; 3038 SyntaxKind4[SyntaxKind4["ContinueStatement"] = 252] = "ContinueStatement"; 3039 SyntaxKind4[SyntaxKind4["BreakStatement"] = 253] = "BreakStatement"; 3040 SyntaxKind4[SyntaxKind4["ReturnStatement"] = 254] = "ReturnStatement"; 3041 SyntaxKind4[SyntaxKind4["WithStatement"] = 255] = "WithStatement"; 3042 SyntaxKind4[SyntaxKind4["SwitchStatement"] = 256] = "SwitchStatement"; 3043 SyntaxKind4[SyntaxKind4["LabeledStatement"] = 257] = "LabeledStatement"; 3044 SyntaxKind4[SyntaxKind4["ThrowStatement"] = 258] = "ThrowStatement"; 3045 SyntaxKind4[SyntaxKind4["TryStatement"] = 259] = "TryStatement"; 3046 SyntaxKind4[SyntaxKind4["DebuggerStatement"] = 260] = "DebuggerStatement"; 3047 SyntaxKind4[SyntaxKind4["VariableDeclaration"] = 261] = "VariableDeclaration"; 3048 SyntaxKind4[SyntaxKind4["VariableDeclarationList"] = 262] = "VariableDeclarationList"; 3049 SyntaxKind4[SyntaxKind4["FunctionDeclaration"] = 263] = "FunctionDeclaration"; 3050 SyntaxKind4[SyntaxKind4["ClassDeclaration"] = 264] = "ClassDeclaration"; 3051 SyntaxKind4[SyntaxKind4["StructDeclaration"] = 265] = "StructDeclaration"; 3052 SyntaxKind4[SyntaxKind4["AnnotationDeclaration"] = 266] = "AnnotationDeclaration"; 3053 SyntaxKind4[SyntaxKind4["InterfaceDeclaration"] = 267] = "InterfaceDeclaration"; 3054 SyntaxKind4[SyntaxKind4["TypeAliasDeclaration"] = 268] = "TypeAliasDeclaration"; 3055 SyntaxKind4[SyntaxKind4["EnumDeclaration"] = 269] = "EnumDeclaration"; 3056 SyntaxKind4[SyntaxKind4["ModuleDeclaration"] = 270] = "ModuleDeclaration"; 3057 SyntaxKind4[SyntaxKind4["ModuleBlock"] = 271] = "ModuleBlock"; 3058 SyntaxKind4[SyntaxKind4["CaseBlock"] = 272] = "CaseBlock"; 3059 SyntaxKind4[SyntaxKind4["NamespaceExportDeclaration"] = 273] = "NamespaceExportDeclaration"; 3060 SyntaxKind4[SyntaxKind4["ImportEqualsDeclaration"] = 274] = "ImportEqualsDeclaration"; 3061 SyntaxKind4[SyntaxKind4["ImportDeclaration"] = 275] = "ImportDeclaration"; 3062 SyntaxKind4[SyntaxKind4["ImportClause"] = 276] = "ImportClause"; 3063 SyntaxKind4[SyntaxKind4["NamespaceImport"] = 277] = "NamespaceImport"; 3064 SyntaxKind4[SyntaxKind4["NamedImports"] = 278] = "NamedImports"; 3065 SyntaxKind4[SyntaxKind4["ImportSpecifier"] = 279] = "ImportSpecifier"; 3066 SyntaxKind4[SyntaxKind4["ExportAssignment"] = 280] = "ExportAssignment"; 3067 SyntaxKind4[SyntaxKind4["ExportDeclaration"] = 281] = "ExportDeclaration"; 3068 SyntaxKind4[SyntaxKind4["NamedExports"] = 282] = "NamedExports"; 3069 SyntaxKind4[SyntaxKind4["NamespaceExport"] = 283] = "NamespaceExport"; 3070 SyntaxKind4[SyntaxKind4["ExportSpecifier"] = 284] = "ExportSpecifier"; 3071 SyntaxKind4[SyntaxKind4["MissingDeclaration"] = 285] = "MissingDeclaration"; 3072 SyntaxKind4[SyntaxKind4["ExternalModuleReference"] = 286] = "ExternalModuleReference"; 3073 SyntaxKind4[SyntaxKind4["JsxElement"] = 287] = "JsxElement"; 3074 SyntaxKind4[SyntaxKind4["JsxSelfClosingElement"] = 288] = "JsxSelfClosingElement"; 3075 SyntaxKind4[SyntaxKind4["JsxOpeningElement"] = 289] = "JsxOpeningElement"; 3076 SyntaxKind4[SyntaxKind4["JsxClosingElement"] = 290] = "JsxClosingElement"; 3077 SyntaxKind4[SyntaxKind4["JsxFragment"] = 291] = "JsxFragment"; 3078 SyntaxKind4[SyntaxKind4["JsxOpeningFragment"] = 292] = "JsxOpeningFragment"; 3079 SyntaxKind4[SyntaxKind4["JsxClosingFragment"] = 293] = "JsxClosingFragment"; 3080 SyntaxKind4[SyntaxKind4["JsxAttribute"] = 294] = "JsxAttribute"; 3081 SyntaxKind4[SyntaxKind4["JsxAttributes"] = 295] = "JsxAttributes"; 3082 SyntaxKind4[SyntaxKind4["JsxSpreadAttribute"] = 296] = "JsxSpreadAttribute"; 3083 SyntaxKind4[SyntaxKind4["JsxExpression"] = 297] = "JsxExpression"; 3084 SyntaxKind4[SyntaxKind4["CaseClause"] = 298] = "CaseClause"; 3085 SyntaxKind4[SyntaxKind4["DefaultClause"] = 299] = "DefaultClause"; 3086 SyntaxKind4[SyntaxKind4["HeritageClause"] = 300] = "HeritageClause"; 3087 SyntaxKind4[SyntaxKind4["CatchClause"] = 301] = "CatchClause"; 3088 SyntaxKind4[SyntaxKind4["AssertClause"] = 302] = "AssertClause"; 3089 SyntaxKind4[SyntaxKind4["AssertEntry"] = 303] = "AssertEntry"; 3090 SyntaxKind4[SyntaxKind4["ImportTypeAssertionContainer"] = 304] = "ImportTypeAssertionContainer"; 3091 SyntaxKind4[SyntaxKind4["PropertyAssignment"] = 305] = "PropertyAssignment"; 3092 SyntaxKind4[SyntaxKind4["ShorthandPropertyAssignment"] = 306] = "ShorthandPropertyAssignment"; 3093 SyntaxKind4[SyntaxKind4["SpreadAssignment"] = 307] = "SpreadAssignment"; 3094 SyntaxKind4[SyntaxKind4["EnumMember"] = 308] = "EnumMember"; 3095 SyntaxKind4[SyntaxKind4["UnparsedPrologue"] = 309] = "UnparsedPrologue"; 3096 SyntaxKind4[SyntaxKind4["UnparsedPrepend"] = 310] = "UnparsedPrepend"; 3097 SyntaxKind4[SyntaxKind4["UnparsedText"] = 311] = "UnparsedText"; 3098 SyntaxKind4[SyntaxKind4["UnparsedInternalText"] = 312] = "UnparsedInternalText"; 3099 SyntaxKind4[SyntaxKind4["UnparsedSyntheticReference"] = 313] = "UnparsedSyntheticReference"; 3100 SyntaxKind4[SyntaxKind4["SourceFile"] = 314] = "SourceFile"; 3101 SyntaxKind4[SyntaxKind4["Bundle"] = 315] = "Bundle"; 3102 SyntaxKind4[SyntaxKind4["UnparsedSource"] = 316] = "UnparsedSource"; 3103 SyntaxKind4[SyntaxKind4["InputFiles"] = 317] = "InputFiles"; 3104 SyntaxKind4[SyntaxKind4["JSDocTypeExpression"] = 318] = "JSDocTypeExpression"; 3105 SyntaxKind4[SyntaxKind4["JSDocNameReference"] = 319] = "JSDocNameReference"; 3106 SyntaxKind4[SyntaxKind4["JSDocMemberName"] = 320] = "JSDocMemberName"; 3107 SyntaxKind4[SyntaxKind4["JSDocAllType"] = 321] = "JSDocAllType"; 3108 SyntaxKind4[SyntaxKind4["JSDocUnknownType"] = 322] = "JSDocUnknownType"; 3109 SyntaxKind4[SyntaxKind4["JSDocNullableType"] = 323] = "JSDocNullableType"; 3110 SyntaxKind4[SyntaxKind4["JSDocNonNullableType"] = 324] = "JSDocNonNullableType"; 3111 SyntaxKind4[SyntaxKind4["JSDocOptionalType"] = 325] = "JSDocOptionalType"; 3112 SyntaxKind4[SyntaxKind4["JSDocFunctionType"] = 326] = "JSDocFunctionType"; 3113 SyntaxKind4[SyntaxKind4["JSDocVariadicType"] = 327] = "JSDocVariadicType"; 3114 SyntaxKind4[SyntaxKind4["JSDocNamepathType"] = 328] = "JSDocNamepathType"; 3115 SyntaxKind4[SyntaxKind4["JSDoc"] = 329] = "JSDoc"; 3116 SyntaxKind4[SyntaxKind4["JSDocComment"] = 329 /* JSDoc */] = "JSDocComment"; 3117 SyntaxKind4[SyntaxKind4["JSDocText"] = 330] = "JSDocText"; 3118 SyntaxKind4[SyntaxKind4["JSDocTypeLiteral"] = 331] = "JSDocTypeLiteral"; 3119 SyntaxKind4[SyntaxKind4["JSDocSignature"] = 332] = "JSDocSignature"; 3120 SyntaxKind4[SyntaxKind4["JSDocLink"] = 333] = "JSDocLink"; 3121 SyntaxKind4[SyntaxKind4["JSDocLinkCode"] = 334] = "JSDocLinkCode"; 3122 SyntaxKind4[SyntaxKind4["JSDocLinkPlain"] = 335] = "JSDocLinkPlain"; 3123 SyntaxKind4[SyntaxKind4["JSDocTag"] = 336] = "JSDocTag"; 3124 SyntaxKind4[SyntaxKind4["JSDocAugmentsTag"] = 337] = "JSDocAugmentsTag"; 3125 SyntaxKind4[SyntaxKind4["JSDocImplementsTag"] = 338] = "JSDocImplementsTag"; 3126 SyntaxKind4[SyntaxKind4["JSDocAuthorTag"] = 339] = "JSDocAuthorTag"; 3127 SyntaxKind4[SyntaxKind4["JSDocDeprecatedTag"] = 340] = "JSDocDeprecatedTag"; 3128 SyntaxKind4[SyntaxKind4["JSDocClassTag"] = 341] = "JSDocClassTag"; 3129 SyntaxKind4[SyntaxKind4["JSDocPublicTag"] = 342] = "JSDocPublicTag"; 3130 SyntaxKind4[SyntaxKind4["JSDocPrivateTag"] = 343] = "JSDocPrivateTag"; 3131 SyntaxKind4[SyntaxKind4["JSDocProtectedTag"] = 344] = "JSDocProtectedTag"; 3132 SyntaxKind4[SyntaxKind4["JSDocReadonlyTag"] = 345] = "JSDocReadonlyTag"; 3133 SyntaxKind4[SyntaxKind4["JSDocOverrideTag"] = 346] = "JSDocOverrideTag"; 3134 SyntaxKind4[SyntaxKind4["JSDocCallbackTag"] = 347] = "JSDocCallbackTag"; 3135 SyntaxKind4[SyntaxKind4["JSDocEnumTag"] = 348] = "JSDocEnumTag"; 3136 SyntaxKind4[SyntaxKind4["JSDocParameterTag"] = 349] = "JSDocParameterTag"; 3137 SyntaxKind4[SyntaxKind4["JSDocReturnTag"] = 350] = "JSDocReturnTag"; 3138 SyntaxKind4[SyntaxKind4["JSDocThisTag"] = 351] = "JSDocThisTag"; 3139 SyntaxKind4[SyntaxKind4["JSDocTypeTag"] = 352] = "JSDocTypeTag"; 3140 SyntaxKind4[SyntaxKind4["JSDocTemplateTag"] = 353] = "JSDocTemplateTag"; 3141 SyntaxKind4[SyntaxKind4["JSDocTypedefTag"] = 354] = "JSDocTypedefTag"; 3142 SyntaxKind4[SyntaxKind4["JSDocSeeTag"] = 355] = "JSDocSeeTag"; 3143 SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 356] = "JSDocPropertyTag"; 3144 SyntaxKind4[SyntaxKind4["SyntaxList"] = 357] = "SyntaxList"; 3145 SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 358] = "NotEmittedStatement"; 3146 SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 359] = "PartiallyEmittedExpression"; 3147 SyntaxKind4[SyntaxKind4["CommaListExpression"] = 360] = "CommaListExpression"; 3148 SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 361] = "MergeDeclarationMarker"; 3149 SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 362] = "EndOfDeclarationMarker"; 3150 SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 363] = "SyntheticReferenceExpression"; 3151 SyntaxKind4[SyntaxKind4["Count"] = 364] = "Count"; 3152 SyntaxKind4[SyntaxKind4["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment"; 3153 SyntaxKind4[SyntaxKind4["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment"; 3154 SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment"; 3155 SyntaxKind4[SyntaxKind4["LastCompoundAssignment"] = 78 /* CaretEqualsToken */] = "LastCompoundAssignment"; 3156 SyntaxKind4[SyntaxKind4["FirstReservedWord"] = 81 /* BreakKeyword */] = "FirstReservedWord"; 3157 SyntaxKind4[SyntaxKind4["LastReservedWord"] = 117 /* WithKeyword */] = "LastReservedWord"; 3158 SyntaxKind4[SyntaxKind4["FirstKeyword"] = 81 /* BreakKeyword */] = "FirstKeyword"; 3159 SyntaxKind4[SyntaxKind4["LastKeyword"] = 164 /* OfKeyword */] = "LastKeyword"; 3160 SyntaxKind4[SyntaxKind4["FirstFutureReservedWord"] = 118 /* ImplementsKeyword */] = "FirstFutureReservedWord"; 3161 SyntaxKind4[SyntaxKind4["LastFutureReservedWord"] = 126 /* YieldKeyword */] = "LastFutureReservedWord"; 3162 SyntaxKind4[SyntaxKind4["FirstTypeNode"] = 182 /* TypePredicate */] = "FirstTypeNode"; 3163 SyntaxKind4[SyntaxKind4["LastTypeNode"] = 205 /* ImportType */] = "LastTypeNode"; 3164 SyntaxKind4[SyntaxKind4["FirstPunctuation"] = 18 /* OpenBraceToken */] = "FirstPunctuation"; 3165 SyntaxKind4[SyntaxKind4["LastPunctuation"] = 78 /* CaretEqualsToken */] = "LastPunctuation"; 3166 SyntaxKind4[SyntaxKind4["FirstToken"] = 0 /* Unknown */] = "FirstToken"; 3167 SyntaxKind4[SyntaxKind4["LastToken"] = 164 /* LastKeyword */] = "LastToken"; 3168 SyntaxKind4[SyntaxKind4["FirstTriviaToken"] = 2 /* SingleLineCommentTrivia */] = "FirstTriviaToken"; 3169 SyntaxKind4[SyntaxKind4["LastTriviaToken"] = 7 /* ConflictMarkerTrivia */] = "LastTriviaToken"; 3170 SyntaxKind4[SyntaxKind4["FirstLiteralToken"] = 8 /* NumericLiteral */] = "FirstLiteralToken"; 3171 SyntaxKind4[SyntaxKind4["LastLiteralToken"] = 14 /* NoSubstitutionTemplateLiteral */] = "LastLiteralToken"; 3172 SyntaxKind4[SyntaxKind4["FirstTemplateToken"] = 14 /* NoSubstitutionTemplateLiteral */] = "FirstTemplateToken"; 3173 SyntaxKind4[SyntaxKind4["LastTemplateToken"] = 17 /* TemplateTail */] = "LastTemplateToken"; 3174 SyntaxKind4[SyntaxKind4["FirstBinaryOperator"] = 29 /* LessThanToken */] = "FirstBinaryOperator"; 3175 SyntaxKind4[SyntaxKind4["LastBinaryOperator"] = 78 /* CaretEqualsToken */] = "LastBinaryOperator"; 3176 SyntaxKind4[SyntaxKind4["FirstStatement"] = 244 /* VariableStatement */] = "FirstStatement"; 3177 SyntaxKind4[SyntaxKind4["LastStatement"] = 260 /* DebuggerStatement */] = "LastStatement"; 3178 SyntaxKind4[SyntaxKind4["FirstNode"] = 165 /* QualifiedName */] = "FirstNode"; 3179 SyntaxKind4[SyntaxKind4["FirstJSDocNode"] = 318 /* JSDocTypeExpression */] = "FirstJSDocNode"; 3180 SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 356 /* JSDocPropertyTag */] = "LastJSDocNode"; 3181 SyntaxKind4[SyntaxKind4["FirstJSDocTagNode"] = 336 /* JSDocTag */] = "FirstJSDocTagNode"; 3182 SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 356 /* JSDocPropertyTag */] = "LastJSDocTagNode"; 3183 SyntaxKind4[SyntaxKind4["FirstContextualKeyword"] = 127 /* AbstractKeyword */] = "FirstContextualKeyword"; 3184 SyntaxKind4[SyntaxKind4["LastContextualKeyword"] = 164 /* OfKeyword */] = "LastContextualKeyword"; 3185 return SyntaxKind4; 3186})(SyntaxKind || {}); 3187var NodeFlags = /* @__PURE__ */ ((NodeFlags3) => { 3188 NodeFlags3[NodeFlags3["None"] = 0] = "None"; 3189 NodeFlags3[NodeFlags3["Let"] = 1] = "Let"; 3190 NodeFlags3[NodeFlags3["Const"] = 2] = "Const"; 3191 NodeFlags3[NodeFlags3["NestedNamespace"] = 4] = "NestedNamespace"; 3192 NodeFlags3[NodeFlags3["Synthesized"] = 8] = "Synthesized"; 3193 NodeFlags3[NodeFlags3["Namespace"] = 16] = "Namespace"; 3194 NodeFlags3[NodeFlags3["OptionalChain"] = 32] = "OptionalChain"; 3195 NodeFlags3[NodeFlags3["ExportContext"] = 64] = "ExportContext"; 3196 NodeFlags3[NodeFlags3["ContainsThis"] = 128] = "ContainsThis"; 3197 NodeFlags3[NodeFlags3["HasImplicitReturn"] = 256] = "HasImplicitReturn"; 3198 NodeFlags3[NodeFlags3["HasExplicitReturn"] = 512] = "HasExplicitReturn"; 3199 NodeFlags3[NodeFlags3["GlobalAugmentation"] = 1024] = "GlobalAugmentation"; 3200 NodeFlags3[NodeFlags3["HasAsyncFunctions"] = 2048] = "HasAsyncFunctions"; 3201 NodeFlags3[NodeFlags3["DisallowInContext"] = 4096] = "DisallowInContext"; 3202 NodeFlags3[NodeFlags3["YieldContext"] = 8192] = "YieldContext"; 3203 NodeFlags3[NodeFlags3["DecoratorContext"] = 16384] = "DecoratorContext"; 3204 NodeFlags3[NodeFlags3["AwaitContext"] = 32768] = "AwaitContext"; 3205 NodeFlags3[NodeFlags3["DisallowConditionalTypesContext"] = 65536] = "DisallowConditionalTypesContext"; 3206 NodeFlags3[NodeFlags3["ThisNodeHasError"] = 131072] = "ThisNodeHasError"; 3207 NodeFlags3[NodeFlags3["JavaScriptFile"] = 262144] = "JavaScriptFile"; 3208 NodeFlags3[NodeFlags3["ThisNodeOrAnySubNodesHasError"] = 524288] = "ThisNodeOrAnySubNodesHasError"; 3209 NodeFlags3[NodeFlags3["HasAggregatedChildData"] = 1048576] = "HasAggregatedChildData"; 3210 NodeFlags3[NodeFlags3["PossiblyContainsDynamicImport"] = 2097152] = "PossiblyContainsDynamicImport"; 3211 NodeFlags3[NodeFlags3["PossiblyContainsImportMeta"] = 4194304] = "PossiblyContainsImportMeta"; 3212 NodeFlags3[NodeFlags3["JSDoc"] = 8388608] = "JSDoc"; 3213 NodeFlags3[NodeFlags3["Ambient"] = 16777216] = "Ambient"; 3214 NodeFlags3[NodeFlags3["InWithStatement"] = 33554432] = "InWithStatement"; 3215 NodeFlags3[NodeFlags3["JsonFile"] = 67108864] = "JsonFile"; 3216 NodeFlags3[NodeFlags3["TypeCached"] = 134217728] = "TypeCached"; 3217 NodeFlags3[NodeFlags3["Deprecated"] = 268435456] = "Deprecated"; 3218 NodeFlags3[NodeFlags3["KitImportFlags"] = 536870912] = "KitImportFlags"; 3219 NodeFlags3[NodeFlags3["EtsContext"] = 1073741824] = "EtsContext"; 3220 NodeFlags3[NodeFlags3["NoOriginalText"] = -2147483648] = "NoOriginalText"; 3221 NodeFlags3[NodeFlags3["BlockScoped"] = 3] = "BlockScoped"; 3222 NodeFlags3[NodeFlags3["ReachabilityCheckFlags"] = 768] = "ReachabilityCheckFlags"; 3223 NodeFlags3[NodeFlags3["ReachabilityAndEmitFlags"] = 2816] = "ReachabilityAndEmitFlags"; 3224 NodeFlags3[NodeFlags3["ContextFlags"] = 1124462592] = "ContextFlags"; 3225 NodeFlags3[NodeFlags3["TypeExcludesFlags"] = 40960] = "TypeExcludesFlags"; 3226 NodeFlags3[NodeFlags3["PermanentlySetIncrementalFlags"] = 6291456] = "PermanentlySetIncrementalFlags"; 3227 return NodeFlags3; 3228})(NodeFlags || {}); 3229var ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => { 3230 ModifierFlags3[ModifierFlags3["None"] = 0] = "None"; 3231 ModifierFlags3[ModifierFlags3["Export"] = 1] = "Export"; 3232 ModifierFlags3[ModifierFlags3["Ambient"] = 2] = "Ambient"; 3233 ModifierFlags3[ModifierFlags3["Public"] = 4] = "Public"; 3234 ModifierFlags3[ModifierFlags3["Private"] = 8] = "Private"; 3235 ModifierFlags3[ModifierFlags3["Protected"] = 16] = "Protected"; 3236 ModifierFlags3[ModifierFlags3["Static"] = 32] = "Static"; 3237 ModifierFlags3[ModifierFlags3["Readonly"] = 64] = "Readonly"; 3238 ModifierFlags3[ModifierFlags3["Accessor"] = 128] = "Accessor"; 3239 ModifierFlags3[ModifierFlags3["Abstract"] = 256] = "Abstract"; 3240 ModifierFlags3[ModifierFlags3["Async"] = 512] = "Async"; 3241 ModifierFlags3[ModifierFlags3["Default"] = 1024] = "Default"; 3242 ModifierFlags3[ModifierFlags3["Const"] = 2048] = "Const"; 3243 ModifierFlags3[ModifierFlags3["HasComputedJSDocModifiers"] = 4096] = "HasComputedJSDocModifiers"; 3244 ModifierFlags3[ModifierFlags3["Deprecated"] = 8192] = "Deprecated"; 3245 ModifierFlags3[ModifierFlags3["Override"] = 16384] = "Override"; 3246 ModifierFlags3[ModifierFlags3["In"] = 32768] = "In"; 3247 ModifierFlags3[ModifierFlags3["Out"] = 65536] = "Out"; 3248 ModifierFlags3[ModifierFlags3["Decorator"] = 131072] = "Decorator"; 3249 ModifierFlags3[ModifierFlags3["HasComputedFlags"] = 536870912] = "HasComputedFlags"; 3250 ModifierFlags3[ModifierFlags3["AccessibilityModifier"] = 28] = "AccessibilityModifier"; 3251 ModifierFlags3[ModifierFlags3["ParameterPropertyModifier"] = 16476] = "ParameterPropertyModifier"; 3252 ModifierFlags3[ModifierFlags3["NonPublicAccessibilityModifier"] = 24] = "NonPublicAccessibilityModifier"; 3253 ModifierFlags3[ModifierFlags3["TypeScriptModifier"] = 117086] = "TypeScriptModifier"; 3254 ModifierFlags3[ModifierFlags3["ExportDefault"] = 1025] = "ExportDefault"; 3255 ModifierFlags3[ModifierFlags3["All"] = 258047] = "All"; 3256 ModifierFlags3[ModifierFlags3["Modifier"] = 126975] = "Modifier"; 3257 return ModifierFlags3; 3258})(ModifierFlags || {}); 3259var RelationComparisonResult = /* @__PURE__ */ ((RelationComparisonResult3) => { 3260 RelationComparisonResult3[RelationComparisonResult3["Succeeded"] = 1] = "Succeeded"; 3261 RelationComparisonResult3[RelationComparisonResult3["Failed"] = 2] = "Failed"; 3262 RelationComparisonResult3[RelationComparisonResult3["ReportsUnmeasurable"] = 8] = "ReportsUnmeasurable"; 3263 RelationComparisonResult3[RelationComparisonResult3["ReportsUnreliable"] = 16] = "ReportsUnreliable"; 3264 RelationComparisonResult3[RelationComparisonResult3["ReportsMask"] = 24] = "ReportsMask"; 3265 return RelationComparisonResult3; 3266})(RelationComparisonResult || {}); 3267var GeneratedIdentifierFlags = /* @__PURE__ */ ((GeneratedIdentifierFlags2) => { 3268 GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["None"] = 0] = "None"; 3269 GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Auto"] = 1] = "Auto"; 3270 GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Loop"] = 2] = "Loop"; 3271 GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Unique"] = 3] = "Unique"; 3272 GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Node"] = 4] = "Node"; 3273 GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["KindMask"] = 7] = "KindMask"; 3274 GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["ReservedInNestedScopes"] = 8] = "ReservedInNestedScopes"; 3275 GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["Optimistic"] = 16] = "Optimistic"; 3276 GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["FileLevel"] = 32] = "FileLevel"; 3277 GeneratedIdentifierFlags2[GeneratedIdentifierFlags2["AllowNameSubstitution"] = 64] = "AllowNameSubstitution"; 3278 return GeneratedIdentifierFlags2; 3279})(GeneratedIdentifierFlags || {}); 3280var FlowFlags = /* @__PURE__ */ ((FlowFlags2) => { 3281 FlowFlags2[FlowFlags2["Unreachable"] = 1] = "Unreachable"; 3282 FlowFlags2[FlowFlags2["Start"] = 2] = "Start"; 3283 FlowFlags2[FlowFlags2["BranchLabel"] = 4] = "BranchLabel"; 3284 FlowFlags2[FlowFlags2["LoopLabel"] = 8] = "LoopLabel"; 3285 FlowFlags2[FlowFlags2["Assignment"] = 16] = "Assignment"; 3286 FlowFlags2[FlowFlags2["TrueCondition"] = 32] = "TrueCondition"; 3287 FlowFlags2[FlowFlags2["FalseCondition"] = 64] = "FalseCondition"; 3288 FlowFlags2[FlowFlags2["SwitchClause"] = 128] = "SwitchClause"; 3289 FlowFlags2[FlowFlags2["ArrayMutation"] = 256] = "ArrayMutation"; 3290 FlowFlags2[FlowFlags2["Call"] = 512] = "Call"; 3291 FlowFlags2[FlowFlags2["ReduceLabel"] = 1024] = "ReduceLabel"; 3292 FlowFlags2[FlowFlags2["Referenced"] = 2048] = "Referenced"; 3293 FlowFlags2[FlowFlags2["Shared"] = 4096] = "Shared"; 3294 FlowFlags2[FlowFlags2["Label"] = 12] = "Label"; 3295 FlowFlags2[FlowFlags2["Condition"] = 96] = "Condition"; 3296 return FlowFlags2; 3297})(FlowFlags || {}); 3298var SymbolFlags = /* @__PURE__ */ ((SymbolFlags2) => { 3299 SymbolFlags2[SymbolFlags2["None"] = 0] = "None"; 3300 SymbolFlags2[SymbolFlags2["FunctionScopedVariable"] = 1] = "FunctionScopedVariable"; 3301 SymbolFlags2[SymbolFlags2["BlockScopedVariable"] = 2] = "BlockScopedVariable"; 3302 SymbolFlags2[SymbolFlags2["Property"] = 4] = "Property"; 3303 SymbolFlags2[SymbolFlags2["EnumMember"] = 8] = "EnumMember"; 3304 SymbolFlags2[SymbolFlags2["Function"] = 16] = "Function"; 3305 SymbolFlags2[SymbolFlags2["Class"] = 32] = "Class"; 3306 SymbolFlags2[SymbolFlags2["Interface"] = 64] = "Interface"; 3307 SymbolFlags2[SymbolFlags2["ConstEnum"] = 128] = "ConstEnum"; 3308 SymbolFlags2[SymbolFlags2["RegularEnum"] = 256] = "RegularEnum"; 3309 SymbolFlags2[SymbolFlags2["ValueModule"] = 512] = "ValueModule"; 3310 SymbolFlags2[SymbolFlags2["NamespaceModule"] = 1024] = "NamespaceModule"; 3311 SymbolFlags2[SymbolFlags2["TypeLiteral"] = 2048] = "TypeLiteral"; 3312 SymbolFlags2[SymbolFlags2["ObjectLiteral"] = 4096] = "ObjectLiteral"; 3313 SymbolFlags2[SymbolFlags2["Method"] = 8192] = "Method"; 3314 SymbolFlags2[SymbolFlags2["Constructor"] = 16384] = "Constructor"; 3315 SymbolFlags2[SymbolFlags2["GetAccessor"] = 32768] = "GetAccessor"; 3316 SymbolFlags2[SymbolFlags2["SetAccessor"] = 65536] = "SetAccessor"; 3317 SymbolFlags2[SymbolFlags2["Signature"] = 131072] = "Signature"; 3318 SymbolFlags2[SymbolFlags2["TypeParameter"] = 262144] = "TypeParameter"; 3319 SymbolFlags2[SymbolFlags2["TypeAlias"] = 524288] = "TypeAlias"; 3320 SymbolFlags2[SymbolFlags2["ExportValue"] = 1048576] = "ExportValue"; 3321 SymbolFlags2[SymbolFlags2["Alias"] = 2097152] = "Alias"; 3322 SymbolFlags2[SymbolFlags2["Prototype"] = 4194304] = "Prototype"; 3323 SymbolFlags2[SymbolFlags2["ExportStar"] = 8388608] = "ExportStar"; 3324 SymbolFlags2[SymbolFlags2["Optional"] = 16777216] = "Optional"; 3325 SymbolFlags2[SymbolFlags2["Transient"] = 33554432] = "Transient"; 3326 SymbolFlags2[SymbolFlags2["Assignment"] = 67108864] = "Assignment"; 3327 SymbolFlags2[SymbolFlags2["ModuleExports"] = 134217728] = "ModuleExports"; 3328 SymbolFlags2[SymbolFlags2["Annotation"] = 268435456] = "Annotation"; 3329 SymbolFlags2[SymbolFlags2["All"] = 67108863] = "All"; 3330 SymbolFlags2[SymbolFlags2["Enum"] = 384] = "Enum"; 3331 SymbolFlags2[SymbolFlags2["Variable"] = 3] = "Variable"; 3332 SymbolFlags2[SymbolFlags2["Value"] = 111551] = "Value"; 3333 SymbolFlags2[SymbolFlags2["Type"] = 788968] = "Type"; 3334 SymbolFlags2[SymbolFlags2["Namespace"] = 1920] = "Namespace"; 3335 SymbolFlags2[SymbolFlags2["Module"] = 1536] = "Module"; 3336 SymbolFlags2[SymbolFlags2["Accessor"] = 98304] = "Accessor"; 3337 SymbolFlags2[SymbolFlags2["FunctionScopedVariableExcludes"] = 111550] = "FunctionScopedVariableExcludes"; 3338 SymbolFlags2[SymbolFlags2["BlockScopedVariableExcludes"] = 111551 /* Value */] = "BlockScopedVariableExcludes"; 3339 SymbolFlags2[SymbolFlags2["ParameterExcludes"] = 111551 /* Value */] = "ParameterExcludes"; 3340 SymbolFlags2[SymbolFlags2["PropertyExcludes"] = 0 /* None */] = "PropertyExcludes"; 3341 SymbolFlags2[SymbolFlags2["EnumMemberExcludes"] = 900095] = "EnumMemberExcludes"; 3342 SymbolFlags2[SymbolFlags2["FunctionExcludes"] = 110991] = "FunctionExcludes"; 3343 SymbolFlags2[SymbolFlags2["ClassExcludes"] = 899503] = "ClassExcludes"; 3344 SymbolFlags2[SymbolFlags2["InterfaceExcludes"] = 788872] = "InterfaceExcludes"; 3345 SymbolFlags2[SymbolFlags2["RegularEnumExcludes"] = 899327] = "RegularEnumExcludes"; 3346 SymbolFlags2[SymbolFlags2["ConstEnumExcludes"] = 899967] = "ConstEnumExcludes"; 3347 SymbolFlags2[SymbolFlags2["ValueModuleExcludes"] = 110735] = "ValueModuleExcludes"; 3348 SymbolFlags2[SymbolFlags2["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; 3349 SymbolFlags2[SymbolFlags2["MethodExcludes"] = 103359] = "MethodExcludes"; 3350 SymbolFlags2[SymbolFlags2["GetAccessorExcludes"] = 46015] = "GetAccessorExcludes"; 3351 SymbolFlags2[SymbolFlags2["SetAccessorExcludes"] = 78783] = "SetAccessorExcludes"; 3352 SymbolFlags2[SymbolFlags2["AccessorExcludes"] = 13247] = "AccessorExcludes"; 3353 SymbolFlags2[SymbolFlags2["TypeParameterExcludes"] = 526824] = "TypeParameterExcludes"; 3354 SymbolFlags2[SymbolFlags2["TypeAliasExcludes"] = 788968 /* Type */] = "TypeAliasExcludes"; 3355 SymbolFlags2[SymbolFlags2["AliasExcludes"] = 2097152 /* Alias */] = "AliasExcludes"; 3356 SymbolFlags2[SymbolFlags2["ModuleMember"] = 2623475] = "ModuleMember"; 3357 SymbolFlags2[SymbolFlags2["ExportHasLocal"] = 944] = "ExportHasLocal"; 3358 SymbolFlags2[SymbolFlags2["BlockScoped"] = 418] = "BlockScoped"; 3359 SymbolFlags2[SymbolFlags2["PropertyOrAccessor"] = 98308] = "PropertyOrAccessor"; 3360 SymbolFlags2[SymbolFlags2["ClassMember"] = 106500] = "ClassMember"; 3361 SymbolFlags2[SymbolFlags2["ExportSupportsDefaultModifier"] = 112] = "ExportSupportsDefaultModifier"; 3362 SymbolFlags2[SymbolFlags2["ExportDoesNotSupportDefaultModifier"] = -113] = "ExportDoesNotSupportDefaultModifier"; 3363 SymbolFlags2[SymbolFlags2["Classifiable"] = 2885600] = "Classifiable"; 3364 SymbolFlags2[SymbolFlags2["LateBindingContainer"] = 6256] = "LateBindingContainer"; 3365 return SymbolFlags2; 3366})(SymbolFlags || {}); 3367var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => { 3368 TypeFlags2[TypeFlags2["Any"] = 1] = "Any"; 3369 TypeFlags2[TypeFlags2["Unknown"] = 2] = "Unknown"; 3370 TypeFlags2[TypeFlags2["String"] = 4] = "String"; 3371 TypeFlags2[TypeFlags2["Number"] = 8] = "Number"; 3372 TypeFlags2[TypeFlags2["Boolean"] = 16] = "Boolean"; 3373 TypeFlags2[TypeFlags2["Enum"] = 32] = "Enum"; 3374 TypeFlags2[TypeFlags2["BigInt"] = 64] = "BigInt"; 3375 TypeFlags2[TypeFlags2["StringLiteral"] = 128] = "StringLiteral"; 3376 TypeFlags2[TypeFlags2["NumberLiteral"] = 256] = "NumberLiteral"; 3377 TypeFlags2[TypeFlags2["BooleanLiteral"] = 512] = "BooleanLiteral"; 3378 TypeFlags2[TypeFlags2["EnumLiteral"] = 1024] = "EnumLiteral"; 3379 TypeFlags2[TypeFlags2["BigIntLiteral"] = 2048] = "BigIntLiteral"; 3380 TypeFlags2[TypeFlags2["ESSymbol"] = 4096] = "ESSymbol"; 3381 TypeFlags2[TypeFlags2["UniqueESSymbol"] = 8192] = "UniqueESSymbol"; 3382 TypeFlags2[TypeFlags2["Void"] = 16384] = "Void"; 3383 TypeFlags2[TypeFlags2["Undefined"] = 32768] = "Undefined"; 3384 TypeFlags2[TypeFlags2["Null"] = 65536] = "Null"; 3385 TypeFlags2[TypeFlags2["Never"] = 131072] = "Never"; 3386 TypeFlags2[TypeFlags2["TypeParameter"] = 262144] = "TypeParameter"; 3387 TypeFlags2[TypeFlags2["Object"] = 524288] = "Object"; 3388 TypeFlags2[TypeFlags2["Union"] = 1048576] = "Union"; 3389 TypeFlags2[TypeFlags2["Intersection"] = 2097152] = "Intersection"; 3390 TypeFlags2[TypeFlags2["Index"] = 4194304] = "Index"; 3391 TypeFlags2[TypeFlags2["IndexedAccess"] = 8388608] = "IndexedAccess"; 3392 TypeFlags2[TypeFlags2["Conditional"] = 16777216] = "Conditional"; 3393 TypeFlags2[TypeFlags2["Substitution"] = 33554432] = "Substitution"; 3394 TypeFlags2[TypeFlags2["NonPrimitive"] = 67108864] = "NonPrimitive"; 3395 TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral"; 3396 TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping"; 3397 TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown"; 3398 TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable"; 3399 TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal"; 3400 TypeFlags2[TypeFlags2["Unit"] = 109440] = "Unit"; 3401 TypeFlags2[TypeFlags2["StringOrNumberLiteral"] = 384] = "StringOrNumberLiteral"; 3402 TypeFlags2[TypeFlags2["StringOrNumberLiteralOrUnique"] = 8576] = "StringOrNumberLiteralOrUnique"; 3403 TypeFlags2[TypeFlags2["DefinitelyFalsy"] = 117632] = "DefinitelyFalsy"; 3404 TypeFlags2[TypeFlags2["PossiblyFalsy"] = 117724] = "PossiblyFalsy"; 3405 TypeFlags2[TypeFlags2["Intrinsic"] = 67359327] = "Intrinsic"; 3406 TypeFlags2[TypeFlags2["Primitive"] = 131068] = "Primitive"; 3407 TypeFlags2[TypeFlags2["StringLike"] = 402653316] = "StringLike"; 3408 TypeFlags2[TypeFlags2["NumberLike"] = 296] = "NumberLike"; 3409 TypeFlags2[TypeFlags2["BigIntLike"] = 2112] = "BigIntLike"; 3410 TypeFlags2[TypeFlags2["BooleanLike"] = 528] = "BooleanLike"; 3411 TypeFlags2[TypeFlags2["EnumLike"] = 1056] = "EnumLike"; 3412 TypeFlags2[TypeFlags2["ESSymbolLike"] = 12288] = "ESSymbolLike"; 3413 TypeFlags2[TypeFlags2["VoidLike"] = 49152] = "VoidLike"; 3414 TypeFlags2[TypeFlags2["DefinitelyNonNullable"] = 470302716] = "DefinitelyNonNullable"; 3415 TypeFlags2[TypeFlags2["DisjointDomains"] = 469892092] = "DisjointDomains"; 3416 TypeFlags2[TypeFlags2["UnionOrIntersection"] = 3145728] = "UnionOrIntersection"; 3417 TypeFlags2[TypeFlags2["StructuredType"] = 3670016] = "StructuredType"; 3418 TypeFlags2[TypeFlags2["TypeVariable"] = 8650752] = "TypeVariable"; 3419 TypeFlags2[TypeFlags2["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive"; 3420 TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive"; 3421 TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable"; 3422 TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable"; 3423 TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType"; 3424 TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable"; 3425 TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton"; 3426 TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable"; 3427 TypeFlags2[TypeFlags2["IncludesMask"] = 205258751] = "IncludesMask"; 3428 TypeFlags2[TypeFlags2["IncludesMissingType"] = 262144 /* TypeParameter */] = "IncludesMissingType"; 3429 TypeFlags2[TypeFlags2["IncludesNonWideningType"] = 4194304 /* Index */] = "IncludesNonWideningType"; 3430 TypeFlags2[TypeFlags2["IncludesWildcard"] = 8388608 /* IndexedAccess */] = "IncludesWildcard"; 3431 TypeFlags2[TypeFlags2["IncludesEmptyObject"] = 16777216 /* Conditional */] = "IncludesEmptyObject"; 3432 TypeFlags2[TypeFlags2["IncludesInstantiable"] = 33554432 /* Substitution */] = "IncludesInstantiable"; 3433 TypeFlags2[TypeFlags2["NotPrimitiveUnion"] = 36323331] = "NotPrimitiveUnion"; 3434 return TypeFlags2; 3435})(TypeFlags || {}); 3436var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => { 3437 ObjectFlags3[ObjectFlags3["Class"] = 1] = "Class"; 3438 ObjectFlags3[ObjectFlags3["Interface"] = 2] = "Interface"; 3439 ObjectFlags3[ObjectFlags3["Reference"] = 4] = "Reference"; 3440 ObjectFlags3[ObjectFlags3["Tuple"] = 8] = "Tuple"; 3441 ObjectFlags3[ObjectFlags3["Anonymous"] = 16] = "Anonymous"; 3442 ObjectFlags3[ObjectFlags3["Mapped"] = 32] = "Mapped"; 3443 ObjectFlags3[ObjectFlags3["Instantiated"] = 64] = "Instantiated"; 3444 ObjectFlags3[ObjectFlags3["ObjectLiteral"] = 128] = "ObjectLiteral"; 3445 ObjectFlags3[ObjectFlags3["EvolvingArray"] = 256] = "EvolvingArray"; 3446 ObjectFlags3[ObjectFlags3["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties"; 3447 ObjectFlags3[ObjectFlags3["ReverseMapped"] = 1024] = "ReverseMapped"; 3448 ObjectFlags3[ObjectFlags3["JsxAttributes"] = 2048] = "JsxAttributes"; 3449 ObjectFlags3[ObjectFlags3["JSLiteral"] = 4096] = "JSLiteral"; 3450 ObjectFlags3[ObjectFlags3["FreshLiteral"] = 8192] = "FreshLiteral"; 3451 ObjectFlags3[ObjectFlags3["ArrayLiteral"] = 16384] = "ArrayLiteral"; 3452 ObjectFlags3[ObjectFlags3["Annotation"] = 134217728] = "Annotation"; 3453 ObjectFlags3[ObjectFlags3["PrimitiveUnion"] = 32768] = "PrimitiveUnion"; 3454 ObjectFlags3[ObjectFlags3["ContainsWideningType"] = 65536] = "ContainsWideningType"; 3455 ObjectFlags3[ObjectFlags3["ContainsObjectOrArrayLiteral"] = 131072] = "ContainsObjectOrArrayLiteral"; 3456 ObjectFlags3[ObjectFlags3["NonInferrableType"] = 262144] = "NonInferrableType"; 3457 ObjectFlags3[ObjectFlags3["CouldContainTypeVariablesComputed"] = 524288] = "CouldContainTypeVariablesComputed"; 3458 ObjectFlags3[ObjectFlags3["CouldContainTypeVariables"] = 1048576] = "CouldContainTypeVariables"; 3459 ObjectFlags3[ObjectFlags3["ClassOrInterface"] = 3] = "ClassOrInterface"; 3460 ObjectFlags3[ObjectFlags3["RequiresWidening"] = 196608] = "RequiresWidening"; 3461 ObjectFlags3[ObjectFlags3["PropagatingFlags"] = 458752] = "PropagatingFlags"; 3462 ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] = 1343] = "ObjectTypeKindMask"; 3463 ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread"; 3464 ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType"; 3465 ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType"; 3466 ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone"; 3467 ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated"; 3468 ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists"; 3469 ObjectFlags3[ObjectFlags3["IsGenericTypeComputed"] = 2097152] = "IsGenericTypeComputed"; 3470 ObjectFlags3[ObjectFlags3["IsGenericObjectType"] = 4194304] = "IsGenericObjectType"; 3471 ObjectFlags3[ObjectFlags3["IsGenericIndexType"] = 8388608] = "IsGenericIndexType"; 3472 ObjectFlags3[ObjectFlags3["IsGenericType"] = 12582912] = "IsGenericType"; 3473 ObjectFlags3[ObjectFlags3["ContainsIntersections"] = 16777216] = "ContainsIntersections"; 3474 ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] = 33554432] = "IsUnknownLikeUnionComputed"; 3475 ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] = 67108864] = "IsUnknownLikeUnion"; 3476 ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] = 16777216] = "IsNeverIntersectionComputed"; 3477 ObjectFlags3[ObjectFlags3["IsNeverIntersection"] = 33554432] = "IsNeverIntersection"; 3478 return ObjectFlags3; 3479})(ObjectFlags || {}); 3480var SignatureFlags = /* @__PURE__ */ ((SignatureFlags4) => { 3481 SignatureFlags4[SignatureFlags4["None"] = 0] = "None"; 3482 SignatureFlags4[SignatureFlags4["HasRestParameter"] = 1] = "HasRestParameter"; 3483 SignatureFlags4[SignatureFlags4["HasLiteralTypes"] = 2] = "HasLiteralTypes"; 3484 SignatureFlags4[SignatureFlags4["Abstract"] = 4] = "Abstract"; 3485 SignatureFlags4[SignatureFlags4["IsInnerCallChain"] = 8] = "IsInnerCallChain"; 3486 SignatureFlags4[SignatureFlags4["IsOuterCallChain"] = 16] = "IsOuterCallChain"; 3487 SignatureFlags4[SignatureFlags4["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile"; 3488 SignatureFlags4[SignatureFlags4["PropagatingFlags"] = 39] = "PropagatingFlags"; 3489 SignatureFlags4[SignatureFlags4["CallChainFlags"] = 24] = "CallChainFlags"; 3490 return SignatureFlags4; 3491})(SignatureFlags || {}); 3492var DiagnosticCategory = /* @__PURE__ */ ((DiagnosticCategory2) => { 3493 DiagnosticCategory2[DiagnosticCategory2["Warning"] = 0] = "Warning"; 3494 DiagnosticCategory2[DiagnosticCategory2["Error"] = 1] = "Error"; 3495 DiagnosticCategory2[DiagnosticCategory2["Suggestion"] = 2] = "Suggestion"; 3496 DiagnosticCategory2[DiagnosticCategory2["Message"] = 3] = "Message"; 3497 return DiagnosticCategory2; 3498})(DiagnosticCategory || {}); 3499var ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind2) => { 3500 ModuleResolutionKind2[ModuleResolutionKind2["Classic"] = 1] = "Classic"; 3501 ModuleResolutionKind2[ModuleResolutionKind2["NodeJs"] = 2] = "NodeJs"; 3502 ModuleResolutionKind2[ModuleResolutionKind2["Node16"] = 3] = "Node16"; 3503 ModuleResolutionKind2[ModuleResolutionKind2["NodeNext"] = 99] = "NodeNext"; 3504 return ModuleResolutionKind2; 3505})(ModuleResolutionKind || {}); 3506var TransformFlags = /* @__PURE__ */ ((TransformFlags3) => { 3507 TransformFlags3[TransformFlags3["None"] = 0] = "None"; 3508 TransformFlags3[TransformFlags3["ContainsTypeScript"] = 1] = "ContainsTypeScript"; 3509 TransformFlags3[TransformFlags3["ContainsJsx"] = 2] = "ContainsJsx"; 3510 TransformFlags3[TransformFlags3["ContainsESNext"] = 4] = "ContainsESNext"; 3511 TransformFlags3[TransformFlags3["ContainsES2022"] = 8] = "ContainsES2022"; 3512 TransformFlags3[TransformFlags3["ContainsES2021"] = 16] = "ContainsES2021"; 3513 TransformFlags3[TransformFlags3["ContainsES2020"] = 32] = "ContainsES2020"; 3514 TransformFlags3[TransformFlags3["ContainsES2019"] = 64] = "ContainsES2019"; 3515 TransformFlags3[TransformFlags3["ContainsES2018"] = 128] = "ContainsES2018"; 3516 TransformFlags3[TransformFlags3["ContainsES2017"] = 256] = "ContainsES2017"; 3517 TransformFlags3[TransformFlags3["ContainsES2016"] = 512] = "ContainsES2016"; 3518 TransformFlags3[TransformFlags3["ContainsES2015"] = 1024] = "ContainsES2015"; 3519 TransformFlags3[TransformFlags3["ContainsGenerator"] = 2048] = "ContainsGenerator"; 3520 TransformFlags3[TransformFlags3["ContainsDestructuringAssignment"] = 4096] = "ContainsDestructuringAssignment"; 3521 TransformFlags3[TransformFlags3["ContainsTypeScriptClassSyntax"] = 8192] = "ContainsTypeScriptClassSyntax"; 3522 TransformFlags3[TransformFlags3["ContainsLexicalThis"] = 16384] = "ContainsLexicalThis"; 3523 TransformFlags3[TransformFlags3["ContainsRestOrSpread"] = 32768] = "ContainsRestOrSpread"; 3524 TransformFlags3[TransformFlags3["ContainsObjectRestOrSpread"] = 65536] = "ContainsObjectRestOrSpread"; 3525 TransformFlags3[TransformFlags3["ContainsComputedPropertyName"] = 131072] = "ContainsComputedPropertyName"; 3526 TransformFlags3[TransformFlags3["ContainsBlockScopedBinding"] = 262144] = "ContainsBlockScopedBinding"; 3527 TransformFlags3[TransformFlags3["ContainsBindingPattern"] = 524288] = "ContainsBindingPattern"; 3528 TransformFlags3[TransformFlags3["ContainsYield"] = 1048576] = "ContainsYield"; 3529 TransformFlags3[TransformFlags3["ContainsAwait"] = 2097152] = "ContainsAwait"; 3530 TransformFlags3[TransformFlags3["ContainsHoistedDeclarationOrCompletion"] = 4194304] = "ContainsHoistedDeclarationOrCompletion"; 3531 TransformFlags3[TransformFlags3["ContainsDynamicImport"] = 8388608] = "ContainsDynamicImport"; 3532 TransformFlags3[TransformFlags3["ContainsClassFields"] = 16777216] = "ContainsClassFields"; 3533 TransformFlags3[TransformFlags3["ContainsDecorators"] = 33554432] = "ContainsDecorators"; 3534 TransformFlags3[TransformFlags3["ContainsPossibleTopLevelAwait"] = 67108864] = "ContainsPossibleTopLevelAwait"; 3535 TransformFlags3[TransformFlags3["ContainsLexicalSuper"] = 134217728] = "ContainsLexicalSuper"; 3536 TransformFlags3[TransformFlags3["ContainsUpdateExpressionForIdentifier"] = 268435456] = "ContainsUpdateExpressionForIdentifier"; 3537 TransformFlags3[TransformFlags3["ContainsPrivateIdentifierInExpression"] = 536870912] = "ContainsPrivateIdentifierInExpression"; 3538 TransformFlags3[TransformFlags3["HasComputedFlags"] = -2147483648] = "HasComputedFlags"; 3539 TransformFlags3[TransformFlags3["AssertTypeScript"] = 1 /* ContainsTypeScript */] = "AssertTypeScript"; 3540 TransformFlags3[TransformFlags3["AssertJsx"] = 2 /* ContainsJsx */] = "AssertJsx"; 3541 TransformFlags3[TransformFlags3["AssertESNext"] = 4 /* ContainsESNext */] = "AssertESNext"; 3542 TransformFlags3[TransformFlags3["AssertES2022"] = 8 /* ContainsES2022 */] = "AssertES2022"; 3543 TransformFlags3[TransformFlags3["AssertES2021"] = 16 /* ContainsES2021 */] = "AssertES2021"; 3544 TransformFlags3[TransformFlags3["AssertES2020"] = 32 /* ContainsES2020 */] = "AssertES2020"; 3545 TransformFlags3[TransformFlags3["AssertES2019"] = 64 /* ContainsES2019 */] = "AssertES2019"; 3546 TransformFlags3[TransformFlags3["AssertES2018"] = 128 /* ContainsES2018 */] = "AssertES2018"; 3547 TransformFlags3[TransformFlags3["AssertES2017"] = 256 /* ContainsES2017 */] = "AssertES2017"; 3548 TransformFlags3[TransformFlags3["AssertES2016"] = 512 /* ContainsES2016 */] = "AssertES2016"; 3549 TransformFlags3[TransformFlags3["AssertES2015"] = 1024 /* ContainsES2015 */] = "AssertES2015"; 3550 TransformFlags3[TransformFlags3["AssertGenerator"] = 2048 /* ContainsGenerator */] = "AssertGenerator"; 3551 TransformFlags3[TransformFlags3["AssertDestructuringAssignment"] = 4096 /* ContainsDestructuringAssignment */] = "AssertDestructuringAssignment"; 3552 TransformFlags3[TransformFlags3["OuterExpressionExcludes"] = -2147483648 /* HasComputedFlags */] = "OuterExpressionExcludes"; 3553 TransformFlags3[TransformFlags3["PropertyAccessExcludes"] = -2147483648 /* OuterExpressionExcludes */] = "PropertyAccessExcludes"; 3554 TransformFlags3[TransformFlags3["NodeExcludes"] = -2147483648 /* PropertyAccessExcludes */] = "NodeExcludes"; 3555 TransformFlags3[TransformFlags3["ArrowFunctionExcludes"] = -2072174592] = "ArrowFunctionExcludes"; 3556 TransformFlags3[TransformFlags3["FunctionExcludes"] = -1937940480] = "FunctionExcludes"; 3557 TransformFlags3[TransformFlags3["ConstructorExcludes"] = -1937948672] = "ConstructorExcludes"; 3558 TransformFlags3[TransformFlags3["MethodOrAccessorExcludes"] = -2005057536] = "MethodOrAccessorExcludes"; 3559 TransformFlags3[TransformFlags3["PropertyExcludes"] = -2013249536] = "PropertyExcludes"; 3560 TransformFlags3[TransformFlags3["ClassExcludes"] = -2147344384] = "ClassExcludes"; 3561 TransformFlags3[TransformFlags3["ModuleExcludes"] = -1941676032] = "ModuleExcludes"; 3562 TransformFlags3[TransformFlags3["TypeExcludes"] = -2] = "TypeExcludes"; 3563 TransformFlags3[TransformFlags3["ObjectLiteralExcludes"] = -2147278848] = "ObjectLiteralExcludes"; 3564 TransformFlags3[TransformFlags3["ArrayLiteralOrCallOrNewExcludes"] = -2147450880] = "ArrayLiteralOrCallOrNewExcludes"; 3565 TransformFlags3[TransformFlags3["VariableDeclarationListExcludes"] = -2146893824] = "VariableDeclarationListExcludes"; 3566 TransformFlags3[TransformFlags3["ParameterExcludes"] = -2147483648 /* NodeExcludes */] = "ParameterExcludes"; 3567 TransformFlags3[TransformFlags3["CatchClauseExcludes"] = -2147418112] = "CatchClauseExcludes"; 3568 TransformFlags3[TransformFlags3["BindingPatternExcludes"] = -2147450880] = "BindingPatternExcludes"; 3569 TransformFlags3[TransformFlags3["ContainsLexicalThisOrSuper"] = 134234112] = "ContainsLexicalThisOrSuper"; 3570 TransformFlags3[TransformFlags3["PropertyNamePropagatingFlags"] = 134234112] = "PropertyNamePropagatingFlags"; 3571 return TransformFlags3; 3572})(TransformFlags || {}); 3573var SnippetKind = /* @__PURE__ */ ((SnippetKind3) => { 3574 SnippetKind3[SnippetKind3["TabStop"] = 0] = "TabStop"; 3575 SnippetKind3[SnippetKind3["Placeholder"] = 1] = "Placeholder"; 3576 SnippetKind3[SnippetKind3["Choice"] = 2] = "Choice"; 3577 SnippetKind3[SnippetKind3["Variable"] = 3] = "Variable"; 3578 return SnippetKind3; 3579})(SnippetKind || {}); 3580var EmitFlags = /* @__PURE__ */ ((EmitFlags3) => { 3581 EmitFlags3[EmitFlags3["None"] = 0] = "None"; 3582 EmitFlags3[EmitFlags3["SingleLine"] = 1] = "SingleLine"; 3583 EmitFlags3[EmitFlags3["AdviseOnEmitNode"] = 2] = "AdviseOnEmitNode"; 3584 EmitFlags3[EmitFlags3["NoSubstitution"] = 4] = "NoSubstitution"; 3585 EmitFlags3[EmitFlags3["CapturesThis"] = 8] = "CapturesThis"; 3586 EmitFlags3[EmitFlags3["NoLeadingSourceMap"] = 16] = "NoLeadingSourceMap"; 3587 EmitFlags3[EmitFlags3["NoTrailingSourceMap"] = 32] = "NoTrailingSourceMap"; 3588 EmitFlags3[EmitFlags3["NoSourceMap"] = 48] = "NoSourceMap"; 3589 EmitFlags3[EmitFlags3["NoNestedSourceMaps"] = 64] = "NoNestedSourceMaps"; 3590 EmitFlags3[EmitFlags3["NoTokenLeadingSourceMaps"] = 128] = "NoTokenLeadingSourceMaps"; 3591 EmitFlags3[EmitFlags3["NoTokenTrailingSourceMaps"] = 256] = "NoTokenTrailingSourceMaps"; 3592 EmitFlags3[EmitFlags3["NoTokenSourceMaps"] = 384] = "NoTokenSourceMaps"; 3593 EmitFlags3[EmitFlags3["NoLeadingComments"] = 512] = "NoLeadingComments"; 3594 EmitFlags3[EmitFlags3["NoTrailingComments"] = 1024] = "NoTrailingComments"; 3595 EmitFlags3[EmitFlags3["NoComments"] = 1536] = "NoComments"; 3596 EmitFlags3[EmitFlags3["NoNestedComments"] = 2048] = "NoNestedComments"; 3597 EmitFlags3[EmitFlags3["HelperName"] = 4096] = "HelperName"; 3598 EmitFlags3[EmitFlags3["ExportName"] = 8192] = "ExportName"; 3599 EmitFlags3[EmitFlags3["LocalName"] = 16384] = "LocalName"; 3600 EmitFlags3[EmitFlags3["InternalName"] = 32768] = "InternalName"; 3601 EmitFlags3[EmitFlags3["Indented"] = 65536] = "Indented"; 3602 EmitFlags3[EmitFlags3["NoIndentation"] = 131072] = "NoIndentation"; 3603 EmitFlags3[EmitFlags3["AsyncFunctionBody"] = 262144] = "AsyncFunctionBody"; 3604 EmitFlags3[EmitFlags3["ReuseTempVariableScope"] = 524288] = "ReuseTempVariableScope"; 3605 EmitFlags3[EmitFlags3["CustomPrologue"] = 1048576] = "CustomPrologue"; 3606 EmitFlags3[EmitFlags3["NoHoisting"] = 2097152] = "NoHoisting"; 3607 EmitFlags3[EmitFlags3["HasEndOfDeclarationMarker"] = 4194304] = "HasEndOfDeclarationMarker"; 3608 EmitFlags3[EmitFlags3["Iterator"] = 8388608] = "Iterator"; 3609 EmitFlags3[EmitFlags3["NoAsciiEscaping"] = 16777216] = "NoAsciiEscaping"; 3610 EmitFlags3[EmitFlags3["TypeScriptClassWrapper"] = 33554432] = "TypeScriptClassWrapper"; 3611 EmitFlags3[EmitFlags3["NeverApplyImportHelper"] = 67108864] = "NeverApplyImportHelper"; 3612 EmitFlags3[EmitFlags3["IgnoreSourceNewlines"] = 134217728] = "IgnoreSourceNewlines"; 3613 EmitFlags3[EmitFlags3["Immutable"] = 268435456] = "Immutable"; 3614 EmitFlags3[EmitFlags3["IndirectCall"] = 536870912] = "IndirectCall"; 3615 return EmitFlags3; 3616})(EmitFlags || {}); 3617var commentPragmas = { 3618 "reference": { 3619 args: [ 3620 { name: "types", optional: true, captureSpan: true }, 3621 { name: "lib", optional: true, captureSpan: true }, 3622 { name: "path", optional: true, captureSpan: true }, 3623 { name: "no-default-lib", optional: true }, 3624 { name: "resolution-mode", optional: true } 3625 ], 3626 kind: 1 /* TripleSlashXML */ 3627 }, 3628 "amd-dependency": { 3629 args: [{ name: "path" }, { name: "name", optional: true }], 3630 kind: 1 /* TripleSlashXML */ 3631 }, 3632 "amd-module": { 3633 args: [{ name: "name" }], 3634 kind: 1 /* TripleSlashXML */ 3635 }, 3636 "ts-check": { 3637 kind: 2 /* SingleLine */ 3638 }, 3639 "ts-nocheck": { 3640 kind: 2 /* SingleLine */ 3641 }, 3642 "jsx": { 3643 args: [{ name: "factory" }], 3644 kind: 4 /* MultiLine */ 3645 }, 3646 "jsxfrag": { 3647 args: [{ name: "factory" }], 3648 kind: 4 /* MultiLine */ 3649 }, 3650 "jsximportsource": { 3651 args: [{ name: "factory" }], 3652 kind: 4 /* MultiLine */ 3653 }, 3654 "jsxruntime": { 3655 args: [{ name: "factory" }], 3656 kind: 4 /* MultiLine */ 3657 } 3658}; 3659 3660// src/compiler/sys.ts 3661function generateDjb2Hash(data) { 3662 let acc = 5381; 3663 for (let i = 0; i < data.length; i++) { 3664 acc = (acc << 5) + acc + data.charCodeAt(i); 3665 } 3666 return acc.toString(); 3667} 3668var PollingInterval = /* @__PURE__ */ ((PollingInterval3) => { 3669 PollingInterval3[PollingInterval3["High"] = 2e3] = "High"; 3670 PollingInterval3[PollingInterval3["Medium"] = 500] = "Medium"; 3671 PollingInterval3[PollingInterval3["Low"] = 250] = "Low"; 3672 return PollingInterval3; 3673})(PollingInterval || {}); 3674var missingFileModifiedTime = new Date(0); 3675function getModifiedTime(host, fileName) { 3676 return host.getModifiedTime(fileName) || missingFileModifiedTime; 3677} 3678function createPollingIntervalBasedLevels(levels) { 3679 return { 3680 [250 /* Low */]: levels.Low, 3681 [500 /* Medium */]: levels.Medium, 3682 [2e3 /* High */]: levels.High 3683 }; 3684} 3685var defaultChunkLevels = { Low: 32, Medium: 64, High: 256 }; 3686var pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels); 3687var unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels); 3688function setCustomPollingValues(system) { 3689 if (!system.getEnvironmentVariable) { 3690 return; 3691 } 3692 const pollingIntervalChanged = setCustomLevels("TSC_WATCH_POLLINGINTERVAL", PollingInterval); 3693 pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize; 3694 unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || unchangedPollThresholds; 3695 function getLevel(envVar, level) { 3696 return system.getEnvironmentVariable(`${envVar}_${level.toUpperCase()}`); 3697 } 3698 function getCustomLevels(baseVariable) { 3699 let customLevels; 3700 setCustomLevel("Low"); 3701 setCustomLevel("Medium"); 3702 setCustomLevel("High"); 3703 return customLevels; 3704 function setCustomLevel(level) { 3705 const customLevel = getLevel(baseVariable, level); 3706 if (customLevel) { 3707 (customLevels || (customLevels = {}))[level] = Number(customLevel); 3708 } 3709 } 3710 } 3711 function setCustomLevels(baseVariable, levels) { 3712 const customLevels = getCustomLevels(baseVariable); 3713 if (customLevels) { 3714 setLevel("Low"); 3715 setLevel("Medium"); 3716 setLevel("High"); 3717 return true; 3718 } 3719 return false; 3720 function setLevel(level) { 3721 levels[level] = customLevels[level] || levels[level]; 3722 } 3723 } 3724 function getCustomPollingBasedLevels(baseVariable, defaultLevels) { 3725 const customLevels = getCustomLevels(baseVariable); 3726 return (pollingIntervalChanged || customLevels) && createPollingIntervalBasedLevels(customLevels ? { ...defaultLevels, ...customLevels } : defaultLevels); 3727 } 3728} 3729function pollWatchedFileQueue(host, queue, pollIndex, chunkSize, callbackOnWatchFileStat) { 3730 let definedValueCopyToIndex = pollIndex; 3731 for (let canVisit = queue.length; chunkSize && canVisit; nextPollIndex(), canVisit--) { 3732 const watchedFile = queue[pollIndex]; 3733 if (!watchedFile) { 3734 continue; 3735 } else if (watchedFile.isClosed) { 3736 queue[pollIndex] = void 0; 3737 continue; 3738 } 3739 chunkSize--; 3740 const fileChanged = onWatchedFileStat(watchedFile, getModifiedTime(host, watchedFile.fileName)); 3741 if (watchedFile.isClosed) { 3742 queue[pollIndex] = void 0; 3743 continue; 3744 } 3745 callbackOnWatchFileStat == null ? void 0 : callbackOnWatchFileStat(watchedFile, pollIndex, fileChanged); 3746 if (queue[pollIndex]) { 3747 if (definedValueCopyToIndex < pollIndex) { 3748 queue[definedValueCopyToIndex] = watchedFile; 3749 queue[pollIndex] = void 0; 3750 } 3751 definedValueCopyToIndex++; 3752 } 3753 } 3754 return pollIndex; 3755 function nextPollIndex() { 3756 pollIndex++; 3757 if (pollIndex === queue.length) { 3758 if (definedValueCopyToIndex < pollIndex) { 3759 queue.length = definedValueCopyToIndex; 3760 } 3761 pollIndex = 0; 3762 definedValueCopyToIndex = 0; 3763 } 3764 } 3765} 3766function createDynamicPriorityPollingWatchFile(host) { 3767 const watchedFiles = []; 3768 const changedFilesInLastPoll = []; 3769 const lowPollingIntervalQueue = createPollingIntervalQueue(250 /* Low */); 3770 const mediumPollingIntervalQueue = createPollingIntervalQueue(500 /* Medium */); 3771 const highPollingIntervalQueue = createPollingIntervalQueue(2e3 /* High */); 3772 return watchFile; 3773 function watchFile(fileName, callback, defaultPollingInterval) { 3774 const file = { 3775 fileName, 3776 callback, 3777 unchangedPolls: 0, 3778 mtime: getModifiedTime(host, fileName) 3779 }; 3780 watchedFiles.push(file); 3781 addToPollingIntervalQueue(file, defaultPollingInterval); 3782 return { 3783 close: () => { 3784 file.isClosed = true; 3785 unorderedRemoveItem(watchedFiles, file); 3786 } 3787 }; 3788 } 3789 function createPollingIntervalQueue(pollingInterval) { 3790 const queue = []; 3791 queue.pollingInterval = pollingInterval; 3792 queue.pollIndex = 0; 3793 queue.pollScheduled = false; 3794 return queue; 3795 } 3796 function pollPollingIntervalQueue(queue) { 3797 queue.pollIndex = pollQueue(queue, queue.pollingInterval, queue.pollIndex, pollingChunkSize[queue.pollingInterval]); 3798 if (queue.length) { 3799 scheduleNextPoll(queue.pollingInterval); 3800 } else { 3801 Debug.assert(queue.pollIndex === 0); 3802 queue.pollScheduled = false; 3803 } 3804 } 3805 function pollLowPollingIntervalQueue(queue) { 3806 pollQueue(changedFilesInLastPoll, 250 /* Low */, 0, changedFilesInLastPoll.length); 3807 pollPollingIntervalQueue(queue); 3808 if (!queue.pollScheduled && changedFilesInLastPoll.length) { 3809 scheduleNextPoll(250 /* Low */); 3810 } 3811 } 3812 function pollQueue(queue, pollingInterval, pollIndex, chunkSize) { 3813 return pollWatchedFileQueue( 3814 host, 3815 queue, 3816 pollIndex, 3817 chunkSize, 3818 onWatchFileStat 3819 ); 3820 function onWatchFileStat(watchedFile, pollIndex2, fileChanged) { 3821 if (fileChanged) { 3822 watchedFile.unchangedPolls = 0; 3823 if (queue !== changedFilesInLastPoll) { 3824 queue[pollIndex2] = void 0; 3825 addChangedFileToLowPollingIntervalQueue(watchedFile); 3826 } 3827 } else if (watchedFile.unchangedPolls !== unchangedPollThresholds[pollingInterval]) { 3828 watchedFile.unchangedPolls++; 3829 } else if (queue === changedFilesInLastPoll) { 3830 watchedFile.unchangedPolls = 1; 3831 queue[pollIndex2] = void 0; 3832 addToPollingIntervalQueue(watchedFile, 250 /* Low */); 3833 } else if (pollingInterval !== 2e3 /* High */) { 3834 watchedFile.unchangedPolls++; 3835 queue[pollIndex2] = void 0; 3836 addToPollingIntervalQueue(watchedFile, pollingInterval === 250 /* Low */ ? 500 /* Medium */ : 2e3 /* High */); 3837 } 3838 } 3839 } 3840 function pollingIntervalQueue(pollingInterval) { 3841 switch (pollingInterval) { 3842 case 250 /* Low */: 3843 return lowPollingIntervalQueue; 3844 case 500 /* Medium */: 3845 return mediumPollingIntervalQueue; 3846 case 2e3 /* High */: 3847 return highPollingIntervalQueue; 3848 } 3849 } 3850 function addToPollingIntervalQueue(file, pollingInterval) { 3851 pollingIntervalQueue(pollingInterval).push(file); 3852 scheduleNextPollIfNotAlreadyScheduled(pollingInterval); 3853 } 3854 function addChangedFileToLowPollingIntervalQueue(file) { 3855 changedFilesInLastPoll.push(file); 3856 scheduleNextPollIfNotAlreadyScheduled(250 /* Low */); 3857 } 3858 function scheduleNextPollIfNotAlreadyScheduled(pollingInterval) { 3859 if (!pollingIntervalQueue(pollingInterval).pollScheduled) { 3860 scheduleNextPoll(pollingInterval); 3861 } 3862 } 3863 function scheduleNextPoll(pollingInterval) { 3864 pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === 250 /* Low */ ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingIntervalQueue(pollingInterval)); 3865 } 3866} 3867function createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames) { 3868 const fileWatcherCallbacks = createMultiMap(); 3869 const dirWatchers = new Map2(); 3870 const toCanonicalName = createGetCanonicalFileName(useCaseSensitiveFileNames); 3871 return nonPollingWatchFile; 3872 function nonPollingWatchFile(fileName, callback, _pollingInterval, fallbackOptions) { 3873 const filePath = toCanonicalName(fileName); 3874 fileWatcherCallbacks.add(filePath, callback); 3875 const dirPath = getDirectoryPath(filePath) || "."; 3876 const watcher = dirWatchers.get(dirPath) || createDirectoryWatcher(getDirectoryPath(fileName) || ".", dirPath, fallbackOptions); 3877 watcher.referenceCount++; 3878 return { 3879 close: () => { 3880 if (watcher.referenceCount === 1) { 3881 watcher.close(); 3882 dirWatchers.delete(dirPath); 3883 } else { 3884 watcher.referenceCount--; 3885 } 3886 fileWatcherCallbacks.remove(filePath, callback); 3887 } 3888 }; 3889 } 3890 function createDirectoryWatcher(dirName, dirPath, fallbackOptions) { 3891 const watcher = fsWatch( 3892 dirName, 3893 FileSystemEntryKind.Directory, 3894 (_eventName, relativeFileName, modifiedTime) => { 3895 if (!isString(relativeFileName)) 3896 return; 3897 const fileName = getNormalizedAbsolutePath(relativeFileName, dirName); 3898 const callbacks = fileName && fileWatcherCallbacks.get(toCanonicalName(fileName)); 3899 if (callbacks) { 3900 for (const fileCallback of callbacks) { 3901 fileCallback(fileName, 1 /* Changed */, modifiedTime); 3902 } 3903 } 3904 }, 3905 false, 3906 500 /* Medium */, 3907 fallbackOptions 3908 ); 3909 watcher.referenceCount = 0; 3910 dirWatchers.set(dirPath, watcher); 3911 return watcher; 3912 } 3913} 3914function createFixedChunkSizePollingWatchFile(host) { 3915 const watchedFiles = []; 3916 let pollIndex = 0; 3917 let pollScheduled; 3918 return watchFile; 3919 function watchFile(fileName, callback) { 3920 const file = { 3921 fileName, 3922 callback, 3923 mtime: getModifiedTime(host, fileName) 3924 }; 3925 watchedFiles.push(file); 3926 scheduleNextPoll(); 3927 return { 3928 close: () => { 3929 file.isClosed = true; 3930 unorderedRemoveItem(watchedFiles, file); 3931 } 3932 }; 3933 } 3934 function pollQueue() { 3935 pollScheduled = void 0; 3936 pollIndex = pollWatchedFileQueue(host, watchedFiles, pollIndex, pollingChunkSize[250 /* Low */]); 3937 scheduleNextPoll(); 3938 } 3939 function scheduleNextPoll() { 3940 if (!watchedFiles.length || pollScheduled) 3941 return; 3942 pollScheduled = host.setTimeout(pollQueue, 2e3 /* High */); 3943 } 3944} 3945function createSingleWatcherPerName(cache, useCaseSensitiveFileNames, name, callback, createWatcher) { 3946 const toCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); 3947 const path2 = toCanonicalFileName(name); 3948 const existing = cache.get(path2); 3949 if (existing) { 3950 existing.callbacks.push(callback); 3951 } else { 3952 cache.set(path2, { 3953 watcher: createWatcher((param1, param2, param3) => { 3954 var _a2; 3955 return (_a2 = cache.get(path2)) == null ? void 0 : _a2.callbacks.slice().forEach((cb) => cb(param1, param2, param3)); 3956 }), 3957 callbacks: [callback] 3958 }); 3959 } 3960 return { 3961 close: () => { 3962 const watcher = cache.get(path2); 3963 if (!watcher) 3964 return; 3965 if (!orderedRemoveItem(watcher.callbacks, callback) || watcher.callbacks.length) 3966 return; 3967 cache.delete(path2); 3968 closeFileWatcherOf(watcher); 3969 } 3970 }; 3971} 3972function onWatchedFileStat(watchedFile, modifiedTime) { 3973 const oldTime = watchedFile.mtime.getTime(); 3974 const newTime = modifiedTime.getTime(); 3975 if (oldTime !== newTime) { 3976 watchedFile.mtime = modifiedTime; 3977 watchedFile.callback(watchedFile.fileName, getFileWatcherEventKind(oldTime, newTime), modifiedTime); 3978 return true; 3979 } 3980 return false; 3981} 3982function getFileWatcherEventKind(oldTime, newTime) { 3983 return oldTime === 0 ? 0 /* Created */ : newTime === 0 ? 2 /* Deleted */ : 1 /* Changed */; 3984} 3985var ignoredPaths = ["/node_modules/.", "/oh_modules/.", "/.git", "/.#"]; 3986var curSysLog = noop; 3987function sysLog(s) { 3988 return curSysLog(s); 3989} 3990function setSysLog(logger) { 3991 curSysLog = logger; 3992} 3993function createDirectoryWatcherSupportingRecursive({ 3994 watchDirectory, 3995 useCaseSensitiveFileNames, 3996 getCurrentDirectory, 3997 getAccessibleSortedChildDirectories, 3998 fileSystemEntryExists, 3999 realpath, 4000 setTimeout: setTimeout2, 4001 clearTimeout: clearTimeout2 4002}) { 4003 const cache = new Map2(); 4004 const callbackCache = createMultiMap(); 4005 const cacheToUpdateChildWatches = new Map2(); 4006 let timerToUpdateChildWatches; 4007 const filePathComparer = getStringComparer(!useCaseSensitiveFileNames); 4008 const toCanonicalFilePath = createGetCanonicalFileName(useCaseSensitiveFileNames); 4009 return (dirName, callback, recursive, options) => recursive ? createDirectoryWatcher(dirName, options, callback) : watchDirectory(dirName, callback, recursive, options); 4010 function createDirectoryWatcher(dirName, options, callback) { 4011 const dirPath = toCanonicalFilePath(dirName); 4012 let directoryWatcher = cache.get(dirPath); 4013 if (directoryWatcher) { 4014 directoryWatcher.refCount++; 4015 } else { 4016 directoryWatcher = { 4017 watcher: watchDirectory(dirName, (fileName) => { 4018 if (isIgnoredPath(fileName, options)) 4019 return; 4020 if (options == null ? void 0 : options.synchronousWatchDirectory) { 4021 invokeCallbacks(dirPath, fileName); 4022 updateChildWatches(dirName, dirPath, options); 4023 } else { 4024 nonSyncUpdateChildWatches(dirName, dirPath, fileName, options); 4025 } 4026 }, false, options), 4027 refCount: 1, 4028 childWatches: emptyArray 4029 }; 4030 cache.set(dirPath, directoryWatcher); 4031 updateChildWatches(dirName, dirPath, options); 4032 } 4033 const callbackToAdd = callback && { dirName, callback }; 4034 if (callbackToAdd) { 4035 callbackCache.add(dirPath, callbackToAdd); 4036 } 4037 return { 4038 dirName, 4039 close: () => { 4040 const directoryWatcher2 = Debug.checkDefined(cache.get(dirPath)); 4041 if (callbackToAdd) 4042 callbackCache.remove(dirPath, callbackToAdd); 4043 directoryWatcher2.refCount--; 4044 if (directoryWatcher2.refCount) 4045 return; 4046 cache.delete(dirPath); 4047 closeFileWatcherOf(directoryWatcher2); 4048 directoryWatcher2.childWatches.forEach(closeFileWatcher); 4049 } 4050 }; 4051 } 4052 function invokeCallbacks(dirPath, fileNameOrInvokeMap, fileNames) { 4053 let fileName; 4054 let invokeMap; 4055 if (isString(fileNameOrInvokeMap)) { 4056 fileName = fileNameOrInvokeMap; 4057 } else { 4058 invokeMap = fileNameOrInvokeMap; 4059 } 4060 callbackCache.forEach((callbacks, rootDirName) => { 4061 if (invokeMap && invokeMap.get(rootDirName) === true) 4062 return; 4063 if (rootDirName === dirPath || startsWith(dirPath, rootDirName) && dirPath[rootDirName.length] === directorySeparator) { 4064 if (invokeMap) { 4065 if (fileNames) { 4066 const existing = invokeMap.get(rootDirName); 4067 if (existing) { 4068 existing.push(...fileNames); 4069 } else { 4070 invokeMap.set(rootDirName, fileNames.slice()); 4071 } 4072 } else { 4073 invokeMap.set(rootDirName, true); 4074 } 4075 } else { 4076 callbacks.forEach(({ callback }) => callback(fileName)); 4077 } 4078 } 4079 }); 4080 } 4081 function nonSyncUpdateChildWatches(dirName, dirPath, fileName, options) { 4082 const parentWatcher = cache.get(dirPath); 4083 if (parentWatcher && fileSystemEntryExists(dirName, FileSystemEntryKind.Directory)) { 4084 scheduleUpdateChildWatches(dirName, dirPath, fileName, options); 4085 return; 4086 } 4087 invokeCallbacks(dirPath, fileName); 4088 removeChildWatches(parentWatcher); 4089 } 4090 function scheduleUpdateChildWatches(dirName, dirPath, fileName, options) { 4091 const existing = cacheToUpdateChildWatches.get(dirPath); 4092 if (existing) { 4093 existing.fileNames.push(fileName); 4094 } else { 4095 cacheToUpdateChildWatches.set(dirPath, { dirName, options, fileNames: [fileName] }); 4096 } 4097 if (timerToUpdateChildWatches) { 4098 clearTimeout2(timerToUpdateChildWatches); 4099 timerToUpdateChildWatches = void 0; 4100 } 4101 timerToUpdateChildWatches = setTimeout2(onTimerToUpdateChildWatches, 1e3); 4102 } 4103 function onTimerToUpdateChildWatches() { 4104 timerToUpdateChildWatches = void 0; 4105 sysLog(`sysLog:: onTimerToUpdateChildWatches:: ${cacheToUpdateChildWatches.size}`); 4106 const start = timestamp(); 4107 const invokeMap = new Map2(); 4108 while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) { 4109 const result = cacheToUpdateChildWatches.entries().next(); 4110 Debug.assert(!result.done); 4111 const { value: [dirPath, { dirName, options, fileNames }] } = result; 4112 cacheToUpdateChildWatches.delete(dirPath); 4113 const hasChanges = updateChildWatches(dirName, dirPath, options); 4114 invokeCallbacks(dirPath, invokeMap, hasChanges ? void 0 : fileNames); 4115 } 4116 sysLog(`sysLog:: invokingWatchers:: Elapsed:: ${timestamp() - start}ms:: ${cacheToUpdateChildWatches.size}`); 4117 callbackCache.forEach((callbacks, rootDirName) => { 4118 const existing = invokeMap.get(rootDirName); 4119 if (existing) { 4120 callbacks.forEach(({ callback, dirName }) => { 4121 if (isArray(existing)) { 4122 existing.forEach(callback); 4123 } else { 4124 callback(dirName); 4125 } 4126 }); 4127 } 4128 }); 4129 const elapsed = timestamp() - start; 4130 sysLog(`sysLog:: Elapsed:: ${elapsed}ms:: onTimerToUpdateChildWatches:: ${cacheToUpdateChildWatches.size} ${timerToUpdateChildWatches}`); 4131 } 4132 function removeChildWatches(parentWatcher) { 4133 if (!parentWatcher) 4134 return; 4135 const existingChildWatches = parentWatcher.childWatches; 4136 parentWatcher.childWatches = emptyArray; 4137 for (const childWatcher of existingChildWatches) { 4138 childWatcher.close(); 4139 removeChildWatches(cache.get(toCanonicalFilePath(childWatcher.dirName))); 4140 } 4141 } 4142 function updateChildWatches(parentDir, parentDirPath, options) { 4143 const parentWatcher = cache.get(parentDirPath); 4144 if (!parentWatcher) 4145 return false; 4146 let newChildWatches; 4147 const hasChanges = enumerateInsertsAndDeletes( 4148 fileSystemEntryExists(parentDir, FileSystemEntryKind.Directory) ? mapDefined(getAccessibleSortedChildDirectories(parentDir), (child) => { 4149 const childFullName = getNormalizedAbsolutePath(child, parentDir); 4150 return !isIgnoredPath(childFullName, options) && filePathComparer(childFullName, normalizePath(realpath(childFullName))) === 0 /* EqualTo */ ? childFullName : void 0; 4151 }) : emptyArray, 4152 parentWatcher.childWatches, 4153 (child, childWatcher) => filePathComparer(child, childWatcher.dirName), 4154 createAndAddChildDirectoryWatcher, 4155 closeFileWatcher, 4156 addChildDirectoryWatcher 4157 ); 4158 parentWatcher.childWatches = newChildWatches || emptyArray; 4159 return hasChanges; 4160 function createAndAddChildDirectoryWatcher(childName) { 4161 const result = createDirectoryWatcher(childName, options); 4162 addChildDirectoryWatcher(result); 4163 } 4164 function addChildDirectoryWatcher(childWatcher) { 4165 (newChildWatches || (newChildWatches = [])).push(childWatcher); 4166 } 4167 } 4168 function isIgnoredPath(path2, options) { 4169 return some(ignoredPaths, (searchPath) => isInPath(path2, searchPath)) || isIgnoredByWatchOptions(path2, options, useCaseSensitiveFileNames, getCurrentDirectory); 4170 } 4171 function isInPath(path2, searchPath) { 4172 if (stringContains(path2, searchPath)) 4173 return true; 4174 if (useCaseSensitiveFileNames) 4175 return false; 4176 return stringContains(toCanonicalFilePath(path2), searchPath); 4177 } 4178} 4179var FileSystemEntryKind = /* @__PURE__ */ ((FileSystemEntryKind2) => { 4180 FileSystemEntryKind2[FileSystemEntryKind2["File"] = 0] = "File"; 4181 FileSystemEntryKind2[FileSystemEntryKind2["Directory"] = 1] = "Directory"; 4182 return FileSystemEntryKind2; 4183})(FileSystemEntryKind || {}); 4184function createFileWatcherCallback(callback) { 4185 return (_fileName, eventKind, modifiedTime) => callback(eventKind === 1 /* Changed */ ? "change" : "rename", "", modifiedTime); 4186} 4187function createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime2) { 4188 return (eventName, _relativeFileName, modifiedTime) => { 4189 if (eventName === "rename") { 4190 modifiedTime || (modifiedTime = getModifiedTime2(fileName) || missingFileModifiedTime); 4191 callback(fileName, modifiedTime !== missingFileModifiedTime ? 0 /* Created */ : 2 /* Deleted */, modifiedTime); 4192 } else { 4193 callback(fileName, 1 /* Changed */, modifiedTime); 4194 } 4195 }; 4196} 4197function isIgnoredByWatchOptions(pathToCheck, options, useCaseSensitiveFileNames, getCurrentDirectory) { 4198 return ((options == null ? void 0 : options.excludeDirectories) || (options == null ? void 0 : options.excludeFiles)) && (matchesExclude(pathToCheck, options == null ? void 0 : options.excludeFiles, useCaseSensitiveFileNames, getCurrentDirectory()) || matchesExclude(pathToCheck, options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames, getCurrentDirectory())); 4199} 4200function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory) { 4201 return (eventName, relativeFileName) => { 4202 if (eventName === "rename") { 4203 const fileName = !relativeFileName ? directoryName : normalizePath(combinePaths(directoryName, relativeFileName)); 4204 if (!relativeFileName || !isIgnoredByWatchOptions(fileName, options, useCaseSensitiveFileNames, getCurrentDirectory)) { 4205 callback(fileName); 4206 } 4207 } 4208 }; 4209} 4210function createSystemWatchFunctions({ 4211 pollingWatchFileWorker, 4212 getModifiedTime: getModifiedTime2, 4213 setTimeout: setTimeout2, 4214 clearTimeout: clearTimeout2, 4215 fsWatchWorker, 4216 fileSystemEntryExists, 4217 useCaseSensitiveFileNames, 4218 getCurrentDirectory, 4219 fsSupportsRecursiveFsWatch, 4220 getAccessibleSortedChildDirectories, 4221 realpath, 4222 tscWatchFile, 4223 useNonPollingWatchers, 4224 tscWatchDirectory, 4225 inodeWatching, 4226 sysLog: sysLog2 4227}) { 4228 const pollingWatches = new Map2(); 4229 const fsWatches = new Map2(); 4230 const fsWatchesRecursive = new Map2(); 4231 let dynamicPollingWatchFile; 4232 let fixedChunkSizePollingWatchFile; 4233 let nonPollingWatchFile; 4234 let hostRecursiveDirectoryWatcher; 4235 let hitSystemWatcherLimit = false; 4236 return { 4237 watchFile, 4238 watchDirectory 4239 }; 4240 function watchFile(fileName, callback, pollingInterval, options) { 4241 options = updateOptionsForWatchFile(options, useNonPollingWatchers); 4242 const watchFileKind = Debug.checkDefined(options.watchFile); 4243 switch (watchFileKind) { 4244 case 0 /* FixedPollingInterval */: 4245 return pollingWatchFile(fileName, callback, 250 /* Low */, void 0); 4246 case 1 /* PriorityPollingInterval */: 4247 return pollingWatchFile(fileName, callback, pollingInterval, void 0); 4248 case 2 /* DynamicPriorityPolling */: 4249 return ensureDynamicPollingWatchFile()(fileName, callback, pollingInterval, void 0); 4250 case 3 /* FixedChunkSizePolling */: 4251 return ensureFixedChunkSizePollingWatchFile()(fileName, callback, void 0, void 0); 4252 case 4 /* UseFsEvents */: 4253 return fsWatch( 4254 fileName, 4255 0 /* File */, 4256 createFsWatchCallbackForFileWatcherCallback(fileName, callback, getModifiedTime2), 4257 false, 4258 pollingInterval, 4259 getFallbackOptions(options) 4260 ); 4261 case 5 /* UseFsEventsOnParentDirectory */: 4262 if (!nonPollingWatchFile) { 4263 nonPollingWatchFile = createUseFsEventsOnParentDirectoryWatchFile(fsWatch, useCaseSensitiveFileNames); 4264 } 4265 return nonPollingWatchFile(fileName, callback, pollingInterval, getFallbackOptions(options)); 4266 default: 4267 Debug.assertNever(watchFileKind); 4268 } 4269 } 4270 function ensureDynamicPollingWatchFile() { 4271 return dynamicPollingWatchFile || (dynamicPollingWatchFile = createDynamicPriorityPollingWatchFile({ getModifiedTime: getModifiedTime2, setTimeout: setTimeout2 })); 4272 } 4273 function ensureFixedChunkSizePollingWatchFile() { 4274 return fixedChunkSizePollingWatchFile || (fixedChunkSizePollingWatchFile = createFixedChunkSizePollingWatchFile({ getModifiedTime: getModifiedTime2, setTimeout: setTimeout2 })); 4275 } 4276 function updateOptionsForWatchFile(options, useNonPollingWatchers2) { 4277 if (options && options.watchFile !== void 0) 4278 return options; 4279 switch (tscWatchFile) { 4280 case "PriorityPollingInterval": 4281 return { watchFile: 1 /* PriorityPollingInterval */ }; 4282 case "DynamicPriorityPolling": 4283 return { watchFile: 2 /* DynamicPriorityPolling */ }; 4284 case "UseFsEvents": 4285 return generateWatchFileOptions(4 /* UseFsEvents */, 1 /* PriorityInterval */, options); 4286 case "UseFsEventsWithFallbackDynamicPolling": 4287 return generateWatchFileOptions(4 /* UseFsEvents */, 2 /* DynamicPriority */, options); 4288 case "UseFsEventsOnParentDirectory": 4289 useNonPollingWatchers2 = true; 4290 default: 4291 return useNonPollingWatchers2 ? generateWatchFileOptions(5 /* UseFsEventsOnParentDirectory */, 1 /* PriorityInterval */, options) : { watchFile: 4 /* UseFsEvents */ }; 4292 } 4293 } 4294 function generateWatchFileOptions(watchFile2, fallbackPolling, options) { 4295 const defaultFallbackPolling = options == null ? void 0 : options.fallbackPolling; 4296 return { 4297 watchFile: watchFile2, 4298 fallbackPolling: defaultFallbackPolling === void 0 ? fallbackPolling : defaultFallbackPolling 4299 }; 4300 } 4301 function watchDirectory(directoryName, callback, recursive, options) { 4302 if (fsSupportsRecursiveFsWatch) { 4303 return fsWatch( 4304 directoryName, 4305 1 /* Directory */, 4306 createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory), 4307 recursive, 4308 500 /* Medium */, 4309 getFallbackOptions(options) 4310 ); 4311 } 4312 if (!hostRecursiveDirectoryWatcher) { 4313 hostRecursiveDirectoryWatcher = createDirectoryWatcherSupportingRecursive({ 4314 useCaseSensitiveFileNames, 4315 getCurrentDirectory, 4316 fileSystemEntryExists, 4317 getAccessibleSortedChildDirectories, 4318 watchDirectory: nonRecursiveWatchDirectory, 4319 realpath, 4320 setTimeout: setTimeout2, 4321 clearTimeout: clearTimeout2 4322 }); 4323 } 4324 return hostRecursiveDirectoryWatcher(directoryName, callback, recursive, options); 4325 } 4326 function nonRecursiveWatchDirectory(directoryName, callback, recursive, options) { 4327 Debug.assert(!recursive); 4328 const watchDirectoryOptions = updateOptionsForWatchDirectory(options); 4329 const watchDirectoryKind = Debug.checkDefined(watchDirectoryOptions.watchDirectory); 4330 switch (watchDirectoryKind) { 4331 case 1 /* FixedPollingInterval */: 4332 return pollingWatchFile( 4333 directoryName, 4334 () => callback(directoryName), 4335 500 /* Medium */, 4336 void 0 4337 ); 4338 case 2 /* DynamicPriorityPolling */: 4339 return ensureDynamicPollingWatchFile()( 4340 directoryName, 4341 () => callback(directoryName), 4342 500 /* Medium */, 4343 void 0 4344 ); 4345 case 3 /* FixedChunkSizePolling */: 4346 return ensureFixedChunkSizePollingWatchFile()( 4347 directoryName, 4348 () => callback(directoryName), 4349 void 0, 4350 void 0 4351 ); 4352 case 0 /* UseFsEvents */: 4353 return fsWatch( 4354 directoryName, 4355 1 /* Directory */, 4356 createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback, options, useCaseSensitiveFileNames, getCurrentDirectory), 4357 recursive, 4358 500 /* Medium */, 4359 getFallbackOptions(watchDirectoryOptions) 4360 ); 4361 default: 4362 Debug.assertNever(watchDirectoryKind); 4363 } 4364 } 4365 function updateOptionsForWatchDirectory(options) { 4366 if (options && options.watchDirectory !== void 0) 4367 return options; 4368 switch (tscWatchDirectory) { 4369 case "RecursiveDirectoryUsingFsWatchFile": 4370 return { watchDirectory: 1 /* FixedPollingInterval */ }; 4371 case "RecursiveDirectoryUsingDynamicPriorityPolling": 4372 return { watchDirectory: 2 /* DynamicPriorityPolling */ }; 4373 default: 4374 const defaultFallbackPolling = options == null ? void 0 : options.fallbackPolling; 4375 return { 4376 watchDirectory: 0 /* UseFsEvents */, 4377 fallbackPolling: defaultFallbackPolling !== void 0 ? defaultFallbackPolling : void 0 4378 }; 4379 } 4380 } 4381 function pollingWatchFile(fileName, callback, pollingInterval, options) { 4382 return createSingleWatcherPerName( 4383 pollingWatches, 4384 useCaseSensitiveFileNames, 4385 fileName, 4386 callback, 4387 (cb) => pollingWatchFileWorker(fileName, cb, pollingInterval, options) 4388 ); 4389 } 4390 function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) { 4391 return createSingleWatcherPerName( 4392 recursive ? fsWatchesRecursive : fsWatches, 4393 useCaseSensitiveFileNames, 4394 fileOrDirectory, 4395 callback, 4396 (cb) => fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, cb, recursive, fallbackPollingInterval, fallbackOptions) 4397 ); 4398 } 4399 function fsWatchHandlingExistenceOnHost(fileOrDirectory, entryKind, callback, recursive, fallbackPollingInterval, fallbackOptions) { 4400 let lastDirectoryPartWithDirectorySeparator; 4401 let lastDirectoryPart; 4402 if (inodeWatching) { 4403 lastDirectoryPartWithDirectorySeparator = fileOrDirectory.substring(fileOrDirectory.lastIndexOf(directorySeparator)); 4404 lastDirectoryPart = lastDirectoryPartWithDirectorySeparator.slice(directorySeparator.length); 4405 } 4406 let watcher = !fileSystemEntryExists(fileOrDirectory, entryKind) ? watchMissingFileSystemEntry() : watchPresentFileSystemEntry(); 4407 return { 4408 close: () => { 4409 if (watcher) { 4410 watcher.close(); 4411 watcher = void 0; 4412 } 4413 } 4414 }; 4415 function updateWatcher(createWatcher) { 4416 if (watcher) { 4417 sysLog2(`sysLog:: ${fileOrDirectory}:: Changing watcher to ${createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing"}FileSystemEntryWatcher`); 4418 watcher.close(); 4419 watcher = createWatcher(); 4420 } 4421 } 4422 function watchPresentFileSystemEntry() { 4423 if (hitSystemWatcherLimit) { 4424 sysLog2(`sysLog:: ${fileOrDirectory}:: Defaulting to watchFile`); 4425 return watchPresentFileSystemEntryWithFsWatchFile(); 4426 } 4427 try { 4428 const presentWatcher = fsWatchWorker( 4429 fileOrDirectory, 4430 recursive, 4431 inodeWatching ? callbackChangingToMissingFileSystemEntry : callback 4432 ); 4433 presentWatcher.on("error", () => { 4434 callback("rename", ""); 4435 updateWatcher(watchMissingFileSystemEntry); 4436 }); 4437 return presentWatcher; 4438 } catch (e) { 4439 hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC"); 4440 sysLog2(`sysLog:: ${fileOrDirectory}:: Changing to watchFile`); 4441 return watchPresentFileSystemEntryWithFsWatchFile(); 4442 } 4443 } 4444 function callbackChangingToMissingFileSystemEntry(event, relativeName) { 4445 let originalRelativeName; 4446 if (relativeName && endsWith(relativeName, "~")) { 4447 originalRelativeName = relativeName; 4448 relativeName = relativeName.slice(0, relativeName.length - 1); 4449 } 4450 if (event === "rename" && (!relativeName || relativeName === lastDirectoryPart || endsWith(relativeName, lastDirectoryPartWithDirectorySeparator))) { 4451 const modifiedTime = getModifiedTime2(fileOrDirectory) || missingFileModifiedTime; 4452 if (originalRelativeName) 4453 callback(event, originalRelativeName, modifiedTime); 4454 callback(event, relativeName, modifiedTime); 4455 if (inodeWatching) { 4456 updateWatcher(modifiedTime === missingFileModifiedTime ? watchMissingFileSystemEntry : watchPresentFileSystemEntry); 4457 } else if (modifiedTime === missingFileModifiedTime) { 4458 updateWatcher(watchMissingFileSystemEntry); 4459 } 4460 } else { 4461 if (originalRelativeName) 4462 callback(event, originalRelativeName); 4463 callback(event, relativeName); 4464 } 4465 } 4466 function watchPresentFileSystemEntryWithFsWatchFile() { 4467 return watchFile( 4468 fileOrDirectory, 4469 createFileWatcherCallback(callback), 4470 fallbackPollingInterval, 4471 fallbackOptions 4472 ); 4473 } 4474 function watchMissingFileSystemEntry() { 4475 return watchFile( 4476 fileOrDirectory, 4477 (_fileName, eventKind, modifiedTime) => { 4478 if (eventKind === 0 /* Created */) { 4479 modifiedTime || (modifiedTime = getModifiedTime2(fileOrDirectory) || missingFileModifiedTime); 4480 if (modifiedTime !== missingFileModifiedTime) { 4481 callback("rename", "", modifiedTime); 4482 updateWatcher(watchPresentFileSystemEntry); 4483 } 4484 } 4485 }, 4486 fallbackPollingInterval, 4487 fallbackOptions 4488 ); 4489 } 4490 } 4491} 4492function patchWriteFileEnsuringDirectory(sys2) { 4493 const originalWriteFile = sys2.writeFile; 4494 sys2.writeFile = (path2, data, writeBom) => writeFileEnsuringDirectories( 4495 path2, 4496 data, 4497 !!writeBom, 4498 (path3, data2, writeByteOrderMark) => originalWriteFile.call(sys2, path3, data2, writeByteOrderMark), 4499 (path3) => sys2.createDirectory(path3), 4500 (path3) => sys2.directoryExists(path3) 4501 ); 4502} 4503function getNodeMajorVersion() { 4504 if (typeof process === "undefined") { 4505 return void 0; 4506 } 4507 const version2 = process.version; 4508 if (!version2) { 4509 return void 0; 4510 } 4511 const dot = version2.indexOf("."); 4512 if (dot === -1) { 4513 return void 0; 4514 } 4515 return parseInt(version2.substring(1, dot)); 4516} 4517var sys = (() => { 4518 const byteOrderMarkIndicator = "\uFEFF"; 4519 function getNodeSystem() { 4520 const nativePattern = /^native |^\([^)]+\)$|^(internal[\\/]|[a-zA-Z0-9_\s]+(\.js)?$)/; 4521 const _fs = require("fs"); 4522 const _path = require("path"); 4523 const _os = require("os"); 4524 let _crypto; 4525 try { 4526 _crypto = require("crypto"); 4527 } catch (e) { 4528 _crypto = void 0; 4529 } 4530 let activeSession; 4531 let profilePath = "./profile.cpuprofile"; 4532 const Buffer2 = require("buffer").Buffer; 4533 const nodeVersion = getNodeMajorVersion(); 4534 const isNode4OrLater = nodeVersion >= 4; 4535 const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin"; 4536 const platform = _os.platform(); 4537 const useCaseSensitiveFileNames = isFileSystemCaseSensitive(); 4538 const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync; 4539 const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename; 4540 const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin"); 4541 const getCurrentDirectory = memoize(() => process.cwd()); 4542 const { watchFile, watchDirectory } = createSystemWatchFunctions({ 4543 pollingWatchFileWorker: fsWatchFileWorker, 4544 getModifiedTime: getModifiedTime2, 4545 setTimeout, 4546 clearTimeout, 4547 fsWatchWorker, 4548 useCaseSensitiveFileNames, 4549 getCurrentDirectory, 4550 fileSystemEntryExists, 4551 fsSupportsRecursiveFsWatch, 4552 getAccessibleSortedChildDirectories: (path2) => getAccessibleFileSystemEntries(path2).directories, 4553 realpath, 4554 tscWatchFile: process.env.TSC_WATCHFILE, 4555 useNonPollingWatchers: process.env.TSC_NONPOLLING_WATCHER, 4556 tscWatchDirectory: process.env.TSC_WATCHDIRECTORY, 4557 inodeWatching: isLinuxOrMacOs, 4558 sysLog 4559 }); 4560 const nodeSystem = { 4561 args: process.argv.slice(2), 4562 newLine: _os.EOL, 4563 useCaseSensitiveFileNames, 4564 write(s) { 4565 process.stdout.write(s); 4566 }, 4567 getWidthOfTerminal() { 4568 return process.stdout.columns; 4569 }, 4570 writeOutputIsTTY() { 4571 return process.stdout.isTTY; 4572 }, 4573 readFile, 4574 writeFile: writeFile2, 4575 watchFile, 4576 watchDirectory, 4577 resolvePath: (path2) => _path.resolve(path2), 4578 fileExists, 4579 directoryExists, 4580 createDirectory(directoryName) { 4581 if (!nodeSystem.directoryExists(directoryName)) { 4582 try { 4583 _fs.mkdirSync(directoryName); 4584 } catch (e) { 4585 if (e.code !== "EEXIST") { 4586 throw e; 4587 } 4588 } 4589 } 4590 }, 4591 getExecutingFilePath() { 4592 return executingFilePath; 4593 }, 4594 getCurrentDirectory, 4595 getDirectories, 4596 getEnvironmentVariable(name) { 4597 return process.env[name] || ""; 4598 }, 4599 readDirectory, 4600 getModifiedTime: getModifiedTime2, 4601 setModifiedTime, 4602 deleteFile, 4603 createHash: _crypto ? createSHA256Hash : generateDjb2Hash, 4604 createSHA256Hash: _crypto ? createSHA256Hash : void 0, 4605 getMemoryUsage() { 4606 if (global.gc) { 4607 global.gc(); 4608 } 4609 return process.memoryUsage().heapUsed; 4610 }, 4611 getFileSize(path2) { 4612 try { 4613 const stat = statSync(path2); 4614 if (stat == null ? void 0 : stat.isFile()) { 4615 return stat.size; 4616 } 4617 } catch (e) { 4618 } 4619 return 0; 4620 }, 4621 exit(exitCode) { 4622 disableCPUProfiler(() => process.exit(exitCode)); 4623 }, 4624 enableCPUProfiler, 4625 disableCPUProfiler, 4626 cpuProfilingEnabled: () => !!activeSession || contains(process.execArgv, "--cpu-prof") || contains(process.execArgv, "--prof"), 4627 realpath, 4628 debugMode: !!process.env.NODE_INSPECTOR_IPC || !!process.env.VSCODE_INSPECTOR_OPTIONS || some(process.execArgv, (arg) => /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg)), 4629 tryEnableSourceMapsForHost() { 4630 try { 4631 require("source-map-support").install(); 4632 } catch (e) { 4633 } 4634 }, 4635 setTimeout, 4636 clearTimeout, 4637 clearScreen: () => { 4638 process.stdout.write("\x1Bc"); 4639 }, 4640 setBlocking: () => { 4641 if (process.stdout && process.stdout._handle && process.stdout._handle.setBlocking) { 4642 process.stdout._handle.setBlocking(true); 4643 } 4644 }, 4645 bufferFrom, 4646 base64decode: (input) => bufferFrom(input, "base64").toString("utf8"), 4647 base64encode: (input) => bufferFrom(input).toString("base64"), 4648 require: (baseDir, moduleName) => { 4649 try { 4650 const modulePath = resolveJSModule(moduleName, baseDir, nodeSystem); 4651 return { module: require(modulePath), modulePath, error: void 0 }; 4652 } catch (error) { 4653 return { module: void 0, modulePath: void 0, error }; 4654 } 4655 } 4656 }; 4657 return nodeSystem; 4658 function statSync(path2) { 4659 return _fs.statSync(path2, { throwIfNoEntry: false }); 4660 } 4661 function enableCPUProfiler(path2, cb) { 4662 if (activeSession) { 4663 cb(); 4664 return false; 4665 } 4666 const inspector = require("inspector"); 4667 if (!inspector || !inspector.Session) { 4668 cb(); 4669 return false; 4670 } 4671 const session = new inspector.Session(); 4672 session.connect(); 4673 session.post("Profiler.enable", () => { 4674 session.post("Profiler.start", () => { 4675 activeSession = session; 4676 profilePath = path2; 4677 cb(); 4678 }); 4679 }); 4680 return true; 4681 } 4682 function cleanupPaths(profile) { 4683 let externalFileCounter = 0; 4684 const remappedPaths = new Map2(); 4685 const normalizedDir = normalizeSlashes(_path.dirname(executingFilePath)); 4686 const fileUrlRoot = `file://${getRootLength(normalizedDir) === 1 ? "" : "/"}${normalizedDir}`; 4687 for (const node of profile.nodes) { 4688 if (node.callFrame.url) { 4689 const url = normalizeSlashes(node.callFrame.url); 4690 if (containsPath(fileUrlRoot, url, useCaseSensitiveFileNames)) { 4691 node.callFrame.url = getRelativePathToDirectoryOrUrl(fileUrlRoot, url, fileUrlRoot, createGetCanonicalFileName(useCaseSensitiveFileNames), true); 4692 } else if (!nativePattern.test(url)) { 4693 node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, `external${externalFileCounter}.js`)).get(url); 4694 externalFileCounter++; 4695 } 4696 } 4697 } 4698 return profile; 4699 } 4700 function disableCPUProfiler(cb) { 4701 if (activeSession && activeSession !== "stopping") { 4702 const s = activeSession; 4703 activeSession.post("Profiler.stop", (err, { profile }) => { 4704 var _a2; 4705 if (!err) { 4706 try { 4707 if ((_a2 = statSync(profilePath)) == null ? void 0 : _a2.isDirectory()) { 4708 profilePath = _path.join(profilePath, `${new Date().toISOString().replace(/:/g, "-")}+P${process.pid}.cpuprofile`); 4709 } 4710 } catch (e) { 4711 } 4712 try { 4713 _fs.mkdirSync(_path.dirname(profilePath), { recursive: true }); 4714 } catch (e) { 4715 } 4716 _fs.writeFileSync(profilePath, JSON.stringify(cleanupPaths(profile))); 4717 } 4718 activeSession = void 0; 4719 s.disconnect(); 4720 cb(); 4721 }); 4722 activeSession = "stopping"; 4723 return true; 4724 } else { 4725 cb(); 4726 return false; 4727 } 4728 } 4729 function bufferFrom(input, encoding) { 4730 return Buffer2.from && Buffer2.from !== Int8Array.from ? Buffer2.from(input, encoding) : new Buffer2(input, encoding); 4731 } 4732 function isFileSystemCaseSensitive() { 4733 if (platform === "win32" || platform === "win64") { 4734 return false; 4735 } 4736 return !fileExists(swapCase(__filename)); 4737 } 4738 function swapCase(s) { 4739 return s.replace(/\w/g, (ch) => { 4740 const up = ch.toUpperCase(); 4741 return ch === up ? ch.toLowerCase() : up; 4742 }); 4743 } 4744 function fsWatchFileWorker(fileName, callback, pollingInterval) { 4745 _fs.watchFile(fileName, { persistent: true, interval: pollingInterval }, fileChanged); 4746 let eventKind; 4747 return { 4748 close: () => _fs.unwatchFile(fileName, fileChanged) 4749 }; 4750 function fileChanged(curr, prev) { 4751 const isPreviouslyDeleted = +prev.mtime === 0 || eventKind === 2 /* Deleted */; 4752 if (+curr.mtime === 0) { 4753 if (isPreviouslyDeleted) { 4754 return; 4755 } 4756 eventKind = 2 /* Deleted */; 4757 } else if (isPreviouslyDeleted) { 4758 eventKind = 0 /* Created */; 4759 } else if (+curr.mtime === +prev.mtime) { 4760 return; 4761 } else { 4762 eventKind = 1 /* Changed */; 4763 } 4764 callback(fileName, eventKind, curr.mtime); 4765 } 4766 } 4767 function fsWatchWorker(fileOrDirectory, recursive, callback) { 4768 return _fs.watch( 4769 fileOrDirectory, 4770 fsSupportsRecursiveFsWatch ? { persistent: true, recursive: !!recursive } : { persistent: true }, 4771 callback 4772 ); 4773 } 4774 function readFileWorker(fileName, _encoding) { 4775 let buffer; 4776 try { 4777 buffer = _fs.readFileSync(fileName); 4778 } catch (e) { 4779 return void 0; 4780 } 4781 let len = buffer.length; 4782 if (len >= 2 && buffer[0] === 254 && buffer[1] === 255) { 4783 len &= ~1; 4784 for (let i = 0; i < len; i += 2) { 4785 const temp = buffer[i]; 4786 buffer[i] = buffer[i + 1]; 4787 buffer[i + 1] = temp; 4788 } 4789 return buffer.toString("utf16le", 2); 4790 } 4791 if (len >= 2 && buffer[0] === 255 && buffer[1] === 254) { 4792 return buffer.toString("utf16le", 2); 4793 } 4794 if (len >= 3 && buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191) { 4795 return buffer.toString("utf8", 3); 4796 } 4797 return buffer.toString("utf8"); 4798 } 4799 function readFile(fileName, _encoding) { 4800 perfLogger.logStartReadFile(fileName); 4801 const file = readFileWorker(fileName, _encoding); 4802 perfLogger.logStopReadFile(); 4803 return file; 4804 } 4805 function writeFile2(fileName, data, writeByteOrderMark) { 4806 perfLogger.logEvent("WriteFile: " + fileName); 4807 if (writeByteOrderMark) { 4808 data = byteOrderMarkIndicator + data; 4809 } 4810 let fd; 4811 try { 4812 fd = _fs.openSync(fileName, "w"); 4813 _fs.writeSync(fd, data, void 0, "utf8"); 4814 } finally { 4815 if (fd !== void 0) { 4816 _fs.closeSync(fd); 4817 } 4818 } 4819 } 4820 function getAccessibleFileSystemEntries(path2) { 4821 perfLogger.logEvent("ReadDir: " + (path2 || ".")); 4822 try { 4823 const entries = _fs.readdirSync(path2 || ".", { withFileTypes: true }); 4824 const files = []; 4825 const directories = []; 4826 for (const dirent of entries) { 4827 const entry = typeof dirent === "string" ? dirent : dirent.name; 4828 if (entry === "." || entry === "..") { 4829 continue; 4830 } 4831 let stat; 4832 if (typeof dirent === "string" || dirent.isSymbolicLink()) { 4833 const name = combinePaths(path2, entry); 4834 try { 4835 stat = statSync(name); 4836 if (!stat) { 4837 continue; 4838 } 4839 } catch (e) { 4840 continue; 4841 } 4842 } else { 4843 stat = dirent; 4844 } 4845 if (stat.isFile()) { 4846 files.push(entry); 4847 } else if (stat.isDirectory()) { 4848 directories.push(entry); 4849 } 4850 } 4851 files.sort(); 4852 directories.sort(); 4853 return { files, directories }; 4854 } catch (e) { 4855 return emptyFileSystemEntries; 4856 } 4857 } 4858 function readDirectory(path2, extensions, excludes, includes, depth) { 4859 return matchFiles(path2, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath); 4860 } 4861 function fileSystemEntryExists(path2, entryKind) { 4862 const originalStackTraceLimit = Error.stackTraceLimit; 4863 Error.stackTraceLimit = 0; 4864 try { 4865 const stat = statSync(path2); 4866 if (!stat) { 4867 return false; 4868 } 4869 switch (entryKind) { 4870 case 0 /* File */: 4871 return stat.isFile(); 4872 case 1 /* Directory */: 4873 return stat.isDirectory(); 4874 default: 4875 return false; 4876 } 4877 } catch (e) { 4878 return false; 4879 } finally { 4880 Error.stackTraceLimit = originalStackTraceLimit; 4881 } 4882 } 4883 function fileExists(path2) { 4884 return fileSystemEntryExists(path2, 0 /* File */); 4885 } 4886 function directoryExists(path2) { 4887 return fileSystemEntryExists(path2, 1 /* Directory */); 4888 } 4889 function getDirectories(path2) { 4890 return getAccessibleFileSystemEntries(path2).directories.slice(); 4891 } 4892 function fsRealPathHandlingLongPath(path2) { 4893 return path2.length < 260 ? _fs.realpathSync.native(path2) : _fs.realpathSync(path2); 4894 } 4895 function realpath(path2) { 4896 try { 4897 return fsRealpath(path2); 4898 } catch (e) { 4899 return path2; 4900 } 4901 } 4902 function getModifiedTime2(path2) { 4903 var _a2; 4904 const originalStackTraceLimit = Error.stackTraceLimit; 4905 Error.stackTraceLimit = 0; 4906 try { 4907 return (_a2 = statSync(path2)) == null ? void 0 : _a2.mtime; 4908 } catch (e) { 4909 return void 0; 4910 } finally { 4911 Error.stackTraceLimit = originalStackTraceLimit; 4912 } 4913 } 4914 function setModifiedTime(path2, time) { 4915 try { 4916 _fs.utimesSync(path2, time, time); 4917 } catch (e) { 4918 return; 4919 } 4920 } 4921 function deleteFile(path2) { 4922 try { 4923 return _fs.unlinkSync(path2); 4924 } catch (e) { 4925 return; 4926 } 4927 } 4928 function createSHA256Hash(data) { 4929 const hash = _crypto.createHash("sha256"); 4930 hash.update(data); 4931 return hash.digest("hex"); 4932 } 4933 } 4934 let sys2; 4935 if (isNodeLikeSystem()) { 4936 sys2 = getNodeSystem(); 4937 } 4938 if (sys2) { 4939 patchWriteFileEnsuringDirectory(sys2); 4940 } 4941 return sys2; 4942})(); 4943if (sys && sys.getEnvironmentVariable) { 4944 setCustomPollingValues(sys); 4945 Debug.setAssertionLevel(/^development$/i.test(sys.getEnvironmentVariable("NODE_ENV")) ? 1 /* Normal */ : 0 /* None */); 4946} 4947if (sys && sys.debugMode) { 4948 Debug.isDebugging = true; 4949} 4950 4951// src/compiler/path.ts 4952var directorySeparator = "/"; 4953var altDirectorySeparator = "\\"; 4954var urlSchemeSeparator = "://"; 4955var backslashRegExp = /\\/g; 4956function isAnyDirectorySeparator(charCode) { 4957 return charCode === 47 /* slash */ || charCode === 92 /* backslash */; 4958} 4959function isRootedDiskPath(path2) { 4960 return getEncodedRootLength(path2) > 0; 4961} 4962function pathIsAbsolute(path2) { 4963 return getEncodedRootLength(path2) !== 0; 4964} 4965function pathIsRelative(path2) { 4966 return /^\.\.?($|[\\/])/.test(path2); 4967} 4968function hasExtension(fileName) { 4969 return stringContains(getBaseFileName(fileName), "."); 4970} 4971function fileExtensionIs(path2, extension) { 4972 return path2.length > extension.length && endsWith(path2, extension); 4973} 4974function fileExtensionIsOneOf(path2, extensions) { 4975 for (const extension of extensions) { 4976 if (fileExtensionIs(path2, extension)) { 4977 return true; 4978 } 4979 } 4980 return false; 4981} 4982function hasTrailingDirectorySeparator(path2) { 4983 return path2.length > 0 && isAnyDirectorySeparator(path2.charCodeAt(path2.length - 1)); 4984} 4985function isVolumeCharacter(charCode) { 4986 return charCode >= 97 /* a */ && charCode <= 122 /* z */ || charCode >= 65 /* A */ && charCode <= 90 /* Z */; 4987} 4988function getFileUrlVolumeSeparatorEnd(url, start) { 4989 const ch0 = url.charCodeAt(start); 4990 if (ch0 === 58 /* colon */) 4991 return start + 1; 4992 if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) { 4993 const ch2 = url.charCodeAt(start + 2); 4994 if (ch2 === 97 /* a */ || ch2 === 65 /* A */) 4995 return start + 3; 4996 } 4997 return -1; 4998} 4999function getEncodedRootLength(path2) { 5000 if (!path2) 5001 return 0; 5002 const ch0 = path2.charCodeAt(0); 5003 if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) { 5004 if (path2.charCodeAt(1) !== ch0) 5005 return 1; 5006 const p1 = path2.indexOf(ch0 === 47 /* slash */ ? directorySeparator : altDirectorySeparator, 2); 5007 if (p1 < 0) 5008 return path2.length; 5009 return p1 + 1; 5010 } 5011 if (isVolumeCharacter(ch0) && path2.charCodeAt(1) === 58 /* colon */) { 5012 const ch2 = path2.charCodeAt(2); 5013 if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */) 5014 return 3; 5015 if (path2.length === 2) 5016 return 2; 5017 } 5018 const schemeEnd = path2.indexOf(urlSchemeSeparator); 5019 if (schemeEnd !== -1) { 5020 const authorityStart = schemeEnd + urlSchemeSeparator.length; 5021 const authorityEnd = path2.indexOf(directorySeparator, authorityStart); 5022 if (authorityEnd !== -1) { 5023 const scheme = path2.slice(0, schemeEnd); 5024 const authority = path2.slice(authorityStart, authorityEnd); 5025 if (scheme === "file" && (authority === "" || authority === "localhost") && isVolumeCharacter(path2.charCodeAt(authorityEnd + 1))) { 5026 const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path2, authorityEnd + 2); 5027 if (volumeSeparatorEnd !== -1) { 5028 if (path2.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) { 5029 return ~(volumeSeparatorEnd + 1); 5030 } 5031 if (volumeSeparatorEnd === path2.length) { 5032 return ~volumeSeparatorEnd; 5033 } 5034 } 5035 } 5036 return ~(authorityEnd + 1); 5037 } 5038 return ~path2.length; 5039 } 5040 return 0; 5041} 5042function getRootLength(path2) { 5043 const rootLength = getEncodedRootLength(path2); 5044 return rootLength < 0 ? ~rootLength : rootLength; 5045} 5046function getDirectoryPath(path2) { 5047 path2 = normalizeSlashes(path2); 5048 const rootLength = getRootLength(path2); 5049 if (rootLength === path2.length) 5050 return path2; 5051 path2 = removeTrailingDirectorySeparator(path2); 5052 return path2.slice(0, Math.max(rootLength, path2.lastIndexOf(directorySeparator))); 5053} 5054function getBaseFileName(path2, extensions, ignoreCase) { 5055 path2 = normalizeSlashes(path2); 5056 const rootLength = getRootLength(path2); 5057 if (rootLength === path2.length) 5058 return ""; 5059 path2 = removeTrailingDirectorySeparator(path2); 5060 const name = path2.slice(Math.max(getRootLength(path2), path2.lastIndexOf(directorySeparator) + 1)); 5061 const extension = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(name, extensions, ignoreCase) : void 0; 5062 return extension ? name.slice(0, name.length - extension.length) : name; 5063} 5064function tryGetExtensionFromPath(path2, extension, stringEqualityComparer) { 5065 if (!startsWith(extension, ".")) 5066 extension = "." + extension; 5067 if (path2.length >= extension.length && path2.charCodeAt(path2.length - extension.length) === 46 /* dot */) { 5068 const pathExtension = path2.slice(path2.length - extension.length); 5069 if (stringEqualityComparer(pathExtension, extension)) { 5070 return pathExtension; 5071 } 5072 } 5073} 5074function getAnyExtensionFromPathWorker(path2, extensions, stringEqualityComparer) { 5075 if (typeof extensions === "string") { 5076 return tryGetExtensionFromPath(path2, extensions, stringEqualityComparer) || ""; 5077 } 5078 for (const extension of extensions) { 5079 const result = tryGetExtensionFromPath(path2, extension, stringEqualityComparer); 5080 if (result) 5081 return result; 5082 } 5083 return ""; 5084} 5085function getAnyExtensionFromPath(path2, extensions, ignoreCase) { 5086 if (extensions) { 5087 return getAnyExtensionFromPathWorker(removeTrailingDirectorySeparator(path2), extensions, ignoreCase ? equateStringsCaseInsensitive : equateStringsCaseSensitive); 5088 } 5089 const baseFileName = getBaseFileName(path2); 5090 const extensionIndex = baseFileName.lastIndexOf("."); 5091 if (extensionIndex >= 0) { 5092 return baseFileName.substring(extensionIndex); 5093 } 5094 return ""; 5095} 5096function pathComponents(path2, rootLength) { 5097 const root = path2.substring(0, rootLength); 5098 const rest = path2.substring(rootLength).split(directorySeparator); 5099 if (rest.length && !lastOrUndefined(rest)) 5100 rest.pop(); 5101 return [root, ...rest]; 5102} 5103function getPathComponents(path2, currentDirectory = "") { 5104 path2 = combinePaths(currentDirectory, path2); 5105 return pathComponents(path2, getRootLength(path2)); 5106} 5107function getPathFromPathComponents(pathComponents2) { 5108 if (pathComponents2.length === 0) 5109 return ""; 5110 const root = pathComponents2[0] && ensureTrailingDirectorySeparator(pathComponents2[0]); 5111 return root + pathComponents2.slice(1).join(directorySeparator); 5112} 5113function normalizeSlashes(path2) { 5114 return path2.indexOf("\\") !== -1 ? path2.replace(backslashRegExp, directorySeparator) : path2; 5115} 5116function reducePathComponents(components) { 5117 if (!some(components)) 5118 return []; 5119 const reduced = [components[0]]; 5120 for (let i = 1; i < components.length; i++) { 5121 const component = components[i]; 5122 if (!component) 5123 continue; 5124 if (component === ".") 5125 continue; 5126 if (component === "..") { 5127 if (reduced.length > 1) { 5128 if (reduced[reduced.length - 1] !== "..") { 5129 reduced.pop(); 5130 continue; 5131 } 5132 } else if (reduced[0]) 5133 continue; 5134 } 5135 reduced.push(component); 5136 } 5137 return reduced; 5138} 5139function combinePaths(path2, ...paths) { 5140 if (path2) 5141 path2 = normalizeSlashes(path2); 5142 for (let relativePath of paths) { 5143 if (!relativePath) 5144 continue; 5145 relativePath = normalizeSlashes(relativePath); 5146 if (!path2 || getRootLength(relativePath) !== 0) { 5147 path2 = relativePath; 5148 } else { 5149 path2 = ensureTrailingDirectorySeparator(path2) + relativePath; 5150 } 5151 } 5152 return path2; 5153} 5154function resolvePath(path2, ...paths) { 5155 return normalizePath(some(paths) ? combinePaths(path2, ...paths) : normalizeSlashes(path2)); 5156} 5157function getNormalizedPathComponents(path2, currentDirectory) { 5158 return reducePathComponents(getPathComponents(path2, currentDirectory)); 5159} 5160function getNormalizedAbsolutePath(fileName, currentDirectory) { 5161 return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); 5162} 5163function normalizePath(path2) { 5164 path2 = normalizeSlashes(path2); 5165 if (!relativePathSegmentRegExp.test(path2)) { 5166 return path2; 5167 } 5168 const simplified = path2.replace(/\/\.\//g, "/").replace(/^\.\//, ""); 5169 if (simplified !== path2) { 5170 path2 = simplified; 5171 if (!relativePathSegmentRegExp.test(path2)) { 5172 return path2; 5173 } 5174 } 5175 const normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path2))); 5176 return normalized && hasTrailingDirectorySeparator(path2) ? ensureTrailingDirectorySeparator(normalized) : normalized; 5177} 5178function toPath(fileName, basePath, getCanonicalFileName) { 5179 const nonCanonicalizedPath = isRootedDiskPath(fileName) ? normalizePath(fileName) : getNormalizedAbsolutePath(fileName, basePath); 5180 return getCanonicalFileName(nonCanonicalizedPath); 5181} 5182function removeTrailingDirectorySeparator(path2) { 5183 if (hasTrailingDirectorySeparator(path2)) { 5184 return path2.substr(0, path2.length - 1); 5185 } 5186 return path2; 5187} 5188function ensureTrailingDirectorySeparator(path2) { 5189 if (!hasTrailingDirectorySeparator(path2)) { 5190 return path2 + directorySeparator; 5191 } 5192 return path2; 5193} 5194function ensurePathIsNonModuleName(path2) { 5195 return !pathIsAbsolute(path2) && !pathIsRelative(path2) ? "./" + path2 : path2; 5196} 5197function changeAnyExtension(path2, ext, extensions, ignoreCase) { 5198 const pathext = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(path2, extensions, ignoreCase) : getAnyExtensionFromPath(path2); 5199 return pathext ? path2.slice(0, path2.length - pathext.length) + (startsWith(ext, ".") ? ext : "." + ext) : path2; 5200} 5201var relativePathSegmentRegExp = /(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/; 5202function comparePathsWorker(a, b, componentComparer) { 5203 if (a === b) 5204 return 0 /* EqualTo */; 5205 if (a === void 0) 5206 return -1 /* LessThan */; 5207 if (b === void 0) 5208 return 1 /* GreaterThan */; 5209 const aRoot = a.substring(0, getRootLength(a)); 5210 const bRoot = b.substring(0, getRootLength(b)); 5211 const result = compareStringsCaseInsensitive(aRoot, bRoot); 5212 if (result !== 0 /* EqualTo */) { 5213 return result; 5214 } 5215 const aRest = a.substring(aRoot.length); 5216 const bRest = b.substring(bRoot.length); 5217 if (!relativePathSegmentRegExp.test(aRest) && !relativePathSegmentRegExp.test(bRest)) { 5218 return componentComparer(aRest, bRest); 5219 } 5220 const aComponents = reducePathComponents(getPathComponents(a)); 5221 const bComponents = reducePathComponents(getPathComponents(b)); 5222 const sharedLength = Math.min(aComponents.length, bComponents.length); 5223 for (let i = 1; i < sharedLength; i++) { 5224 const result2 = componentComparer(aComponents[i], bComponents[i]); 5225 if (result2 !== 0 /* EqualTo */) { 5226 return result2; 5227 } 5228 } 5229 return compareValues(aComponents.length, bComponents.length); 5230} 5231function comparePaths(a, b, currentDirectory, ignoreCase) { 5232 if (typeof currentDirectory === "string") { 5233 a = combinePaths(currentDirectory, a); 5234 b = combinePaths(currentDirectory, b); 5235 } else if (typeof currentDirectory === "boolean") { 5236 ignoreCase = currentDirectory; 5237 } 5238 return comparePathsWorker(a, b, getStringComparer(ignoreCase)); 5239} 5240function containsPath(parent, child, currentDirectory, ignoreCase) { 5241 if (typeof currentDirectory === "string") { 5242 parent = combinePaths(currentDirectory, parent); 5243 child = combinePaths(currentDirectory, child); 5244 } else if (typeof currentDirectory === "boolean") { 5245 ignoreCase = currentDirectory; 5246 } 5247 if (parent === void 0 || child === void 0) 5248 return false; 5249 if (parent === child) 5250 return true; 5251 const parentComponents = reducePathComponents(getPathComponents(parent)); 5252 const childComponents = reducePathComponents(getPathComponents(child)); 5253 if (childComponents.length < parentComponents.length) { 5254 return false; 5255 } 5256 const componentEqualityComparer = ignoreCase ? equateStringsCaseInsensitive : equateStringsCaseSensitive; 5257 for (let i = 0; i < parentComponents.length; i++) { 5258 const equalityComparer = i === 0 ? equateStringsCaseInsensitive : componentEqualityComparer; 5259 if (!equalityComparer(parentComponents[i], childComponents[i])) { 5260 return false; 5261 } 5262 } 5263 return true; 5264} 5265function getPathComponentsRelativeTo(from, to, stringEqualityComparer, getCanonicalFileName) { 5266 const fromComponents = reducePathComponents(getPathComponents(from)); 5267 const toComponents = reducePathComponents(getPathComponents(to)); 5268 let start; 5269 for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { 5270 const fromComponent = getCanonicalFileName(fromComponents[start]); 5271 const toComponent = getCanonicalFileName(toComponents[start]); 5272 const comparer = start === 0 ? equateStringsCaseInsensitive : stringEqualityComparer; 5273 if (!comparer(fromComponent, toComponent)) 5274 break; 5275 } 5276 if (start === 0) { 5277 return toComponents; 5278 } 5279 const components = toComponents.slice(start); 5280 const relative = []; 5281 for (; start < fromComponents.length; start++) { 5282 relative.push(".."); 5283 } 5284 return ["", ...relative, ...components]; 5285} 5286function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) { 5287 Debug.assert(getRootLength(fromDirectory) > 0 === getRootLength(to) > 0, "Paths must either both be absolute or both be relative"); 5288 const getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : identity; 5289 const ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false; 5290 const pathComponents2 = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? equateStringsCaseInsensitive : equateStringsCaseSensitive, getCanonicalFileName); 5291 return getPathFromPathComponents(pathComponents2); 5292} 5293function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { 5294 const pathComponents2 = getPathComponentsRelativeTo( 5295 resolvePath(currentDirectory, directoryPathOrUrl), 5296 resolvePath(currentDirectory, relativeOrAbsolutePath), 5297 equateStringsCaseSensitive, 5298 getCanonicalFileName 5299 ); 5300 const firstComponent = pathComponents2[0]; 5301 if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) { 5302 const prefix = firstComponent.charAt(0) === directorySeparator ? "file://" : "file:///"; 5303 pathComponents2[0] = prefix + firstComponent; 5304 } 5305 return getPathFromPathComponents(pathComponents2); 5306} 5307function forEachAncestorDirectory(directory, callback) { 5308 while (true) { 5309 const result = callback(directory); 5310 if (result !== void 0) { 5311 return result; 5312 } 5313 const parentPath = getDirectoryPath(directory); 5314 if (parentPath === directory) { 5315 return void 0; 5316 } 5317 directory = parentPath; 5318 } 5319} 5320 5321// src/compiler/diagnosticInformationMap.generated.ts 5322function diag(code, category, key, message, reportsUnnecessary, elidedInCompatabilityPyramid, reportsDeprecated) { 5323 return { code, category, key, message, reportsUnnecessary, elidedInCompatabilityPyramid, reportsDeprecated }; 5324} 5325var Diagnostics = { 5326 Unterminated_string_literal: diag(1002, 1 /* Error */, "Unterminated_string_literal_1002", "Unterminated string literal."), 5327 Identifier_expected: diag(1003, 1 /* Error */, "Identifier_expected_1003", "Identifier expected."), 5328 _0_expected: diag(1005, 1 /* Error */, "_0_expected_1005", "'{0}' expected."), 5329 A_file_cannot_have_a_reference_to_itself: diag(1006, 1 /* Error */, "A_file_cannot_have_a_reference_to_itself_1006", "A file cannot have a reference to itself."), 5330 The_parser_expected_to_find_a_1_to_match_the_0_token_here: diag(1007, 1 /* Error */, "The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007", "The parser expected to find a '{1}' to match the '{0}' token here."), 5331 Trailing_comma_not_allowed: diag(1009, 1 /* Error */, "Trailing_comma_not_allowed_1009", "Trailing comma not allowed."), 5332 Asterisk_Slash_expected: diag(1010, 1 /* Error */, "Asterisk_Slash_expected_1010", "'*/' expected."), 5333 An_element_access_expression_should_take_an_argument: diag(1011, 1 /* Error */, "An_element_access_expression_should_take_an_argument_1011", "An element access expression should take an argument."), 5334 Unexpected_token: diag(1012, 1 /* Error */, "Unexpected_token_1012", "Unexpected token."), 5335 A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma: diag(1013, 1 /* Error */, "A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma_1013", "A rest parameter or binding pattern may not have a trailing comma."), 5336 A_rest_parameter_must_be_last_in_a_parameter_list: diag(1014, 1 /* Error */, "A_rest_parameter_must_be_last_in_a_parameter_list_1014", "A rest parameter must be last in a parameter list."), 5337 Parameter_cannot_have_question_mark_and_initializer: diag(1015, 1 /* Error */, "Parameter_cannot_have_question_mark_and_initializer_1015", "Parameter cannot have question mark and initializer."), 5338 A_required_parameter_cannot_follow_an_optional_parameter: diag(1016, 1 /* Error */, "A_required_parameter_cannot_follow_an_optional_parameter_1016", "A required parameter cannot follow an optional parameter."), 5339 An_index_signature_cannot_have_a_rest_parameter: diag(1017, 1 /* Error */, "An_index_signature_cannot_have_a_rest_parameter_1017", "An index signature cannot have a rest parameter."), 5340 An_index_signature_parameter_cannot_have_an_accessibility_modifier: diag(1018, 1 /* Error */, "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018", "An index signature parameter cannot have an accessibility modifier."), 5341 An_index_signature_parameter_cannot_have_a_question_mark: diag(1019, 1 /* Error */, "An_index_signature_parameter_cannot_have_a_question_mark_1019", "An index signature parameter cannot have a question mark."), 5342 An_index_signature_parameter_cannot_have_an_initializer: diag(1020, 1 /* Error */, "An_index_signature_parameter_cannot_have_an_initializer_1020", "An index signature parameter cannot have an initializer."), 5343 An_index_signature_must_have_a_type_annotation: diag(1021, 1 /* Error */, "An_index_signature_must_have_a_type_annotation_1021", "An index signature must have a type annotation."), 5344 An_index_signature_parameter_must_have_a_type_annotation: diag(1022, 1 /* Error */, "An_index_signature_parameter_must_have_a_type_annotation_1022", "An index signature parameter must have a type annotation."), 5345 readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature: diag(1024, 1 /* Error */, "readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024", "'readonly' modifier can only appear on a property declaration or index signature."), 5346 An_index_signature_cannot_have_a_trailing_comma: diag(1025, 1 /* Error */, "An_index_signature_cannot_have_a_trailing_comma_1025", "An index signature cannot have a trailing comma."), 5347 Accessibility_modifier_already_seen: diag(1028, 1 /* Error */, "Accessibility_modifier_already_seen_1028", "Accessibility modifier already seen."), 5348 _0_modifier_must_precede_1_modifier: diag(1029, 1 /* Error */, "_0_modifier_must_precede_1_modifier_1029", "'{0}' modifier must precede '{1}' modifier."), 5349 _0_modifier_already_seen: diag(1030, 1 /* Error */, "_0_modifier_already_seen_1030", "'{0}' modifier already seen."), 5350 _0_modifier_cannot_appear_on_class_elements_of_this_kind: diag(1031, 1 /* Error */, "_0_modifier_cannot_appear_on_class_elements_of_this_kind_1031", "'{0}' modifier cannot appear on class elements of this kind."), 5351 super_must_be_followed_by_an_argument_list_or_member_access: diag(1034, 1 /* Error */, "super_must_be_followed_by_an_argument_list_or_member_access_1034", "'super' must be followed by an argument list or member access."), 5352 Only_ambient_modules_can_use_quoted_names: diag(1035, 1 /* Error */, "Only_ambient_modules_can_use_quoted_names_1035", "Only ambient modules can use quoted names."), 5353 Statements_are_not_allowed_in_ambient_contexts: diag(1036, 1 /* Error */, "Statements_are_not_allowed_in_ambient_contexts_1036", "Statements are not allowed in ambient contexts."), 5354 A_declare_modifier_cannot_be_used_in_an_already_ambient_context: diag(1038, 1 /* Error */, "A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038", "A 'declare' modifier cannot be used in an already ambient context."), 5355 Initializers_are_not_allowed_in_ambient_contexts: diag(1039, 1 /* Error */, "Initializers_are_not_allowed_in_ambient_contexts_1039", "Initializers are not allowed in ambient contexts."), 5356 _0_modifier_cannot_be_used_in_an_ambient_context: diag(1040, 1 /* Error */, "_0_modifier_cannot_be_used_in_an_ambient_context_1040", "'{0}' modifier cannot be used in an ambient context."), 5357 _0_modifier_cannot_be_used_here: diag(1042, 1 /* Error */, "_0_modifier_cannot_be_used_here_1042", "'{0}' modifier cannot be used here."), 5358 _0_modifier_cannot_appear_on_a_module_or_namespace_element: diag(1044, 1 /* Error */, "_0_modifier_cannot_appear_on_a_module_or_namespace_element_1044", "'{0}' modifier cannot appear on a module or namespace element."), 5359 Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier: diag(1046, 1 /* Error */, "Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046", "Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier."), 5360 A_rest_parameter_cannot_be_optional: diag(1047, 1 /* Error */, "A_rest_parameter_cannot_be_optional_1047", "A rest parameter cannot be optional."), 5361 A_rest_parameter_cannot_have_an_initializer: diag(1048, 1 /* Error */, "A_rest_parameter_cannot_have_an_initializer_1048", "A rest parameter cannot have an initializer."), 5362 A_set_accessor_must_have_exactly_one_parameter: diag(1049, 1 /* Error */, "A_set_accessor_must_have_exactly_one_parameter_1049", "A 'set' accessor must have exactly one parameter."), 5363 A_set_accessor_cannot_have_an_optional_parameter: diag(1051, 1 /* Error */, "A_set_accessor_cannot_have_an_optional_parameter_1051", "A 'set' accessor cannot have an optional parameter."), 5364 A_set_accessor_parameter_cannot_have_an_initializer: diag(1052, 1 /* Error */, "A_set_accessor_parameter_cannot_have_an_initializer_1052", "A 'set' accessor parameter cannot have an initializer."), 5365 A_set_accessor_cannot_have_rest_parameter: diag(1053, 1 /* Error */, "A_set_accessor_cannot_have_rest_parameter_1053", "A 'set' accessor cannot have rest parameter."), 5366 A_get_accessor_cannot_have_parameters: diag(1054, 1 /* Error */, "A_get_accessor_cannot_have_parameters_1054", "A 'get' accessor cannot have parameters."), 5367 Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: diag(1055, 1 /* Error */, "Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Prom_1055", "Type '{0}' is not a valid async function return type in ES5/ES3 because it does not refer to a Promise-compatible constructor value."), 5368 Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: diag(1056, 1 /* Error */, "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056", "Accessors are only available when targeting ECMAScript 5 and higher."), 5369 The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1058, 1 /* Error */, "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058", "The return type of an async function must either be a valid promise or must not contain a callable 'then' member."), 5370 A_promise_must_have_a_then_method: diag(1059, 1 /* Error */, "A_promise_must_have_a_then_method_1059", "A promise must have a 'then' method."), 5371 The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback: diag(1060, 1 /* Error */, "The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback_1060", "The first parameter of the 'then' method of a promise must be a callback."), 5372 Enum_member_must_have_initializer: diag(1061, 1 /* Error */, "Enum_member_must_have_initializer_1061", "Enum member must have initializer."), 5373 Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: diag(1062, 1 /* Error */, "Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method_1062", "Type is referenced directly or indirectly in the fulfillment callback of its own 'then' method."), 5374 An_export_assignment_cannot_be_used_in_a_namespace: diag(1063, 1 /* Error */, "An_export_assignment_cannot_be_used_in_a_namespace_1063", "An export assignment cannot be used in a namespace."), 5375 The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0: diag(1064, 1 /* Error */, "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064", "The return type of an async function or method must be the global Promise<T> type. Did you mean to write 'Promise<{0}>'?"), 5376 In_ambient_enum_declarations_member_initializer_must_be_constant_expression: diag(1066, 1 /* Error */, "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066", "In ambient enum declarations member initializer must be constant expression."), 5377 Unexpected_token_A_constructor_method_accessor_or_property_was_expected: diag(1068, 1 /* Error */, "Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068", "Unexpected token. A constructor, method, accessor, or property was expected."), 5378 Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces: diag(1069, 1 /* Error */, "Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069", "Unexpected token. A type parameter name was expected without curly braces."), 5379 _0_modifier_cannot_appear_on_a_type_member: diag(1070, 1 /* Error */, "_0_modifier_cannot_appear_on_a_type_member_1070", "'{0}' modifier cannot appear on a type member."), 5380 _0_modifier_cannot_appear_on_an_index_signature: diag(1071, 1 /* Error */, "_0_modifier_cannot_appear_on_an_index_signature_1071", "'{0}' modifier cannot appear on an index signature."), 5381 A_0_modifier_cannot_be_used_with_an_import_declaration: diag(1079, 1 /* Error */, "A_0_modifier_cannot_be_used_with_an_import_declaration_1079", "A '{0}' modifier cannot be used with an import declaration."), 5382 Invalid_reference_directive_syntax: diag(1084, 1 /* Error */, "Invalid_reference_directive_syntax_1084", "Invalid 'reference' directive syntax."), 5383 Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0: diag(1085, 1 /* Error */, "Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0_1085", "Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'."), 5384 _0_modifier_cannot_appear_on_a_constructor_declaration: diag(1089, 1 /* Error */, "_0_modifier_cannot_appear_on_a_constructor_declaration_1089", "'{0}' modifier cannot appear on a constructor declaration."), 5385 _0_modifier_cannot_appear_on_a_parameter: diag(1090, 1 /* Error */, "_0_modifier_cannot_appear_on_a_parameter_1090", "'{0}' modifier cannot appear on a parameter."), 5386 Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: diag(1091, 1 /* Error */, "Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091", "Only a single variable declaration is allowed in a 'for...in' statement."), 5387 Type_parameters_cannot_appear_on_a_constructor_declaration: diag(1092, 1 /* Error */, "Type_parameters_cannot_appear_on_a_constructor_declaration_1092", "Type parameters cannot appear on a constructor declaration."), 5388 Type_annotation_cannot_appear_on_a_constructor_declaration: diag(1093, 1 /* Error */, "Type_annotation_cannot_appear_on_a_constructor_declaration_1093", "Type annotation cannot appear on a constructor declaration."), 5389 An_accessor_cannot_have_type_parameters: diag(1094, 1 /* Error */, "An_accessor_cannot_have_type_parameters_1094", "An accessor cannot have type parameters."), 5390 A_set_accessor_cannot_have_a_return_type_annotation: diag(1095, 1 /* Error */, "A_set_accessor_cannot_have_a_return_type_annotation_1095", "A 'set' accessor cannot have a return type annotation."), 5391 An_index_signature_must_have_exactly_one_parameter: diag(1096, 1 /* Error */, "An_index_signature_must_have_exactly_one_parameter_1096", "An index signature must have exactly one parameter."), 5392 _0_list_cannot_be_empty: diag(1097, 1 /* Error */, "_0_list_cannot_be_empty_1097", "'{0}' list cannot be empty."), 5393 Type_parameter_list_cannot_be_empty: diag(1098, 1 /* Error */, "Type_parameter_list_cannot_be_empty_1098", "Type parameter list cannot be empty."), 5394 Type_argument_list_cannot_be_empty: diag(1099, 1 /* Error */, "Type_argument_list_cannot_be_empty_1099", "Type argument list cannot be empty."), 5395 Invalid_use_of_0_in_strict_mode: diag(1100, 1 /* Error */, "Invalid_use_of_0_in_strict_mode_1100", "Invalid use of '{0}' in strict mode."), 5396 with_statements_are_not_allowed_in_strict_mode: diag(1101, 1 /* Error */, "with_statements_are_not_allowed_in_strict_mode_1101", "'with' statements are not allowed in strict mode."), 5397 delete_cannot_be_called_on_an_identifier_in_strict_mode: diag(1102, 1 /* Error */, "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102", "'delete' cannot be called on an identifier in strict mode."), 5398 for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1103, 1 /* Error */, "for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1103", "'for await' loops are only allowed within async functions and at the top levels of modules."), 5399 A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: diag(1104, 1 /* Error */, "A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104", "A 'continue' statement can only be used within an enclosing iteration statement."), 5400 A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: diag(1105, 1 /* Error */, "A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement_1105", "A 'break' statement can only be used within an enclosing iteration or switch statement."), 5401 The_left_hand_side_of_a_for_of_statement_may_not_be_async: diag(1106, 1 /* Error */, "The_left_hand_side_of_a_for_of_statement_may_not_be_async_1106", "The left-hand side of a 'for...of' statement may not be 'async'."), 5402 Jump_target_cannot_cross_function_boundary: diag(1107, 1 /* Error */, "Jump_target_cannot_cross_function_boundary_1107", "Jump target cannot cross function boundary."), 5403 A_return_statement_can_only_be_used_within_a_function_body: diag(1108, 1 /* Error */, "A_return_statement_can_only_be_used_within_a_function_body_1108", "A 'return' statement can only be used within a function body."), 5404 Expression_expected: diag(1109, 1 /* Error */, "Expression_expected_1109", "Expression expected."), 5405 Type_expected: diag(1110, 1 /* Error */, "Type_expected_1110", "Type expected."), 5406 A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: diag(1113, 1 /* Error */, "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113", "A 'default' clause cannot appear more than once in a 'switch' statement."), 5407 Duplicate_label_0: diag(1114, 1 /* Error */, "Duplicate_label_0_1114", "Duplicate label '{0}'."), 5408 A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, 1 /* Error */, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."), 5409 A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, 1 /* Error */, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."), 5410 An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, 1 /* Error */, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."), 5411 An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, 1 /* Error */, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."), 5412 An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, 1 /* Error */, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."), 5413 An_export_assignment_cannot_have_modifiers: diag(1120, 1 /* Error */, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."), 5414 Octal_literals_are_not_allowed_in_strict_mode: diag(1121, 1 /* Error */, "Octal_literals_are_not_allowed_in_strict_mode_1121", "Octal literals are not allowed in strict mode."), 5415 Variable_declaration_list_cannot_be_empty: diag(1123, 1 /* Error */, "Variable_declaration_list_cannot_be_empty_1123", "Variable declaration list cannot be empty."), 5416 Digit_expected: diag(1124, 1 /* Error */, "Digit_expected_1124", "Digit expected."), 5417 Hexadecimal_digit_expected: diag(1125, 1 /* Error */, "Hexadecimal_digit_expected_1125", "Hexadecimal digit expected."), 5418 Unexpected_end_of_text: diag(1126, 1 /* Error */, "Unexpected_end_of_text_1126", "Unexpected end of text."), 5419 Invalid_character: diag(1127, 1 /* Error */, "Invalid_character_1127", "Invalid character."), 5420 Declaration_or_statement_expected: diag(1128, 1 /* Error */, "Declaration_or_statement_expected_1128", "Declaration or statement expected."), 5421 Statement_expected: diag(1129, 1 /* Error */, "Statement_expected_1129", "Statement expected."), 5422 case_or_default_expected: diag(1130, 1 /* Error */, "case_or_default_expected_1130", "'case' or 'default' expected."), 5423 Property_or_signature_expected: diag(1131, 1 /* Error */, "Property_or_signature_expected_1131", "Property or signature expected."), 5424 Enum_member_expected: diag(1132, 1 /* Error */, "Enum_member_expected_1132", "Enum member expected."), 5425 Variable_declaration_expected: diag(1134, 1 /* Error */, "Variable_declaration_expected_1134", "Variable declaration expected."), 5426 Argument_expression_expected: diag(1135, 1 /* Error */, "Argument_expression_expected_1135", "Argument expression expected."), 5427 Property_assignment_expected: diag(1136, 1 /* Error */, "Property_assignment_expected_1136", "Property assignment expected."), 5428 Expression_or_comma_expected: diag(1137, 1 /* Error */, "Expression_or_comma_expected_1137", "Expression or comma expected."), 5429 Parameter_declaration_expected: diag(1138, 1 /* Error */, "Parameter_declaration_expected_1138", "Parameter declaration expected."), 5430 Type_parameter_declaration_expected: diag(1139, 1 /* Error */, "Type_parameter_declaration_expected_1139", "Type parameter declaration expected."), 5431 Type_argument_expected: diag(1140, 1 /* Error */, "Type_argument_expected_1140", "Type argument expected."), 5432 String_literal_expected: diag(1141, 1 /* Error */, "String_literal_expected_1141", "String literal expected."), 5433 Line_break_not_permitted_here: diag(1142, 1 /* Error */, "Line_break_not_permitted_here_1142", "Line break not permitted here."), 5434 or_expected: diag(1144, 1 /* Error */, "or_expected_1144", "'{' or ';' expected."), 5435 or_JSX_element_expected: diag(1145, 1 /* Error */, "or_JSX_element_expected_1145", "'{' or JSX element expected."), 5436 Declaration_expected: diag(1146, 1 /* Error */, "Declaration_expected_1146", "Declaration expected."), 5437 Import_declarations_in_a_namespace_cannot_reference_a_module: diag(1147, 1 /* Error */, "Import_declarations_in_a_namespace_cannot_reference_a_module_1147", "Import declarations in a namespace cannot reference a module."), 5438 Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: diag(1148, 1 /* Error */, "Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148", "Cannot use imports, exports, or module augmentations when '--module' is 'none'."), 5439 File_name_0_differs_from_already_included_file_name_1_only_in_casing: diag(1149, 1 /* Error */, "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149", "File name '{0}' differs from already included file name '{1}' only in casing."), 5440 const_declarations_must_be_initialized: diag(1155, 1 /* Error */, "const_declarations_must_be_initialized_1155", "'const' declarations must be initialized."), 5441 const_declarations_can_only_be_declared_inside_a_block: diag(1156, 1 /* Error */, "const_declarations_can_only_be_declared_inside_a_block_1156", "'const' declarations can only be declared inside a block."), 5442 let_declarations_can_only_be_declared_inside_a_block: diag(1157, 1 /* Error */, "let_declarations_can_only_be_declared_inside_a_block_1157", "'let' declarations can only be declared inside a block."), 5443 Unterminated_template_literal: diag(1160, 1 /* Error */, "Unterminated_template_literal_1160", "Unterminated template literal."), 5444 Unterminated_regular_expression_literal: diag(1161, 1 /* Error */, "Unterminated_regular_expression_literal_1161", "Unterminated regular expression literal."), 5445 An_object_member_cannot_be_declared_optional: diag(1162, 1 /* Error */, "An_object_member_cannot_be_declared_optional_1162", "An object member cannot be declared optional."), 5446 A_yield_expression_is_only_allowed_in_a_generator_body: diag(1163, 1 /* Error */, "A_yield_expression_is_only_allowed_in_a_generator_body_1163", "A 'yield' expression is only allowed in a generator body."), 5447 Computed_property_names_are_not_allowed_in_enums: diag(1164, 1 /* Error */, "Computed_property_names_are_not_allowed_in_enums_1164", "Computed property names are not allowed in enums."), 5448 A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1165, 1 /* Error */, "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165", "A computed property name in an ambient context must refer to an expression whose type is a literal type or a 'unique symbol' type."), 5449 A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_symbol_type: diag(1166, 1 /* Error */, "A_computed_property_name_in_a_class_property_declaration_must_have_a_simple_literal_type_or_a_unique_1166", "A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type."), 5450 A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1168, 1 /* Error */, "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168", "A computed property name in a method overload must refer to an expression whose type is a literal type or a 'unique symbol' type."), 5451 A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1169, 1 /* Error */, "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169", "A computed property name in an interface must refer to an expression whose type is a literal type or a 'unique symbol' type."), 5452 A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: diag(1170, 1 /* Error */, "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170", "A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type."), 5453 A_comma_expression_is_not_allowed_in_a_computed_property_name: diag(1171, 1 /* Error */, "A_comma_expression_is_not_allowed_in_a_computed_property_name_1171", "A comma expression is not allowed in a computed property name."), 5454 extends_clause_already_seen: diag(1172, 1 /* Error */, "extends_clause_already_seen_1172", "'extends' clause already seen."), 5455 extends_clause_must_precede_implements_clause: diag(1173, 1 /* Error */, "extends_clause_must_precede_implements_clause_1173", "'extends' clause must precede 'implements' clause."), 5456 Classes_can_only_extend_a_single_class: diag(1174, 1 /* Error */, "Classes_can_only_extend_a_single_class_1174", "Classes can only extend a single class."), 5457 implements_clause_already_seen: diag(1175, 1 /* Error */, "implements_clause_already_seen_1175", "'implements' clause already seen."), 5458 Interface_declaration_cannot_have_implements_clause: diag(1176, 1 /* Error */, "Interface_declaration_cannot_have_implements_clause_1176", "Interface declaration cannot have 'implements' clause."), 5459 Binary_digit_expected: diag(1177, 1 /* Error */, "Binary_digit_expected_1177", "Binary digit expected."), 5460 Octal_digit_expected: diag(1178, 1 /* Error */, "Octal_digit_expected_1178", "Octal digit expected."), 5461 Unexpected_token_expected: diag(1179, 1 /* Error */, "Unexpected_token_expected_1179", "Unexpected token. '{' expected."), 5462 Property_destructuring_pattern_expected: diag(1180, 1 /* Error */, "Property_destructuring_pattern_expected_1180", "Property destructuring pattern expected."), 5463 Array_element_destructuring_pattern_expected: diag(1181, 1 /* Error */, "Array_element_destructuring_pattern_expected_1181", "Array element destructuring pattern expected."), 5464 A_destructuring_declaration_must_have_an_initializer: diag(1182, 1 /* Error */, "A_destructuring_declaration_must_have_an_initializer_1182", "A destructuring declaration must have an initializer."), 5465 An_implementation_cannot_be_declared_in_ambient_contexts: diag(1183, 1 /* Error */, "An_implementation_cannot_be_declared_in_ambient_contexts_1183", "An implementation cannot be declared in ambient contexts."), 5466 Modifiers_cannot_appear_here: diag(1184, 1 /* Error */, "Modifiers_cannot_appear_here_1184", "Modifiers cannot appear here."), 5467 Merge_conflict_marker_encountered: diag(1185, 1 /* Error */, "Merge_conflict_marker_encountered_1185", "Merge conflict marker encountered."), 5468 A_rest_element_cannot_have_an_initializer: diag(1186, 1 /* Error */, "A_rest_element_cannot_have_an_initializer_1186", "A rest element cannot have an initializer."), 5469 A_parameter_property_may_not_be_declared_using_a_binding_pattern: diag(1187, 1 /* Error */, "A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187", "A parameter property may not be declared using a binding pattern."), 5470 Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: diag(1188, 1 /* Error */, "Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement_1188", "Only a single variable declaration is allowed in a 'for...of' statement."), 5471 The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: diag(1189, 1 /* Error */, "The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer_1189", "The variable declaration of a 'for...in' statement cannot have an initializer."), 5472 The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: diag(1190, 1 /* Error */, "The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer_1190", "The variable declaration of a 'for...of' statement cannot have an initializer."), 5473 An_import_declaration_cannot_have_modifiers: diag(1191, 1 /* Error */, "An_import_declaration_cannot_have_modifiers_1191", "An import declaration cannot have modifiers."), 5474 Module_0_has_no_default_export: diag(1192, 1 /* Error */, "Module_0_has_no_default_export_1192", "Module '{0}' has no default export."), 5475 An_export_declaration_cannot_have_modifiers: diag(1193, 1 /* Error */, "An_export_declaration_cannot_have_modifiers_1193", "An export declaration cannot have modifiers."), 5476 Export_declarations_are_not_permitted_in_a_namespace: diag(1194, 1 /* Error */, "Export_declarations_are_not_permitted_in_a_namespace_1194", "Export declarations are not permitted in a namespace."), 5477 export_Asterisk_does_not_re_export_a_default: diag(1195, 1 /* Error */, "export_Asterisk_does_not_re_export_a_default_1195", "'export *' does not re-export a default."), 5478 Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified: diag(1196, 1 /* Error */, "Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified_1196", "Catch clause variable type annotation must be 'any' or 'unknown' if specified."), 5479 Catch_clause_variable_cannot_have_an_initializer: diag(1197, 1 /* Error */, "Catch_clause_variable_cannot_have_an_initializer_1197", "Catch clause variable cannot have an initializer."), 5480 An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: diag(1198, 1 /* Error */, "An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive_1198", "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive."), 5481 Unterminated_Unicode_escape_sequence: diag(1199, 1 /* Error */, "Unterminated_Unicode_escape_sequence_1199", "Unterminated Unicode escape sequence."), 5482 Line_terminator_not_permitted_before_arrow: diag(1200, 1 /* Error */, "Line_terminator_not_permitted_before_arrow_1200", "Line terminator not permitted before arrow."), 5483 Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: diag(1202, 1 /* Error */, "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202", `Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.`), 5484 Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead: diag(1203, 1 /* Error */, "Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203", "Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead."), 5485 Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type: diag(1205, 1 /* Error */, "Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type_1205", "Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'."), 5486 Decorators_are_not_valid_here: diag(1206, 1 /* Error */, "Decorators_are_not_valid_here_1206", "Decorators are not valid here."), 5487 Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: diag(1207, 1 /* Error */, "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207", "Decorators cannot be applied to multiple get/set accessors of the same name."), 5488 _0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_import_export_or_an_empty_export_statement_to_make_it_a_module: diag(1208, 1 /* Error */, "_0_cannot_be_compiled_under_isolatedModules_because_it_is_considered_a_global_script_file_Add_an_imp_1208", "'{0}' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module."), 5489 Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0: diag(1209, 1 /* Error */, "Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0_1209", "Invalid optional chain from new expression. Did you mean to call '{0}()'?"), 5490 Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode: diag(1210, 1 /* Error */, "Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of__1210", "Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of '{0}'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode."), 5491 A_class_declaration_without_the_default_modifier_must_have_a_name: diag(1211, 1 /* Error */, "A_class_declaration_without_the_default_modifier_must_have_a_name_1211", "A class declaration without the 'default' modifier must have a name."), 5492 Identifier_expected_0_is_a_reserved_word_in_strict_mode: diag(1212, 1 /* Error */, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_1212", "Identifier expected. '{0}' is a reserved word in strict mode."), 5493 Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: diag(1213, 1 /* Error */, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_stric_1213", "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode."), 5494 Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: diag(1214, 1 /* Error */, "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214", "Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode."), 5495 Invalid_use_of_0_Modules_are_automatically_in_strict_mode: diag(1215, 1 /* Error */, "Invalid_use_of_0_Modules_are_automatically_in_strict_mode_1215", "Invalid use of '{0}'. Modules are automatically in strict mode."), 5496 Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: diag(1216, 1 /* Error */, "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216", "Identifier expected. '__esModule' is reserved as an exported marker when transforming ECMAScript modules."), 5497 Export_assignment_is_not_supported_when_module_flag_is_system: diag(1218, 1 /* Error */, "Export_assignment_is_not_supported_when_module_flag_is_system_1218", "Export assignment is not supported when '--module' flag is 'system'."), 5498 Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_in_your_tsconfig_or_jsconfig_to_remove_this_warning: diag(1219, 1 /* Error */, "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219", "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning."), 5499 Generators_are_not_allowed_in_an_ambient_context: diag(1221, 1 /* Error */, "Generators_are_not_allowed_in_an_ambient_context_1221", "Generators are not allowed in an ambient context."), 5500 An_overload_signature_cannot_be_declared_as_a_generator: diag(1222, 1 /* Error */, "An_overload_signature_cannot_be_declared_as_a_generator_1222", "An overload signature cannot be declared as a generator."), 5501 _0_tag_already_specified: diag(1223, 1 /* Error */, "_0_tag_already_specified_1223", "'{0}' tag already specified."), 5502 Signature_0_must_be_a_type_predicate: diag(1224, 1 /* Error */, "Signature_0_must_be_a_type_predicate_1224", "Signature '{0}' must be a type predicate."), 5503 Cannot_find_parameter_0: diag(1225, 1 /* Error */, "Cannot_find_parameter_0_1225", "Cannot find parameter '{0}'."), 5504 Type_predicate_0_is_not_assignable_to_1: diag(1226, 1 /* Error */, "Type_predicate_0_is_not_assignable_to_1_1226", "Type predicate '{0}' is not assignable to '{1}'."), 5505 Parameter_0_is_not_in_the_same_position_as_parameter_1: diag(1227, 1 /* Error */, "Parameter_0_is_not_in_the_same_position_as_parameter_1_1227", "Parameter '{0}' is not in the same position as parameter '{1}'."), 5506 A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods: diag(1228, 1 /* Error */, "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228", "A type predicate is only allowed in return type position for functions and methods."), 5507 A_type_predicate_cannot_reference_a_rest_parameter: diag(1229, 1 /* Error */, "A_type_predicate_cannot_reference_a_rest_parameter_1229", "A type predicate cannot reference a rest parameter."), 5508 A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: diag(1230, 1 /* Error */, "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230", "A type predicate cannot reference element '{0}' in a binding pattern."), 5509 An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration: diag(1231, 1 /* Error */, "An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231", "An export assignment must be at the top level of a file or module declaration."), 5510 An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module: diag(1232, 1 /* Error */, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232", "An import declaration can only be used at the top level of a namespace or module."), 5511 An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module: diag(1233, 1 /* Error */, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233", "An export declaration can only be used at the top level of a namespace or module."), 5512 An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file: diag(1234, 1 /* Error */, "An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234", "An ambient module declaration is only allowed at the top level in a file."), 5513 A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module: diag(1235, 1 /* Error */, "A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235", "A namespace declaration is only allowed at the top level of a namespace or module."), 5514 The_return_type_of_a_property_decorator_function_must_be_either_void_or_any: diag(1236, 1 /* Error */, "The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236", "The return type of a property decorator function must be either 'void' or 'any'."), 5515 The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any: diag(1237, 1 /* Error */, "The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237", "The return type of a parameter decorator function must be either 'void' or 'any'."), 5516 Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression: diag(1238, 1 /* Error */, "Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238", "Unable to resolve signature of class decorator when called as an expression."), 5517 Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression: diag(1239, 1 /* Error */, "Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression_1239", "Unable to resolve signature of parameter decorator when called as an expression."), 5518 Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression: diag(1240, 1 /* Error */, "Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression_1240", "Unable to resolve signature of property decorator when called as an expression."), 5519 Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression: diag(1241, 1 /* Error */, "Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression_1241", "Unable to resolve signature of method decorator when called as an expression."), 5520 abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration: diag(1242, 1 /* Error */, "abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration_1242", "'abstract' modifier can only appear on a class, method, or property declaration."), 5521 _0_modifier_cannot_be_used_with_1_modifier: diag(1243, 1 /* Error */, "_0_modifier_cannot_be_used_with_1_modifier_1243", "'{0}' modifier cannot be used with '{1}' modifier."), 5522 Abstract_methods_can_only_appear_within_an_abstract_class: diag(1244, 1 /* Error */, "Abstract_methods_can_only_appear_within_an_abstract_class_1244", "Abstract methods can only appear within an abstract class."), 5523 Method_0_cannot_have_an_implementation_because_it_is_marked_abstract: diag(1245, 1 /* Error */, "Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245", "Method '{0}' cannot have an implementation because it is marked abstract."), 5524 An_interface_property_cannot_have_an_initializer: diag(1246, 1 /* Error */, "An_interface_property_cannot_have_an_initializer_1246", "An interface property cannot have an initializer."), 5525 A_type_literal_property_cannot_have_an_initializer: diag(1247, 1 /* Error */, "A_type_literal_property_cannot_have_an_initializer_1247", "A type literal property cannot have an initializer."), 5526 A_class_member_cannot_have_the_0_keyword: diag(1248, 1 /* Error */, "A_class_member_cannot_have_the_0_keyword_1248", "A class member cannot have the '{0}' keyword."), 5527 A_decorator_can_only_decorate_a_method_implementation_not_an_overload: diag(1249, 1 /* Error */, "A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249", "A decorator can only decorate a method implementation, not an overload."), 5528 Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5: diag(1250, 1 /* Error */, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'."), 5529 Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode: diag(1251, 1 /* Error */, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode."), 5530 Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode: diag(1252, 1 /* Error */, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode."), 5531 A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference: diag(1254, 1 /* Error */, "A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254", "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."), 5532 A_definite_assignment_assertion_is_not_permitted_in_this_context: diag(1255, 1 /* Error */, "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255", "A definite assignment assertion '!' is not permitted in this context."), 5533 A_required_element_cannot_follow_an_optional_element: diag(1257, 1 /* Error */, "A_required_element_cannot_follow_an_optional_element_1257", "A required element cannot follow an optional element."), 5534 A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration: diag(1258, 1 /* Error */, "A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration_1258", "A default export must be at the top level of a file or module declaration."), 5535 Module_0_can_only_be_default_imported_using_the_1_flag: diag(1259, 1 /* Error */, "Module_0_can_only_be_default_imported_using_the_1_flag_1259", "Module '{0}' can only be default-imported using the '{1}' flag"), 5536 Keywords_cannot_contain_escape_characters: diag(1260, 1 /* Error */, "Keywords_cannot_contain_escape_characters_1260", "Keywords cannot contain escape characters."), 5537 Already_included_file_name_0_differs_from_file_name_1_only_in_casing: diag(1261, 1 /* Error */, "Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261", "Already included file name '{0}' differs from file name '{1}' only in casing."), 5538 Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module: diag(1262, 1 /* Error */, "Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262", "Identifier expected. '{0}' is a reserved word at the top-level of a module."), 5539 Declarations_with_initializers_cannot_also_have_definite_assignment_assertions: diag(1263, 1 /* Error */, "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263", "Declarations with initializers cannot also have definite assignment assertions."), 5540 Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: diag(1264, 1 /* Error */, "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264", "Declarations with definite assignment assertions must also have type annotations."), 5541 A_rest_element_cannot_follow_another_rest_element: diag(1265, 1 /* Error */, "A_rest_element_cannot_follow_another_rest_element_1265", "A rest element cannot follow another rest element."), 5542 An_optional_element_cannot_follow_a_rest_element: diag(1266, 1 /* Error */, "An_optional_element_cannot_follow_a_rest_element_1266", "An optional element cannot follow a rest element."), 5543 Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, 1 /* Error */, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."), 5544 An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, 1 /* Error */, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."), 5545 Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided: diag(1269, 1 /* Error */, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269", "Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."), 5546 Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, 1 /* Error */, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."), 5547 Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, 1 /* Error */, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."), 5548 A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled: diag(1272, 1 /* Error */, "A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_w_1272", "A type referenced in a decorated signature must be imported with 'import type' or a namespace import when 'isolatedModules' and 'emitDecoratorMetadata' are enabled."), 5549 _0_modifier_cannot_appear_on_a_type_parameter: diag(1273, 1 /* Error */, "_0_modifier_cannot_appear_on_a_type_parameter_1273", "'{0}' modifier cannot appear on a type parameter"), 5550 _0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias: diag(1274, 1 /* Error */, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274", "'{0}' modifier can only appear on a type parameter of a class, interface or type alias"), 5551 accessor_modifier_can_only_appear_on_a_property_declaration: diag(1275, 1 /* Error */, "accessor_modifier_can_only_appear_on_a_property_declaration_1275", "'accessor' modifier can only appear on a property declaration."), 5552 An_accessor_property_cannot_be_declared_optional: diag(1276, 1 /* Error */, "An_accessor_property_cannot_be_declared_optional_1276", "An 'accessor' property cannot be declared optional."), 5553 with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."), 5554 await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."), 5555 The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."), 5556 Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, 1 /* Error */, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."), 5557 The_body_of_an_if_statement_cannot_be_the_empty_statement: diag(1313, 1 /* Error */, "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313", "The body of an 'if' statement cannot be the empty statement."), 5558 Global_module_exports_may_only_appear_in_module_files: diag(1314, 1 /* Error */, "Global_module_exports_may_only_appear_in_module_files_1314", "Global module exports may only appear in module files."), 5559 Global_module_exports_may_only_appear_in_declaration_files: diag(1315, 1 /* Error */, "Global_module_exports_may_only_appear_in_declaration_files_1315", "Global module exports may only appear in declaration files."), 5560 Global_module_exports_may_only_appear_at_top_level: diag(1316, 1 /* Error */, "Global_module_exports_may_only_appear_at_top_level_1316", "Global module exports may only appear at top level."), 5561 A_parameter_property_cannot_be_declared_using_a_rest_parameter: diag(1317, 1 /* Error */, "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317", "A parameter property cannot be declared using a rest parameter."), 5562 An_abstract_accessor_cannot_have_an_implementation: diag(1318, 1 /* Error */, "An_abstract_accessor_cannot_have_an_implementation_1318", "An abstract accessor cannot have an implementation."), 5563 A_default_export_can_only_be_used_in_an_ECMAScript_style_module: diag(1319, 1 /* Error */, "A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319", "A default export can only be used in an ECMAScript-style module."), 5564 Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, 1 /* Error */, "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."), 5565 Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, 1 /* Error */, "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."), 5566 Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1322, 1 /* Error */, "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."), 5567 Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext: diag(1323, 1 /* Error */, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'."), 5568 Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext: diag(1324, 1 /* Error */, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nod_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'."), 5569 Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, 1 /* Error */, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."), 5570 This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, 1 /* Error */, "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326", "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."), 5571 String_literal_with_double_quotes_expected: diag(1327, 1 /* Error */, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."), 5572 Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal: diag(1328, 1 /* Error */, "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328", "Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."), 5573 _0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0: diag(1329, 1 /* Error */, "_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329", "'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"), 5574 A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly: diag(1330, 1 /* Error */, "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330", "A property of an interface or type literal whose type is a 'unique symbol' type must be 'readonly'."), 5575 A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly: diag(1331, 1 /* Error */, "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331", "A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'."), 5576 A_variable_whose_type_is_a_unique_symbol_type_must_be_const: diag(1332, 1 /* Error */, "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332", "A variable whose type is a 'unique symbol' type must be 'const'."), 5577 unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name: diag(1333, 1 /* Error */, "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333", "'unique symbol' types may not be used on a variable declaration with a binding name."), 5578 unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement: diag(1334, 1 /* Error */, "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334", "'unique symbol' types are only allowed on variables in a variable statement."), 5579 unique_symbol_types_are_not_allowed_here: diag(1335, 1 /* Error */, "unique_symbol_types_are_not_allowed_here_1335", "'unique symbol' types are not allowed here."), 5580 An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead: diag(1337, 1 /* Error */, "An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337", "An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead."), 5581 infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: diag(1338, 1 /* Error */, "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338", "'infer' declarations are only permitted in the 'extends' clause of a conditional type."), 5582 Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1 /* Error */, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."), 5583 Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1 /* Error */, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"), 5584 Class_constructor_may_not_be_an_accessor: diag(1341, 1 /* Error */, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."), 5585 Type_arguments_cannot_be_used_here: diag(1342, 1 /* Error */, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."), 5586 The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."), 5587 A_label_is_not_allowed_here: diag(1344, 1 /* Error */, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."), 5588 An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1 /* Error */, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."), 5589 This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, 1 /* Error */, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."), 5590 use_strict_directive_cannot_be_used_with_non_simple_parameter_list: diag(1347, 1 /* Error */, "use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347", "'use strict' directive cannot be used with non-simple parameter list."), 5591 Non_simple_parameter_declared_here: diag(1348, 1 /* Error */, "Non_simple_parameter_declared_here_1348", "Non-simple parameter declared here."), 5592 use_strict_directive_used_here: diag(1349, 1 /* Error */, "use_strict_directive_used_here_1349", "'use strict' directive used here."), 5593 Print_the_final_configuration_instead_of_building: diag(1350, 3 /* Message */, "Print_the_final_configuration_instead_of_building_1350", "Print the final configuration instead of building."), 5594 An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal: diag(1351, 1 /* Error */, "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351", "An identifier or keyword cannot immediately follow a numeric literal."), 5595 A_bigint_literal_cannot_use_exponential_notation: diag(1352, 1 /* Error */, "A_bigint_literal_cannot_use_exponential_notation_1352", "A bigint literal cannot use exponential notation."), 5596 A_bigint_literal_must_be_an_integer: diag(1353, 1 /* Error */, "A_bigint_literal_must_be_an_integer_1353", "A bigint literal must be an integer."), 5597 readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types: diag(1354, 1 /* Error */, "readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354", "'readonly' type modifier is only permitted on array and tuple literal types."), 5598 A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_or_object_literals: diag(1355, 1 /* Error */, "A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355", "A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals."), 5599 Did_you_mean_to_mark_this_function_as_async: diag(1356, 1 /* Error */, "Did_you_mean_to_mark_this_function_as_async_1356", "Did you mean to mark this function as 'async'?"), 5600 An_enum_member_name_must_be_followed_by_a_or: diag(1357, 1 /* Error */, "An_enum_member_name_must_be_followed_by_a_or_1357", "An enum member name must be followed by a ',', '=', or '}'."), 5601 Tagged_template_expressions_are_not_permitted_in_an_optional_chain: diag(1358, 1 /* Error */, "Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358", "Tagged template expressions are not permitted in an optional chain."), 5602 Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here: diag(1359, 1 /* Error */, "Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359", "Identifier expected. '{0}' is a reserved word that cannot be used here."), 5603 Type_0_does_not_satisfy_the_expected_type_1: diag(1360, 1 /* Error */, "Type_0_does_not_satisfy_the_expected_type_1_1360", "Type '{0}' does not satisfy the expected type '{1}'."), 5604 _0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type: diag(1361, 1 /* Error */, "_0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type_1361", "'{0}' cannot be used as a value because it was imported using 'import type'."), 5605 _0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type: diag(1362, 1 /* Error */, "_0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type_1362", "'{0}' cannot be used as a value because it was exported using 'export type'."), 5606 A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both: diag(1363, 1 /* Error */, "A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both_1363", "A type-only import can specify a default import or named bindings, but not both."), 5607 Convert_to_type_only_export: diag(1364, 3 /* Message */, "Convert_to_type_only_export_1364", "Convert to type-only export"), 5608 Convert_all_re_exported_types_to_type_only_exports: diag(1365, 3 /* Message */, "Convert_all_re_exported_types_to_type_only_exports_1365", "Convert all re-exported types to type-only exports"), 5609 Split_into_two_separate_import_declarations: diag(1366, 3 /* Message */, "Split_into_two_separate_import_declarations_1366", "Split into two separate import declarations"), 5610 Split_all_invalid_type_only_imports: diag(1367, 3 /* Message */, "Split_all_invalid_type_only_imports_1367", "Split all invalid type-only imports"), 5611 Class_constructor_may_not_be_a_generator: diag(1368, 1 /* Error */, "Class_constructor_may_not_be_a_generator_1368", "Class constructor may not be a generator."), 5612 Did_you_mean_0: diag(1369, 3 /* Message */, "Did_you_mean_0_1369", "Did you mean '{0}'?"), 5613 This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error: diag(1371, 1 /* Error */, "This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set__1371", "This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'."), 5614 Convert_to_type_only_import: diag(1373, 3 /* Message */, "Convert_to_type_only_import_1373", "Convert to type-only import"), 5615 Convert_all_imports_not_used_as_a_value_to_type_only_imports: diag(1374, 3 /* Message */, "Convert_all_imports_not_used_as_a_value_to_type_only_imports_1374", "Convert all imports not used as a value to type-only imports"), 5616 await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1375, 1 /* Error */, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), 5617 _0_was_imported_here: diag(1376, 3 /* Message */, "_0_was_imported_here_1376", "'{0}' was imported here."), 5618 _0_was_exported_here: diag(1377, 3 /* Message */, "_0_was_exported_here_1377", "'{0}' was exported here."), 5619 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: diag(1378, 1 /* Error */, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "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."), 5620 An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379", "An import alias cannot reference a declaration that was exported using 'export type'."), 5621 An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."), 5622 Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1 /* Error */, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"), 5623 Unexpected_token_Did_you_mean_or_gt: diag(1382, 1 /* Error */, "Unexpected_token_Did_you_mean_or_gt_1382", "Unexpected token. Did you mean `{'>'}` or `>`?"), 5624 Only_named_exports_may_use_export_type: diag(1383, 1 /* Error */, "Only_named_exports_may_use_export_type_1383", "Only named exports may use 'export type'."), 5625 Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1385, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385", "Function type notation must be parenthesized when used in a union type."), 5626 Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, 1 /* Error */, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."), 5627 Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."), 5628 Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1388, 1 /* Error */, "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388", "Constructor type notation must be parenthesized when used in an intersection type."), 5629 _0_is_not_allowed_as_a_variable_declaration_name: diag(1389, 1 /* Error */, "_0_is_not_allowed_as_a_variable_declaration_name_1389", "'{0}' is not allowed as a variable declaration name."), 5630 _0_is_not_allowed_as_a_parameter_name: diag(1390, 1 /* Error */, "_0_is_not_allowed_as_a_parameter_name_1390", "'{0}' is not allowed as a parameter name."), 5631 An_import_alias_cannot_use_import_type: diag(1392, 1 /* Error */, "An_import_alias_cannot_use_import_type_1392", "An import alias cannot use 'import type'"), 5632 Imported_via_0_from_file_1: diag(1393, 3 /* Message */, "Imported_via_0_from_file_1_1393", "Imported via {0} from file '{1}'"), 5633 Imported_via_0_from_file_1_with_packageId_2: diag(1394, 3 /* Message */, "Imported_via_0_from_file_1_with_packageId_2_1394", "Imported via {0} from file '{1}' with packageId '{2}'"), 5634 Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions: diag(1395, 3 /* Message */, "Imported_via_0_from_file_1_to_import_importHelpers_as_specified_in_compilerOptions_1395", "Imported via {0} from file '{1}' to import 'importHelpers' as specified in compilerOptions"), 5635 Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions: diag(1396, 3 /* Message */, "Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396", "Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions"), 5636 Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions: diag(1397, 3 /* Message */, "Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397", "Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions"), 5637 Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions: diag(1398, 3 /* Message */, "Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398", "Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions"), 5638 File_is_included_via_import_here: diag(1399, 3 /* Message */, "File_is_included_via_import_here_1399", "File is included via import here."), 5639 Referenced_via_0_from_file_1: diag(1400, 3 /* Message */, "Referenced_via_0_from_file_1_1400", "Referenced via '{0}' from file '{1}'"), 5640 File_is_included_via_reference_here: diag(1401, 3 /* Message */, "File_is_included_via_reference_here_1401", "File is included via reference here."), 5641 Type_library_referenced_via_0_from_file_1: diag(1402, 3 /* Message */, "Type_library_referenced_via_0_from_file_1_1402", "Type library referenced via '{0}' from file '{1}'"), 5642 Type_library_referenced_via_0_from_file_1_with_packageId_2: diag(1403, 3 /* Message */, "Type_library_referenced_via_0_from_file_1_with_packageId_2_1403", "Type library referenced via '{0}' from file '{1}' with packageId '{2}'"), 5643 File_is_included_via_type_library_reference_here: diag(1404, 3 /* Message */, "File_is_included_via_type_library_reference_here_1404", "File is included via type library reference here."), 5644 Library_referenced_via_0_from_file_1: diag(1405, 3 /* Message */, "Library_referenced_via_0_from_file_1_1405", "Library referenced via '{0}' from file '{1}'"), 5645 File_is_included_via_library_reference_here: diag(1406, 3 /* Message */, "File_is_included_via_library_reference_here_1406", "File is included via library reference here."), 5646 Matched_by_include_pattern_0_in_1: diag(1407, 3 /* Message */, "Matched_by_include_pattern_0_in_1_1407", "Matched by include pattern '{0}' in '{1}'"), 5647 File_is_matched_by_include_pattern_specified_here: diag(1408, 3 /* Message */, "File_is_matched_by_include_pattern_specified_here_1408", "File is matched by include pattern specified here."), 5648 Part_of_files_list_in_tsconfig_json: diag(1409, 3 /* Message */, "Part_of_files_list_in_tsconfig_json_1409", "Part of 'files' list in tsconfig.json"), 5649 File_is_matched_by_files_list_specified_here: diag(1410, 3 /* Message */, "File_is_matched_by_files_list_specified_here_1410", "File is matched by 'files' list specified here."), 5650 Output_from_referenced_project_0_included_because_1_specified: diag(1411, 3 /* Message */, "Output_from_referenced_project_0_included_because_1_specified_1411", "Output from referenced project '{0}' included because '{1}' specified"), 5651 Output_from_referenced_project_0_included_because_module_is_specified_as_none: diag(1412, 3 /* Message */, "Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412", "Output from referenced project '{0}' included because '--module' is specified as 'none'"), 5652 File_is_output_from_referenced_project_specified_here: diag(1413, 3 /* Message */, "File_is_output_from_referenced_project_specified_here_1413", "File is output from referenced project specified here."), 5653 Source_from_referenced_project_0_included_because_1_specified: diag(1414, 3 /* Message */, "Source_from_referenced_project_0_included_because_1_specified_1414", "Source from referenced project '{0}' included because '{1}' specified"), 5654 Source_from_referenced_project_0_included_because_module_is_specified_as_none: diag(1415, 3 /* Message */, "Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415", "Source from referenced project '{0}' included because '--module' is specified as 'none'"), 5655 File_is_source_from_referenced_project_specified_here: diag(1416, 3 /* Message */, "File_is_source_from_referenced_project_specified_here_1416", "File is source from referenced project specified here."), 5656 Entry_point_of_type_library_0_specified_in_compilerOptions: diag(1417, 3 /* Message */, "Entry_point_of_type_library_0_specified_in_compilerOptions_1417", "Entry point of type library '{0}' specified in compilerOptions"), 5657 Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1: diag(1418, 3 /* Message */, "Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418", "Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'"), 5658 File_is_entry_point_of_type_library_specified_here: diag(1419, 3 /* Message */, "File_is_entry_point_of_type_library_specified_here_1419", "File is entry point of type library specified here."), 5659 Entry_point_for_implicit_type_library_0: diag(1420, 3 /* Message */, "Entry_point_for_implicit_type_library_0_1420", "Entry point for implicit type library '{0}'"), 5660 Entry_point_for_implicit_type_library_0_with_packageId_1: diag(1421, 3 /* Message */, "Entry_point_for_implicit_type_library_0_with_packageId_1_1421", "Entry point for implicit type library '{0}' with packageId '{1}'"), 5661 Library_0_specified_in_compilerOptions: diag(1422, 3 /* Message */, "Library_0_specified_in_compilerOptions_1422", "Library '{0}' specified in compilerOptions"), 5662 File_is_library_specified_here: diag(1423, 3 /* Message */, "File_is_library_specified_here_1423", "File is library specified here."), 5663 Default_library: diag(1424, 3 /* Message */, "Default_library_1424", "Default library"), 5664 Default_library_for_target_0: diag(1425, 3 /* Message */, "Default_library_for_target_0_1425", "Default library for target '{0}'"), 5665 File_is_default_library_for_target_specified_here: diag(1426, 3 /* Message */, "File_is_default_library_for_target_specified_here_1426", "File is default library for target specified here."), 5666 Root_file_specified_for_compilation: diag(1427, 3 /* Message */, "Root_file_specified_for_compilation_1427", "Root file specified for compilation"), 5667 File_is_output_of_project_reference_source_0: diag(1428, 3 /* Message */, "File_is_output_of_project_reference_source_0_1428", "File is output of project reference source '{0}'"), 5668 File_redirects_to_file_0: diag(1429, 3 /* Message */, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"), 5669 The_file_is_in_the_program_because_Colon: diag(1430, 3 /* Message */, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"), 5670 for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(1431, 1 /* Error */, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."), 5671 Top_level_for_await_loops_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: diag(1432, 1 /* Error */, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops 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."), 5672 Decorators_may_not_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Decorators_may_not_be_applied_to_this_parameters_1433", "Decorators may not be applied to 'this' parameters."), 5673 Unexpected_keyword_or_identifier: diag(1434, 1 /* Error */, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."), 5674 Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, 1 /* Error */, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"), 5675 Decorators_must_precede_the_name_and_all_keywords_of_property_declarations: diag(1436, 1 /* Error */, "Decorators_must_precede_the_name_and_all_keywords_of_property_declarations_1436", "Decorators must precede the name and all keywords of property declarations."), 5676 Namespace_must_be_given_a_name: diag(1437, 1 /* Error */, "Namespace_must_be_given_a_name_1437", "Namespace must be given a name."), 5677 Interface_must_be_given_a_name: diag(1438, 1 /* Error */, "Interface_must_be_given_a_name_1438", "Interface must be given a name."), 5678 Type_alias_must_be_given_a_name: diag(1439, 1 /* Error */, "Type_alias_must_be_given_a_name_1439", "Type alias must be given a name."), 5679 Variable_declaration_not_allowed_at_this_location: diag(1440, 1 /* Error */, "Variable_declaration_not_allowed_at_this_location_1440", "Variable declaration not allowed at this location."), 5680 Cannot_start_a_function_call_in_a_type_annotation: diag(1441, 1 /* Error */, "Cannot_start_a_function_call_in_a_type_annotation_1441", "Cannot start a function call in a type annotation."), 5681 Expected_for_property_initializer: diag(1442, 1 /* Error */, "Expected_for_property_initializer_1442", "Expected '=' for property initializer."), 5682 Module_declaration_names_may_only_use_or_quoted_strings: diag(1443, 1 /* Error */, "Module_declaration_names_may_only_use_or_quoted_strings_1443", `Module declaration names may only use ' or " quoted strings.`), 5683 _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1444, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedMod_1444", "'{0}' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), 5684 _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1446, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."), 5685 _0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isol_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled."), 5686 Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, 3 /* Message */, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."), 5687 Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, 3 /* Message */, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"), 5688 Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, 1 /* Error */, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"), 5689 resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1452, 1 /* Error */, "resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452", "'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`."), 5690 resolution_mode_should_be_either_require_or_import: diag(1453, 1 /* Error */, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."), 5691 resolution_mode_can_only_be_set_for_type_only_imports: diag(1454, 1 /* Error */, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."), 5692 resolution_mode_is_the_only_valid_key_for_type_import_assertions: diag(1455, 1 /* Error */, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."), 5693 Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: diag(1456, 1 /* Error */, "Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1456", "Type import assertions should have exactly one key - `resolution-mode` - with value `import` or `require`."), 5694 Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk: diag(1457, 3 /* Message */, "Matched_by_default_include_pattern_Asterisk_Asterisk_Slash_Asterisk_1457", "Matched by default include pattern '**/*'"), 5695 File_is_ECMAScript_module_because_0_has_field_type_with_value_module: diag(1458, 3 /* Message */, "File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458", `File is ECMAScript module because '{0}' has field "type" with value "module"`), 5696 File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module: diag(1459, 3 /* Message */, "File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459", `File is CommonJS module because '{0}' has field "type" whose value is not "module"`), 5697 File_is_CommonJS_module_because_0_does_not_have_field_type: diag(1460, 3 /* Message */, "File_is_CommonJS_module_because_0_does_not_have_field_type_1460", `File is CommonJS module because '{0}' does not have field "type"`), 5698 File_is_CommonJS_module_because_package_json_was_not_found: diag(1461, 3 /* Message */, "File_is_CommonJS_module_because_package_json_was_not_found_1461", "File is CommonJS module because 'package.json' was not found"), 5699 The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, 1 /* Error */, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."), 5700 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: diag(1471, 1 /* Error */, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "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."), 5701 catch_or_finally_expected: diag(1472, 1 /* Error */, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."), 5702 An_import_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1473, 1 /* Error */, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473", "An import declaration can only be used at the top level of a module."), 5703 An_export_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1474, 1 /* Error */, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474", "An export declaration can only be used at the top level of a module."), 5704 Control_what_method_is_used_to_detect_module_format_JS_files: diag(1475, 3 /* Message */, "Control_what_method_is_used_to_detect_module_format_JS_files_1475", "Control what method is used to detect module-format JS files."), 5705 auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules: diag(1476, 3 /* Message */, "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476", '"auto": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.'), 5706 An_instantiation_expression_cannot_be_followed_by_a_property_access: diag(1477, 1 /* Error */, "An_instantiation_expression_cannot_be_followed_by_a_property_access_1477", "An instantiation expression cannot be followed by a property access."), 5707 Identifier_or_string_literal_expected: diag(1478, 1 /* Error */, "Identifier_or_string_literal_expected_1478", "Identifier or string literal expected."), 5708 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: diag(1479, 1 /* Error */, "The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479", `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.`), 5709 To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_package_json_file_with_type_Colon_module: diag(1480, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480", 'To convert this file to an ECMAScript module, change its file extension to \'{0}\' or create a local package.json file with `{ "type": "module" }`.'), 5710 To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Colon_module_to_1: diag(1481, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481", `To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field \`"type": "module"\` to '{1}'.`), 5711 To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0: diag(1482, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482", 'To convert this file to an ECMAScript module, add the field `"type": "module"` to \'{0}\'.'), 5712 To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'), 5713 The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."), 5714 The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."), 5715 Call_signature_return_types_0_and_1_are_incompatible: diag(2202, 1 /* Error */, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", void 0, true), 5716 Construct_signature_return_types_0_and_1_are_incompatible: diag(2203, 1 /* Error */, "Construct_signature_return_types_0_and_1_are_incompatible_2203", "Construct signature return types '{0}' and '{1}' are incompatible.", void 0, true), 5717 Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2204, 1 /* Error */, "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204", "Call signatures with no arguments have incompatible return types '{0}' and '{1}'.", void 0, true), 5718 Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2205, 1 /* Error */, "Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205", "Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.", void 0, true), 5719 The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement: diag(2206, 1 /* Error */, "The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206", "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."), 5720 The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement: diag(2207, 1 /* Error */, "The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207", "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."), 5721 This_type_parameter_might_need_an_extends_0_constraint: diag(2208, 1 /* Error */, "This_type_parameter_might_need_an_extends_0_constraint_2208", "This type parameter might need an `extends {0}` constraint."), 5722 The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2209, 1 /* Error */, "The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209", "The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."), 5723 The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2210, 1 /* Error */, "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210", "The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."), 5724 Add_extends_constraint: diag(2211, 3 /* Message */, "Add_extends_constraint_2211", "Add `extends` constraint."), 5725 Add_extends_constraint_to_all_type_parameters: diag(2212, 3 /* Message */, "Add_extends_constraint_to_all_type_parameters_2212", "Add `extends` constraint to all type parameters"), 5726 Duplicate_identifier_0: diag(2300, 1 /* Error */, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."), 5727 Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, 1 /* Error */, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), 5728 Static_members_cannot_reference_class_type_parameters: diag(2302, 1 /* Error */, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."), 5729 Circular_definition_of_import_alias_0: diag(2303, 1 /* Error */, "Circular_definition_of_import_alias_0_2303", "Circular definition of import alias '{0}'."), 5730 Cannot_find_name_0: diag(2304, 1 /* Error */, "Cannot_find_name_0_2304", "Cannot find name '{0}'."), 5731 Module_0_has_no_exported_member_1: diag(2305, 1 /* Error */, "Module_0_has_no_exported_member_1_2305", "Module '{0}' has no exported member '{1}'."), 5732 File_0_is_not_a_module: diag(2306, 1 /* Error */, "File_0_is_not_a_module_2306", "File '{0}' is not a module."), 5733 Cannot_find_module_0_or_its_corresponding_type_declarations: diag(2307, 1 /* Error */, "Cannot_find_module_0_or_its_corresponding_type_declarations_2307", "Cannot find module '{0}' or its corresponding type declarations."), 5734 Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: diag(2308, 1 /* Error */, "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308", "Module {0} has already exported a member named '{1}'. Consider explicitly re-exporting to resolve the ambiguity."), 5735 An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: diag(2309, 1 /* Error */, "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309", "An export assignment cannot be used in a module with other exported elements."), 5736 Type_0_recursively_references_itself_as_a_base_type: diag(2310, 1 /* Error */, "Type_0_recursively_references_itself_as_a_base_type_2310", "Type '{0}' recursively references itself as a base type."), 5737 Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function: diag(2311, 1 /* Error */, "Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function_2311", "Cannot find name '{0}'. Did you mean to write this in an async function?"), 5738 An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2312, 1 /* Error */, "An_interface_can_only_extend_an_object_type_or_intersection_of_object_types_with_statically_known_me_2312", "An interface can only extend an object type or intersection of object types with statically known members."), 5739 Type_parameter_0_has_a_circular_constraint: diag(2313, 1 /* Error */, "Type_parameter_0_has_a_circular_constraint_2313", "Type parameter '{0}' has a circular constraint."), 5740 Generic_type_0_requires_1_type_argument_s: diag(2314, 1 /* Error */, "Generic_type_0_requires_1_type_argument_s_2314", "Generic type '{0}' requires {1} type argument(s)."), 5741 Type_0_is_not_generic: diag(2315, 1 /* Error */, "Type_0_is_not_generic_2315", "Type '{0}' is not generic."), 5742 Global_type_0_must_be_a_class_or_interface_type: diag(2316, 1 /* Error */, "Global_type_0_must_be_a_class_or_interface_type_2316", "Global type '{0}' must be a class or interface type."), 5743 Global_type_0_must_have_1_type_parameter_s: diag(2317, 1 /* Error */, "Global_type_0_must_have_1_type_parameter_s_2317", "Global type '{0}' must have {1} type parameter(s)."), 5744 Cannot_find_global_type_0: diag(2318, 1 /* Error */, "Cannot_find_global_type_0_2318", "Cannot find global type '{0}'."), 5745 Named_property_0_of_types_1_and_2_are_not_identical: diag(2319, 1 /* Error */, "Named_property_0_of_types_1_and_2_are_not_identical_2319", "Named property '{0}' of types '{1}' and '{2}' are not identical."), 5746 Interface_0_cannot_simultaneously_extend_types_1_and_2: diag(2320, 1 /* Error */, "Interface_0_cannot_simultaneously_extend_types_1_and_2_2320", "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'."), 5747 Excessive_stack_depth_comparing_types_0_and_1: diag(2321, 1 /* Error */, "Excessive_stack_depth_comparing_types_0_and_1_2321", "Excessive stack depth comparing types '{0}' and '{1}'."), 5748 Type_0_is_not_assignable_to_type_1: diag(2322, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_2322", "Type '{0}' is not assignable to type '{1}'."), 5749 Cannot_redeclare_exported_variable_0: diag(2323, 1 /* Error */, "Cannot_redeclare_exported_variable_0_2323", "Cannot redeclare exported variable '{0}'."), 5750 Property_0_is_missing_in_type_1: diag(2324, 1 /* Error */, "Property_0_is_missing_in_type_1_2324", "Property '{0}' is missing in type '{1}'."), 5751 Property_0_is_private_in_type_1_but_not_in_type_2: diag(2325, 1 /* Error */, "Property_0_is_private_in_type_1_but_not_in_type_2_2325", "Property '{0}' is private in type '{1}' but not in type '{2}'."), 5752 Types_of_property_0_are_incompatible: diag(2326, 1 /* Error */, "Types_of_property_0_are_incompatible_2326", "Types of property '{0}' are incompatible."), 5753 Property_0_is_optional_in_type_1_but_required_in_type_2: diag(2327, 1 /* Error */, "Property_0_is_optional_in_type_1_but_required_in_type_2_2327", "Property '{0}' is optional in type '{1}' but required in type '{2}'."), 5754 Types_of_parameters_0_and_1_are_incompatible: diag(2328, 1 /* Error */, "Types_of_parameters_0_and_1_are_incompatible_2328", "Types of parameters '{0}' and '{1}' are incompatible."), 5755 Index_signature_for_type_0_is_missing_in_type_1: diag(2329, 1 /* Error */, "Index_signature_for_type_0_is_missing_in_type_1_2329", "Index signature for type '{0}' is missing in type '{1}'."), 5756 _0_and_1_index_signatures_are_incompatible: diag(2330, 1 /* Error */, "_0_and_1_index_signatures_are_incompatible_2330", "'{0}' and '{1}' index signatures are incompatible."), 5757 this_cannot_be_referenced_in_a_module_or_namespace_body: diag(2331, 1 /* Error */, "this_cannot_be_referenced_in_a_module_or_namespace_body_2331", "'this' cannot be referenced in a module or namespace body."), 5758 this_cannot_be_referenced_in_current_location: diag(2332, 1 /* Error */, "this_cannot_be_referenced_in_current_location_2332", "'this' cannot be referenced in current location."), 5759 this_cannot_be_referenced_in_constructor_arguments: diag(2333, 1 /* Error */, "this_cannot_be_referenced_in_constructor_arguments_2333", "'this' cannot be referenced in constructor arguments."), 5760 this_cannot_be_referenced_in_a_static_property_initializer: diag(2334, 1 /* Error */, "this_cannot_be_referenced_in_a_static_property_initializer_2334", "'this' cannot be referenced in a static property initializer."), 5761 super_can_only_be_referenced_in_a_derived_class: diag(2335, 1 /* Error */, "super_can_only_be_referenced_in_a_derived_class_2335", "'super' can only be referenced in a derived class."), 5762 super_cannot_be_referenced_in_constructor_arguments: diag(2336, 1 /* Error */, "super_cannot_be_referenced_in_constructor_arguments_2336", "'super' cannot be referenced in constructor arguments."), 5763 Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: diag(2337, 1 /* Error */, "Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors_2337", "Super calls are not permitted outside constructors or in nested functions inside constructors."), 5764 super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: diag(2338, 1 /* Error */, "super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_der_2338", "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class."), 5765 Property_0_does_not_exist_on_type_1: diag(2339, 1 /* Error */, "Property_0_does_not_exist_on_type_1_2339", "Property '{0}' does not exist on type '{1}'."), 5766 Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: diag(2340, 1 /* Error */, "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340", "Only public and protected methods of the base class are accessible via the 'super' keyword."), 5767 Property_0_is_private_and_only_accessible_within_class_1: diag(2341, 1 /* Error */, "Property_0_is_private_and_only_accessible_within_class_1_2341", "Property '{0}' is private and only accessible within class '{1}'."), 5768 This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0: diag(2343, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343", "This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."), 5769 Type_0_does_not_satisfy_the_constraint_1: diag(2344, 1 /* Error */, "Type_0_does_not_satisfy_the_constraint_1_2344", "Type '{0}' does not satisfy the constraint '{1}'."), 5770 Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: diag(2345, 1 /* Error */, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345", "Argument of type '{0}' is not assignable to parameter of type '{1}'."), 5771 Call_target_does_not_contain_any_signatures: diag(2346, 1 /* Error */, "Call_target_does_not_contain_any_signatures_2346", "Call target does not contain any signatures."), 5772 Untyped_function_calls_may_not_accept_type_arguments: diag(2347, 1 /* Error */, "Untyped_function_calls_may_not_accept_type_arguments_2347", "Untyped function calls may not accept type arguments."), 5773 Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: diag(2348, 1 /* Error */, "Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348", "Value of type '{0}' is not callable. Did you mean to include 'new'?"), 5774 This_expression_is_not_callable: diag(2349, 1 /* Error */, "This_expression_is_not_callable_2349", "This expression is not callable."), 5775 Only_a_void_function_can_be_called_with_the_new_keyword: diag(2350, 1 /* Error */, "Only_a_void_function_can_be_called_with_the_new_keyword_2350", "Only a void function can be called with the 'new' keyword."), 5776 This_expression_is_not_constructable: diag(2351, 1 /* Error */, "This_expression_is_not_constructable_2351", "This expression is not constructable."), 5777 Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first: diag(2352, 1 /* Error */, "Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the__2352", "Conversion of type '{0}' to type '{1}' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first."), 5778 Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: diag(2353, 1 /* Error */, "Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1_2353", "Object literal may only specify known properties, and '{0}' does not exist in type '{1}'."), 5779 This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found: diag(2354, 1 /* Error */, "This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354", "This syntax requires an imported helper but module '{0}' cannot be found."), 5780 A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value: diag(2355, 1 /* Error */, "A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_2355", "A function whose declared type is neither 'void' nor 'any' must return a value."), 5781 An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2356, 1 /* Error */, "An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type_2356", "An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type."), 5782 The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: diag(2357, 1 /* Error */, "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", "The operand of an increment or decrement operator must be a variable or a property access."), 5783 The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: diag(2358, 1 /* Error */, "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."), 5784 The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: diag(2359, 1 /* Error */, "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."), 5785 The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2362, 1 /* Error */, "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362", "The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."), 5786 The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2363, 1 /* Error */, "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363", "The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."), 5787 The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: diag(2364, 1 /* Error */, "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", "The left-hand side of an assignment expression must be a variable or a property access."), 5788 Operator_0_cannot_be_applied_to_types_1_and_2: diag(2365, 1 /* Error */, "Operator_0_cannot_be_applied_to_types_1_and_2_2365", "Operator '{0}' cannot be applied to types '{1}' and '{2}'."), 5789 Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: diag(2366, 1 /* Error */, "Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366", "Function lacks ending return statement and return type does not include 'undefined'."), 5790 This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap: diag(2367, 1 /* Error */, "This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap_2367", "This comparison appears to be unintentional because the types '{0}' and '{1}' have no overlap."), 5791 Type_parameter_name_cannot_be_0: diag(2368, 1 /* Error */, "Type_parameter_name_cannot_be_0_2368", "Type parameter name cannot be '{0}'."), 5792 A_parameter_property_is_only_allowed_in_a_constructor_implementation: diag(2369, 1 /* Error */, "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369", "A parameter property is only allowed in a constructor implementation."), 5793 A_rest_parameter_must_be_of_an_array_type: diag(2370, 1 /* Error */, "A_rest_parameter_must_be_of_an_array_type_2370", "A rest parameter must be of an array type."), 5794 A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: diag(2371, 1 /* Error */, "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371", "A parameter initializer is only allowed in a function or constructor implementation."), 5795 Parameter_0_cannot_reference_itself: diag(2372, 1 /* Error */, "Parameter_0_cannot_reference_itself_2372", "Parameter '{0}' cannot reference itself."), 5796 Parameter_0_cannot_reference_identifier_1_declared_after_it: diag(2373, 1 /* Error */, "Parameter_0_cannot_reference_identifier_1_declared_after_it_2373", "Parameter '{0}' cannot reference identifier '{1}' declared after it."), 5797 Duplicate_index_signature_for_type_0: diag(2374, 1 /* Error */, "Duplicate_index_signature_for_type_0_2374", "Duplicate index signature for type '{0}'."), 5798 Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties: diag(2375, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375", "Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."), 5799 A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers: diag(2376, 1 /* Error */, "A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_2376", "A 'super' call must be the first statement in the constructor to refer to 'super' or 'this' when a derived class contains initialized properties, parameter properties, or private identifiers."), 5800 Constructors_for_derived_classes_must_contain_a_super_call: diag(2377, 1 /* Error */, "Constructors_for_derived_classes_must_contain_a_super_call_2377", "Constructors for derived classes must contain a 'super' call."), 5801 A_get_accessor_must_return_a_value: diag(2378, 1 /* Error */, "A_get_accessor_must_return_a_value_2378", "A 'get' accessor must return a value."), 5802 Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties: diag(2379, 1 /* Error */, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379", "Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."), 5803 The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type: diag(2380, 1 /* Error */, "The_return_type_of_a_get_accessor_must_be_assignable_to_its_set_accessor_type_2380", "The return type of a 'get' accessor must be assignable to its 'set' accessor type"), 5804 Overload_signatures_must_all_be_exported_or_non_exported: diag(2383, 1 /* Error */, "Overload_signatures_must_all_be_exported_or_non_exported_2383", "Overload signatures must all be exported or non-exported."), 5805 Overload_signatures_must_all_be_ambient_or_non_ambient: diag(2384, 1 /* Error */, "Overload_signatures_must_all_be_ambient_or_non_ambient_2384", "Overload signatures must all be ambient or non-ambient."), 5806 Overload_signatures_must_all_be_public_private_or_protected: diag(2385, 1 /* Error */, "Overload_signatures_must_all_be_public_private_or_protected_2385", "Overload signatures must all be public, private or protected."), 5807 Overload_signatures_must_all_be_optional_or_required: diag(2386, 1 /* Error */, "Overload_signatures_must_all_be_optional_or_required_2386", "Overload signatures must all be optional or required."), 5808 Function_overload_must_be_static: diag(2387, 1 /* Error */, "Function_overload_must_be_static_2387", "Function overload must be static."), 5809 Function_overload_must_not_be_static: diag(2388, 1 /* Error */, "Function_overload_must_not_be_static_2388", "Function overload must not be static."), 5810 Function_implementation_name_must_be_0: diag(2389, 1 /* Error */, "Function_implementation_name_must_be_0_2389", "Function implementation name must be '{0}'."), 5811 Constructor_implementation_is_missing: diag(2390, 1 /* Error */, "Constructor_implementation_is_missing_2390", "Constructor implementation is missing."), 5812 Function_implementation_is_missing_or_not_immediately_following_the_declaration: diag(2391, 1 /* Error */, "Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391", "Function implementation is missing or not immediately following the declaration."), 5813 Multiple_constructor_implementations_are_not_allowed: diag(2392, 1 /* Error */, "Multiple_constructor_implementations_are_not_allowed_2392", "Multiple constructor implementations are not allowed."), 5814 Duplicate_function_implementation: diag(2393, 1 /* Error */, "Duplicate_function_implementation_2393", "Duplicate function implementation."), 5815 This_overload_signature_is_not_compatible_with_its_implementation_signature: diag(2394, 1 /* Error */, "This_overload_signature_is_not_compatible_with_its_implementation_signature_2394", "This overload signature is not compatible with its implementation signature."), 5816 Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: diag(2395, 1 /* Error */, "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395", "Individual declarations in merged declaration '{0}' must be all exported or all local."), 5817 Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: diag(2396, 1 /* Error */, "Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters_2396", "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters."), 5818 Declaration_name_conflicts_with_built_in_global_identifier_0: diag(2397, 1 /* Error */, "Declaration_name_conflicts_with_built_in_global_identifier_0_2397", "Declaration name conflicts with built-in global identifier '{0}'."), 5819 constructor_cannot_be_used_as_a_parameter_property_name: diag(2398, 1 /* Error */, "constructor_cannot_be_used_as_a_parameter_property_name_2398", "'constructor' cannot be used as a parameter property name."), 5820 Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: diag(2399, 1 /* Error */, "Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399", "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."), 5821 Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: diag(2400, 1 /* Error */, "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400", "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."), 5822 A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers: diag(2401, 1 /* Error */, "A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_in_2401", "A 'super' call must be a root-level statement within a constructor of a derived class that contains initialized properties, parameter properties, or private identifiers."), 5823 Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: diag(2402, 1 /* Error */, "Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402", "Expression resolves to '_super' that compiler uses to capture base class reference."), 5824 Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: diag(2403, 1 /* Error */, "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403", "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."), 5825 The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: diag(2404, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404", "The left-hand side of a 'for...in' statement cannot use a type annotation."), 5826 The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: diag(2405, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405", "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."), 5827 The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access: diag(2406, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access_2406", "The left-hand side of a 'for...in' statement must be a variable or a property access."), 5828 The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0: diag(2407, 1 /* Error */, "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_2407", "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type '{0}'."), 5829 Setters_cannot_return_a_value: diag(2408, 1 /* Error */, "Setters_cannot_return_a_value_2408", "Setters cannot return a value."), 5830 Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: diag(2409, 1 /* Error */, "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409", "Return type of constructor signature must be assignable to the instance type of the class."), 5831 The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any: diag(2410, 1 /* Error */, "The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any_2410", "The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'."), 5832 Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target: diag(2412, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2412", "Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target."), 5833 Property_0_of_type_1_is_not_assignable_to_2_index_type_3: diag(2411, 1 /* Error */, "Property_0_of_type_1_is_not_assignable_to_2_index_type_3_2411", "Property '{0}' of type '{1}' is not assignable to '{2}' index type '{3}'."), 5834 _0_index_type_1_is_not_assignable_to_2_index_type_3: diag(2413, 1 /* Error */, "_0_index_type_1_is_not_assignable_to_2_index_type_3_2413", "'{0}' index type '{1}' is not assignable to '{2}' index type '{3}'."), 5835 Class_name_cannot_be_0: diag(2414, 1 /* Error */, "Class_name_cannot_be_0_2414", "Class name cannot be '{0}'."), 5836 Class_0_incorrectly_extends_base_class_1: diag(2415, 1 /* Error */, "Class_0_incorrectly_extends_base_class_1_2415", "Class '{0}' incorrectly extends base class '{1}'."), 5837 Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, 1 /* Error */, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."), 5838 Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, 1 /* Error */, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), 5839 Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: diag(2418, 1 /* Error */, "Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1_2418", "Type of computed property's value is '{0}', which is not assignable to type '{1}'."), 5840 Types_of_construct_signatures_are_incompatible: diag(2419, 1 /* Error */, "Types_of_construct_signatures_are_incompatible_2419", "Types of construct signatures are incompatible."), 5841 Class_0_incorrectly_implements_interface_1: diag(2420, 1 /* Error */, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), 5842 A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2422, 1 /* Error */, "A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_memb_2422", "A class can only implement an object type or intersection of object types with statically known members."), 5843 Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2423, 1 /* Error */, "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_access_2423", "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor."), 5844 Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: diag(2425, 1 /* Error */, "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425", "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function."), 5845 Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: diag(2426, 1 /* Error */, "Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_functi_2426", "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function."), 5846 Interface_name_cannot_be_0: diag(2427, 1 /* Error */, "Interface_name_cannot_be_0_2427", "Interface name cannot be '{0}'."), 5847 All_declarations_of_0_must_have_identical_type_parameters: diag(2428, 1 /* Error */, "All_declarations_of_0_must_have_identical_type_parameters_2428", "All declarations of '{0}' must have identical type parameters."), 5848 Interface_0_incorrectly_extends_interface_1: diag(2430, 1 /* Error */, "Interface_0_incorrectly_extends_interface_1_2430", "Interface '{0}' incorrectly extends interface '{1}'."), 5849 Enum_name_cannot_be_0: diag(2431, 1 /* Error */, "Enum_name_cannot_be_0_2431", "Enum name cannot be '{0}'."), 5850 In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: diag(2432, 1 /* Error */, "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432", "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element."), 5851 A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: diag(2433, 1 /* Error */, "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433", "A namespace declaration cannot be in a different file from a class or function with which it is merged."), 5852 A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: diag(2434, 1 /* Error */, "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434", "A namespace declaration cannot be located prior to a class or function with which it is merged."), 5853 Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces: diag(2435, 1 /* Error */, "Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435", "Ambient modules cannot be nested in other modules or namespaces."), 5854 Ambient_module_declaration_cannot_specify_relative_module_name: diag(2436, 1 /* Error */, "Ambient_module_declaration_cannot_specify_relative_module_name_2436", "Ambient module declaration cannot specify relative module name."), 5855 Module_0_is_hidden_by_a_local_declaration_with_the_same_name: diag(2437, 1 /* Error */, "Module_0_is_hidden_by_a_local_declaration_with_the_same_name_2437", "Module '{0}' is hidden by a local declaration with the same name."), 5856 Import_name_cannot_be_0: diag(2438, 1 /* Error */, "Import_name_cannot_be_0_2438", "Import name cannot be '{0}'."), 5857 Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: diag(2439, 1 /* Error */, "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439", "Import or export declaration in an ambient module declaration cannot reference module through relative module name."), 5858 Import_declaration_conflicts_with_local_declaration_of_0: diag(2440, 1 /* Error */, "Import_declaration_conflicts_with_local_declaration_of_0_2440", "Import declaration conflicts with local declaration of '{0}'."), 5859 Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: diag(2441, 1 /* Error */, "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_2441", "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module."), 5860 Types_have_separate_declarations_of_a_private_property_0: diag(2442, 1 /* Error */, "Types_have_separate_declarations_of_a_private_property_0_2442", "Types have separate declarations of a private property '{0}'."), 5861 Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: diag(2443, 1 /* Error */, "Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2_2443", "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'."), 5862 Property_0_is_protected_in_type_1_but_public_in_type_2: diag(2444, 1 /* Error */, "Property_0_is_protected_in_type_1_but_public_in_type_2_2444", "Property '{0}' is protected in type '{1}' but public in type '{2}'."), 5863 Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: diag(2445, 1 /* Error */, "Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses_2445", "Property '{0}' is protected and only accessible within class '{1}' and its subclasses."), 5864 Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_class_2: diag(2446, 1 /* Error */, "Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1_This_is_an_instance_of_cl_2446", "Property '{0}' is protected and only accessible through an instance of class '{1}'. This is an instance of class '{2}'."), 5865 The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: diag(2447, 1 /* Error */, "The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead_2447", "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead."), 5866 Block_scoped_variable_0_used_before_its_declaration: diag(2448, 1 /* Error */, "Block_scoped_variable_0_used_before_its_declaration_2448", "Block-scoped variable '{0}' used before its declaration."), 5867 Class_0_used_before_its_declaration: diag(2449, 1 /* Error */, "Class_0_used_before_its_declaration_2449", "Class '{0}' used before its declaration."), 5868 Enum_0_used_before_its_declaration: diag(2450, 1 /* Error */, "Enum_0_used_before_its_declaration_2450", "Enum '{0}' used before its declaration."), 5869 Cannot_redeclare_block_scoped_variable_0: diag(2451, 1 /* Error */, "Cannot_redeclare_block_scoped_variable_0_2451", "Cannot redeclare block-scoped variable '{0}'."), 5870 An_enum_member_cannot_have_a_numeric_name: diag(2452, 1 /* Error */, "An_enum_member_cannot_have_a_numeric_name_2452", "An enum member cannot have a numeric name."), 5871 Variable_0_is_used_before_being_assigned: diag(2454, 1 /* Error */, "Variable_0_is_used_before_being_assigned_2454", "Variable '{0}' is used before being assigned."), 5872 Type_alias_0_circularly_references_itself: diag(2456, 1 /* Error */, "Type_alias_0_circularly_references_itself_2456", "Type alias '{0}' circularly references itself."), 5873 Type_alias_name_cannot_be_0: diag(2457, 1 /* Error */, "Type_alias_name_cannot_be_0_2457", "Type alias name cannot be '{0}'."), 5874 An_AMD_module_cannot_have_multiple_name_assignments: diag(2458, 1 /* Error */, "An_AMD_module_cannot_have_multiple_name_assignments_2458", "An AMD module cannot have multiple name assignments."), 5875 Module_0_declares_1_locally_but_it_is_not_exported: diag(2459, 1 /* Error */, "Module_0_declares_1_locally_but_it_is_not_exported_2459", "Module '{0}' declares '{1}' locally, but it is not exported."), 5876 Module_0_declares_1_locally_but_it_is_exported_as_2: diag(2460, 1 /* Error */, "Module_0_declares_1_locally_but_it_is_exported_as_2_2460", "Module '{0}' declares '{1}' locally, but it is exported as '{2}'."), 5877 Type_0_is_not_an_array_type: diag(2461, 1 /* Error */, "Type_0_is_not_an_array_type_2461", "Type '{0}' is not an array type."), 5878 A_rest_element_must_be_last_in_a_destructuring_pattern: diag(2462, 1 /* Error */, "A_rest_element_must_be_last_in_a_destructuring_pattern_2462", "A rest element must be last in a destructuring pattern."), 5879 A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: diag(2463, 1 /* Error */, "A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature_2463", "A binding pattern parameter cannot be optional in an implementation signature."), 5880 A_computed_property_name_must_be_of_type_string_number_symbol_or_any: diag(2464, 1 /* Error */, "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464", "A computed property name must be of type 'string', 'number', 'symbol', or 'any'."), 5881 this_cannot_be_referenced_in_a_computed_property_name: diag(2465, 1 /* Error */, "this_cannot_be_referenced_in_a_computed_property_name_2465", "'this' cannot be referenced in a computed property name."), 5882 super_cannot_be_referenced_in_a_computed_property_name: diag(2466, 1 /* Error */, "super_cannot_be_referenced_in_a_computed_property_name_2466", "'super' cannot be referenced in a computed property name."), 5883 A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: diag(2467, 1 /* Error */, "A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467", "A computed property name cannot reference a type parameter from its containing type."), 5884 Cannot_find_global_value_0: diag(2468, 1 /* Error */, "Cannot_find_global_value_0_2468", "Cannot find global value '{0}'."), 5885 The_0_operator_cannot_be_applied_to_type_symbol: diag(2469, 1 /* Error */, "The_0_operator_cannot_be_applied_to_type_symbol_2469", "The '{0}' operator cannot be applied to type 'symbol'."), 5886 Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: diag(2472, 1 /* Error */, "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472", "Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."), 5887 Enum_declarations_must_all_be_const_or_non_const: diag(2473, 1 /* Error */, "Enum_declarations_must_all_be_const_or_non_const_2473", "Enum declarations must all be const or non-const."), 5888 const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values: diag(2474, 1 /* Error */, "const_enum_member_initializers_can_only_contain_literal_values_and_other_computed_enum_values_2474", "const enum member initializers can only contain literal values and other computed enum values."), 5889 const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query: diag(2475, 1 /* Error */, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."), 5890 A_const_enum_member_can_only_be_accessed_using_a_string_literal: diag(2476, 1 /* Error */, "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476", "A const enum member can only be accessed using a string literal."), 5891 const_enum_member_initializer_was_evaluated_to_a_non_finite_value: diag(2477, 1 /* Error */, "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477", "'const' enum member initializer was evaluated to a non-finite value."), 5892 const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: diag(2478, 1 /* Error */, "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478", "'const' enum member initializer was evaluated to disallowed value 'NaN'."), 5893 let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: diag(2480, 1 /* Error */, "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480", "'let' is not allowed to be used as a name in 'let' or 'const' declarations."), 5894 Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: diag(2481, 1 /* Error */, "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481", "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'."), 5895 The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: diag(2483, 1 /* Error */, "The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483", "The left-hand side of a 'for...of' statement cannot use a type annotation."), 5896 Export_declaration_conflicts_with_exported_declaration_of_0: diag(2484, 1 /* Error */, "Export_declaration_conflicts_with_exported_declaration_of_0_2484", "Export declaration conflicts with exported declaration of '{0}'."), 5897 The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access: diag(2487, 1 /* Error */, "The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487", "The left-hand side of a 'for...of' statement must be a variable or a property access."), 5898 Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2488, 1 /* Error */, "Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator_2488", "Type '{0}' must have a '[Symbol.iterator]()' method that returns an iterator."), 5899 An_iterator_must_have_a_next_method: diag(2489, 1 /* Error */, "An_iterator_must_have_a_next_method_2489", "An iterator must have a 'next()' method."), 5900 The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property: diag(2490, 1 /* Error */, "The_type_returned_by_the_0_method_of_an_iterator_must_have_a_value_property_2490", "The type returned by the '{0}()' method of an iterator must have a 'value' property."), 5901 The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: diag(2491, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern_2491", "The left-hand side of a 'for...in' statement cannot be a destructuring pattern."), 5902 Cannot_redeclare_identifier_0_in_catch_clause: diag(2492, 1 /* Error */, "Cannot_redeclare_identifier_0_in_catch_clause_2492", "Cannot redeclare identifier '{0}' in catch clause."), 5903 Tuple_type_0_of_length_1_has_no_element_at_index_2: diag(2493, 1 /* Error */, "Tuple_type_0_of_length_1_has_no_element_at_index_2_2493", "Tuple type '{0}' of length '{1}' has no element at index '{2}'."), 5904 Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: diag(2494, 1 /* Error */, "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494", "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher."), 5905 Type_0_is_not_an_array_type_or_a_string_type: diag(2495, 1 /* Error */, "Type_0_is_not_an_array_type_or_a_string_type_2495", "Type '{0}' is not an array type or a string type."), 5906 The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: diag(2496, 1 /* Error */, "The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_stand_2496", "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression."), 5907 This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_referencing_its_default_export: diag(2497, 1 /* Error */, "This_module_can_only_be_referenced_with_ECMAScript_imports_Slashexports_by_turning_on_the_0_flag_and_2497", "This module can only be referenced with ECMAScript imports/exports by turning on the '{0}' flag and referencing its default export."), 5908 Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: diag(2498, 1 /* Error */, "Module_0_uses_export_and_cannot_be_used_with_export_Asterisk_2498", "Module '{0}' uses 'export =' and cannot be used with 'export *'."), 5909 An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: diag(2499, 1 /* Error */, "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499", "An interface can only extend an identifier/qualified-name with optional type arguments."), 5910 A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: diag(2500, 1 /* Error */, "A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments_2500", "A class can only implement an identifier/qualified-name with optional type arguments."), 5911 A_rest_element_cannot_contain_a_binding_pattern: diag(2501, 1 /* Error */, "A_rest_element_cannot_contain_a_binding_pattern_2501", "A rest element cannot contain a binding pattern."), 5912 _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: diag(2502, 1 /* Error */, "_0_is_referenced_directly_or_indirectly_in_its_own_type_annotation_2502", "'{0}' is referenced directly or indirectly in its own type annotation."), 5913 Cannot_find_namespace_0: diag(2503, 1 /* Error */, "Cannot_find_namespace_0_2503", "Cannot find namespace '{0}'."), 5914 Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator: diag(2504, 1 /* Error */, "Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator_2504", "Type '{0}' must have a '[Symbol.asyncIterator]()' method that returns an async iterator."), 5915 A_generator_cannot_have_a_void_type_annotation: diag(2505, 1 /* Error */, "A_generator_cannot_have_a_void_type_annotation_2505", "A generator cannot have a 'void' type annotation."), 5916 _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: diag(2506, 1 /* Error */, "_0_is_referenced_directly_or_indirectly_in_its_own_base_expression_2506", "'{0}' is referenced directly or indirectly in its own base expression."), 5917 Type_0_is_not_a_constructor_function_type: diag(2507, 1 /* Error */, "Type_0_is_not_a_constructor_function_type_2507", "Type '{0}' is not a constructor function type."), 5918 No_base_constructor_has_the_specified_number_of_type_arguments: diag(2508, 1 /* Error */, "No_base_constructor_has_the_specified_number_of_type_arguments_2508", "No base constructor has the specified number of type arguments."), 5919 Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_known_members: diag(2509, 1 /* Error */, "Base_constructor_return_type_0_is_not_an_object_type_or_intersection_of_object_types_with_statically_2509", "Base constructor return type '{0}' is not an object type or intersection of object types with statically known members."), 5920 Base_constructors_must_all_have_the_same_return_type: diag(2510, 1 /* Error */, "Base_constructors_must_all_have_the_same_return_type_2510", "Base constructors must all have the same return type."), 5921 Cannot_create_an_instance_of_an_abstract_class: diag(2511, 1 /* Error */, "Cannot_create_an_instance_of_an_abstract_class_2511", "Cannot create an instance of an abstract class."), 5922 Overload_signatures_must_all_be_abstract_or_non_abstract: diag(2512, 1 /* Error */, "Overload_signatures_must_all_be_abstract_or_non_abstract_2512", "Overload signatures must all be abstract or non-abstract."), 5923 Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression: diag(2513, 1 /* Error */, "Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513", "Abstract method '{0}' in class '{1}' cannot be accessed via super expression."), 5924 A_tuple_type_cannot_be_indexed_with_a_negative_value: diag(2514, 1 /* Error */, "A_tuple_type_cannot_be_indexed_with_a_negative_value_2514", "A tuple type cannot be indexed with a negative value."), 5925 Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: diag(2515, 1 /* Error */, "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515", "Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'."), 5926 All_declarations_of_an_abstract_method_must_be_consecutive: diag(2516, 1 /* Error */, "All_declarations_of_an_abstract_method_must_be_consecutive_2516", "All declarations of an abstract method must be consecutive."), 5927 Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: diag(2517, 1 /* Error */, "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", "Cannot assign an abstract constructor type to a non-abstract constructor type."), 5928 A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: diag(2518, 1 /* Error */, "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", "A 'this'-based type guard is not compatible with a parameter-based type guard."), 5929 An_async_iterator_must_have_a_next_method: diag(2519, 1 /* Error */, "An_async_iterator_must_have_a_next_method_2519", "An async iterator must have a 'next()' method."), 5930 Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: diag(2520, 1 /* Error */, "Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions_2520", "Duplicate identifier '{0}'. Compiler uses declaration '{1}' to support async functions."), 5931 The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method: diag(2522, 1 /* Error */, "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522", "The 'arguments' object cannot be referenced in an async function or method in ES3 and ES5. Consider using a standard function or method."), 5932 yield_expressions_cannot_be_used_in_a_parameter_initializer: diag(2523, 1 /* Error */, "yield_expressions_cannot_be_used_in_a_parameter_initializer_2523", "'yield' expressions cannot be used in a parameter initializer."), 5933 await_expressions_cannot_be_used_in_a_parameter_initializer: diag(2524, 1 /* Error */, "await_expressions_cannot_be_used_in_a_parameter_initializer_2524", "'await' expressions cannot be used in a parameter initializer."), 5934 Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value: diag(2525, 1 /* Error */, "Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525", "Initializer provides no value for this binding element and the binding element has no default value."), 5935 A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface: diag(2526, 1 /* Error */, "A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface_2526", "A 'this' type is available only in a non-static member of a class or interface."), 5936 The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary: diag(2527, 1 /* Error */, "The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary_2527", "The inferred type of '{0}' references an inaccessible '{1}' type. A type annotation is necessary."), 5937 A_module_cannot_have_multiple_default_exports: diag(2528, 1 /* Error */, "A_module_cannot_have_multiple_default_exports_2528", "A module cannot have multiple default exports."), 5938 Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions: diag(2529, 1 /* Error */, "Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_func_2529", "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module containing async functions."), 5939 Property_0_is_incompatible_with_index_signature: diag(2530, 1 /* Error */, "Property_0_is_incompatible_with_index_signature_2530", "Property '{0}' is incompatible with index signature."), 5940 Object_is_possibly_null: diag(2531, 1 /* Error */, "Object_is_possibly_null_2531", "Object is possibly 'null'."), 5941 Object_is_possibly_undefined: diag(2532, 1 /* Error */, "Object_is_possibly_undefined_2532", "Object is possibly 'undefined'."), 5942 Object_is_possibly_null_or_undefined: diag(2533, 1 /* Error */, "Object_is_possibly_null_or_undefined_2533", "Object is possibly 'null' or 'undefined'."), 5943 A_function_returning_never_cannot_have_a_reachable_end_point: diag(2534, 1 /* Error */, "A_function_returning_never_cannot_have_a_reachable_end_point_2534", "A function returning 'never' cannot have a reachable end point."), 5944 Enum_type_0_has_members_with_initializers_that_are_not_literals: diag(2535, 1 /* Error */, "Enum_type_0_has_members_with_initializers_that_are_not_literals_2535", "Enum type '{0}' has members with initializers that are not literals."), 5945 Type_0_cannot_be_used_to_index_type_1: diag(2536, 1 /* Error */, "Type_0_cannot_be_used_to_index_type_1_2536", "Type '{0}' cannot be used to index type '{1}'."), 5946 Type_0_has_no_matching_index_signature_for_type_1: diag(2537, 1 /* Error */, "Type_0_has_no_matching_index_signature_for_type_1_2537", "Type '{0}' has no matching index signature for type '{1}'."), 5947 Type_0_cannot_be_used_as_an_index_type: diag(2538, 1 /* Error */, "Type_0_cannot_be_used_as_an_index_type_2538", "Type '{0}' cannot be used as an index type."), 5948 Cannot_assign_to_0_because_it_is_not_a_variable: diag(2539, 1 /* Error */, "Cannot_assign_to_0_because_it_is_not_a_variable_2539", "Cannot assign to '{0}' because it is not a variable."), 5949 Cannot_assign_to_0_because_it_is_a_read_only_property: diag(2540, 1 /* Error */, "Cannot_assign_to_0_because_it_is_a_read_only_property_2540", "Cannot assign to '{0}' because it is a read-only property."), 5950 Index_signature_in_type_0_only_permits_reading: diag(2542, 1 /* Error */, "Index_signature_in_type_0_only_permits_reading_2542", "Index signature in type '{0}' only permits reading."), 5951 Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: diag(2543, 1 /* Error */, "Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_me_2543", "Duplicate identifier '_newTarget'. Compiler uses variable declaration '_newTarget' to capture 'new.target' meta-property reference."), 5952 Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference: diag(2544, 1 /* Error */, "Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544", "Expression resolves to variable declaration '_newTarget' that compiler uses to capture 'new.target' meta-property reference."), 5953 A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any: diag(2545, 1 /* Error */, "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545", "A mixin class must have a constructor with a single rest parameter of type 'any[]'."), 5954 The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: diag(2547, 1 /* Error */, "The_type_returned_by_the_0_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_pro_2547", "The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property."), 5955 Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2548, 1 /* Error */, "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548", "Type '{0}' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator."), 5956 Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: diag(2549, 1 /* Error */, "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549", "Type '{0}' is not an array type or a string type or does not have a '[Symbol.iterator]()' method that returns an iterator."), 5957 Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2_or_later: diag(2550, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Do_you_need_to_change_your_target_library_Try_changing_the_lib_c_2550", "Property '{0}' does not exist on type '{1}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{2}' or later."), 5958 Property_0_does_not_exist_on_type_1_Did_you_mean_2: diag(2551, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551", "Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?"), 5959 Cannot_find_name_0_Did_you_mean_1: diag(2552, 1 /* Error */, "Cannot_find_name_0_Did_you_mean_1_2552", "Cannot find name '{0}'. Did you mean '{1}'?"), 5960 Computed_values_are_not_permitted_in_an_enum_with_string_valued_members: diag(2553, 1 /* Error */, "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553", "Computed values are not permitted in an enum with string valued members."), 5961 Expected_0_arguments_but_got_1: diag(2554, 1 /* Error */, "Expected_0_arguments_but_got_1_2554", "Expected {0} arguments, but got {1}."), 5962 Expected_at_least_0_arguments_but_got_1: diag(2555, 1 /* Error */, "Expected_at_least_0_arguments_but_got_1_2555", "Expected at least {0} arguments, but got {1}."), 5963 A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter: diag(2556, 1 /* Error */, "A_spread_argument_must_either_have_a_tuple_type_or_be_passed_to_a_rest_parameter_2556", "A spread argument must either have a tuple type or be passed to a rest parameter."), 5964 Expected_0_type_arguments_but_got_1: diag(2558, 1 /* Error */, "Expected_0_type_arguments_but_got_1_2558", "Expected {0} type arguments, but got {1}."), 5965 Type_0_has_no_properties_in_common_with_type_1: diag(2559, 1 /* Error */, "Type_0_has_no_properties_in_common_with_type_1_2559", "Type '{0}' has no properties in common with type '{1}'."), 5966 Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it: diag(2560, 1 /* Error */, "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560", "Value of type '{0}' has no properties in common with type '{1}'. Did you mean to call it?"), 5967 Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2: diag(2561, 1 /* Error */, "Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_writ_2561", "Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?"), 5968 Base_class_expressions_cannot_reference_class_type_parameters: diag(2562, 1 /* Error */, "Base_class_expressions_cannot_reference_class_type_parameters_2562", "Base class expressions cannot reference class type parameters."), 5969 The_containing_function_or_module_body_is_too_large_for_control_flow_analysis: diag(2563, 1 /* Error */, "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563", "The containing function or module body is too large for control flow analysis."), 5970 Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: diag(2564, 1 /* Error */, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564", "Property '{0}' has no initializer and is not definitely assigned in the constructor."), 5971 Property_0_is_used_before_being_assigned: diag(2565, 1 /* Error */, "Property_0_is_used_before_being_assigned_2565", "Property '{0}' is used before being assigned."), 5972 A_rest_element_cannot_have_a_property_name: diag(2566, 1 /* Error */, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."), 5973 Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, 1 /* Error */, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."), 5974 Property_0_may_not_exist_on_type_1_Did_you_mean_2: diag(2568, 1 /* Error */, "Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568", "Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"), 5975 Could_not_find_name_0_Did_you_mean_1: diag(2570, 1 /* Error */, "Could_not_find_name_0_Did_you_mean_1_2570", "Could not find name '{0}'. Did you mean '{1}'?"), 5976 Object_is_of_type_unknown: diag(2571, 1 /* Error */, "Object_is_of_type_unknown_2571", "Object is of type 'unknown'."), 5977 A_rest_element_type_must_be_an_array_type: diag(2574, 1 /* Error */, "A_rest_element_type_must_be_an_array_type_2574", "A rest element type must be an array type."), 5978 No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments: diag(2575, 1 /* Error */, "No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments_2575", "No overload expects {0} arguments, but overloads do exist that expect either {1} or {2} arguments."), 5979 Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead: diag(2576, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Did_you_mean_to_access_the_static_member_2_instead_2576", "Property '{0}' does not exist on type '{1}'. Did you mean to access the static member '{2}' instead?"), 5980 Return_type_annotation_circularly_references_itself: diag(2577, 1 /* Error */, "Return_type_annotation_circularly_references_itself_2577", "Return type annotation circularly references itself."), 5981 Unused_ts_expect_error_directive: diag(2578, 1 /* Error */, "Unused_ts_expect_error_directive_2578", "Unused '@ts-expect-error' directive."), 5982 Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode: diag(2580, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2580", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`."), 5983 Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery: diag(2581, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2581", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`."), 5984 Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha: diag(2582, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2582", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha`."), 5985 Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later: diag(2583, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2583", "Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to '{1}' or later."), 5986 Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom: diag(2584, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_2584", "Cannot find name '{0}'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'."), 5987 _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later: diag(2585, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_2585", "'{0}' only refers to a type, but is being used as a value here. Do you need to change your target library? Try changing the 'lib' compiler option to es2015 or later."), 5988 Cannot_assign_to_0_because_it_is_a_constant: diag(2588, 1 /* Error */, "Cannot_assign_to_0_because_it_is_a_constant_2588", "Cannot assign to '{0}' because it is a constant."), 5989 Type_instantiation_is_excessively_deep_and_possibly_infinite: diag(2589, 1 /* Error */, "Type_instantiation_is_excessively_deep_and_possibly_infinite_2589", "Type instantiation is excessively deep and possibly infinite."), 5990 Expression_produces_a_union_type_that_is_too_complex_to_represent: diag(2590, 1 /* Error */, "Expression_produces_a_union_type_that_is_too_complex_to_represent_2590", "Expression produces a union type that is too complex to represent."), 5991 Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig: diag(2591, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashno_2591", "Cannot find name '{0}'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig."), 5992 Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig: diag(2592, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slash_2592", "Cannot find name '{0}'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery` and then add 'jquery' to the types field in your tsconfig."), 5993 Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig: diag(2593, 1 /* Error */, "Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_type_2593", "Cannot find name '{0}'. Do you need to install type definitions for a test runner? Try `npm i --save-dev @types/jest` or `npm i --save-dev @types/mocha` and then add 'jest' or 'mocha' to the types field in your tsconfig."), 5994 This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag: diag(2594, 1 /* Error */, "This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594", "This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag."), 5995 _0_can_only_be_imported_by_using_a_default_import: diag(2595, 1 /* Error */, "_0_can_only_be_imported_by_using_a_default_import_2595", "'{0}' can only be imported by using a default import."), 5996 _0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2596, 1 /* Error */, "_0_can_only_be_imported_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import_2596", "'{0}' can only be imported by turning on the 'esModuleInterop' flag and using a default import."), 5997 _0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import: diag(2597, 1 /* Error */, "_0_can_only_be_imported_by_using_a_require_call_or_by_using_a_default_import_2597", "'{0}' can only be imported by using a 'require' call or by using a default import."), 5998 _0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2598, 1 /* Error */, "_0_can_only_be_imported_by_using_a_require_call_or_by_turning_on_the_esModuleInterop_flag_and_using__2598", "'{0}' can only be imported by using a 'require' call or by turning on the 'esModuleInterop' flag and using a default import."), 5999 JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, 1 /* Error */, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), 6000 Property_0_in_type_1_is_not_assignable_to_type_2: diag(2603, 1 /* Error */, "Property_0_in_type_1_is_not_assignable_to_type_2_2603", "Property '{0}' in type '{1}' is not assignable to type '{2}'."), 6001 JSX_element_type_0_does_not_have_any_construct_or_call_signatures: diag(2604, 1 /* Error */, "JSX_element_type_0_does_not_have_any_construct_or_call_signatures_2604", "JSX element type '{0}' does not have any construct or call signatures."), 6002 Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: diag(2606, 1 /* Error */, "Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606", "Property '{0}' of JSX spread attribute is not assignable to target property."), 6003 JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: diag(2607, 1 /* Error */, "JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property_2607", "JSX element class does not support attributes because it does not have a '{0}' property."), 6004 The_global_type_JSX_0_may_not_have_more_than_one_property: diag(2608, 1 /* Error */, "The_global_type_JSX_0_may_not_have_more_than_one_property_2608", "The global type 'JSX.{0}' may not have more than one property."), 6005 JSX_spread_child_must_be_an_array_type: diag(2609, 1 /* Error */, "JSX_spread_child_must_be_an_array_type_2609", "JSX spread child must be an array type."), 6006 _0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property: diag(2610, 1 /* Error */, "_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property_2610", "'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property."), 6007 _0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor: diag(2611, 1 /* Error */, "_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor_2611", "'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor."), 6008 Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration: diag(2612, 1 /* Error */, "Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612", "Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."), 6009 Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead: diag(2613, 1 /* Error */, "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613", "Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"), 6010 Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead: diag(2614, 1 /* Error */, "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614", "Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"), 6011 Type_of_property_0_circularly_references_itself_in_mapped_type_1: diag(2615, 1 /* Error */, "Type_of_property_0_circularly_references_itself_in_mapped_type_1_2615", "Type of property '{0}' circularly references itself in mapped type '{1}'."), 6012 _0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import: diag(2616, 1 /* Error */, "_0_can_only_be_imported_by_using_import_1_require_2_or_a_default_import_2616", "'{0}' can only be imported by using 'import {1} = require({2})' or a default import."), 6013 _0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_using_a_default_import: diag(2617, 1 /* Error */, "_0_can_only_be_imported_by_using_import_1_require_2_or_by_turning_on_the_esModuleInterop_flag_and_us_2617", "'{0}' can only be imported by using 'import {1} = require({2})' or by turning on the 'esModuleInterop' flag and using a default import."), 6014 Source_has_0_element_s_but_target_requires_1: diag(2618, 1 /* Error */, "Source_has_0_element_s_but_target_requires_1_2618", "Source has {0} element(s) but target requires {1}."), 6015 Source_has_0_element_s_but_target_allows_only_1: diag(2619, 1 /* Error */, "Source_has_0_element_s_but_target_allows_only_1_2619", "Source has {0} element(s) but target allows only {1}."), 6016 Target_requires_0_element_s_but_source_may_have_fewer: diag(2620, 1 /* Error */, "Target_requires_0_element_s_but_source_may_have_fewer_2620", "Target requires {0} element(s) but source may have fewer."), 6017 Target_allows_only_0_element_s_but_source_may_have_more: diag(2621, 1 /* Error */, "Target_allows_only_0_element_s_but_source_may_have_more_2621", "Target allows only {0} element(s) but source may have more."), 6018 Source_provides_no_match_for_required_element_at_position_0_in_target: diag(2623, 1 /* Error */, "Source_provides_no_match_for_required_element_at_position_0_in_target_2623", "Source provides no match for required element at position {0} in target."), 6019 Source_provides_no_match_for_variadic_element_at_position_0_in_target: diag(2624, 1 /* Error */, "Source_provides_no_match_for_variadic_element_at_position_0_in_target_2624", "Source provides no match for variadic element at position {0} in target."), 6020 Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target: diag(2625, 1 /* Error */, "Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625", "Variadic element at position {0} in source does not match element at position {1} in target."), 6021 Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target: diag(2626, 1 /* Error */, "Type_at_position_0_in_source_is_not_compatible_with_type_at_position_1_in_target_2626", "Type at position {0} in source is not compatible with type at position {1} in target."), 6022 Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target: diag(2627, 1 /* Error */, "Type_at_positions_0_through_1_in_source_is_not_compatible_with_type_at_position_2_in_target_2627", "Type at positions {0} through {1} in source is not compatible with type at position {2} in target."), 6023 Cannot_assign_to_0_because_it_is_an_enum: diag(2628, 1 /* Error */, "Cannot_assign_to_0_because_it_is_an_enum_2628", "Cannot assign to '{0}' because it is an enum."), 6024 Cannot_assign_to_0_because_it_is_a_class: diag(2629, 1 /* Error */, "Cannot_assign_to_0_because_it_is_a_class_2629", "Cannot assign to '{0}' because it is a class."), 6025 Cannot_assign_to_0_because_it_is_a_function: diag(2630, 1 /* Error */, "Cannot_assign_to_0_because_it_is_a_function_2630", "Cannot assign to '{0}' because it is a function."), 6026 Cannot_assign_to_0_because_it_is_a_namespace: diag(2631, 1 /* Error */, "Cannot_assign_to_0_because_it_is_a_namespace_2631", "Cannot assign to '{0}' because it is a namespace."), 6027 Cannot_assign_to_0_because_it_is_an_import: diag(2632, 1 /* Error */, "Cannot_assign_to_0_because_it_is_an_import_2632", "Cannot assign to '{0}' because it is an import."), 6028 JSX_property_access_expressions_cannot_include_JSX_namespace_names: diag(2633, 1 /* Error */, "JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633", "JSX property access expressions cannot include JSX namespace names"), 6029 _0_index_signatures_are_incompatible: diag(2634, 1 /* Error */, "_0_index_signatures_are_incompatible_2634", "'{0}' index signatures are incompatible."), 6030 Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable: diag(2635, 1 /* Error */, "Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635", "Type '{0}' has no signatures for which the type argument list is applicable."), 6031 Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation: diag(2636, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636", "Type '{0}' is not assignable to type '{1}' as implied by variance annotation."), 6032 Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types: diag(2637, 1 /* Error */, "Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637", "Variance annotations are only supported in type aliases for object, function, constructor, and mapped types."), 6033 Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator: diag(2638, 1 /* Error */, "Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638", "Type '{0}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator."), 6034 Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, 1 /* Error */, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."), 6035 A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, 1 /* Error */, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."), 6036 Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, 1 /* Error */, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."), 6037 Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: diag(2653, 1 /* Error */, "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653", "Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."), 6038 JSX_expressions_must_have_one_parent_element: diag(2657, 1 /* Error */, "JSX_expressions_must_have_one_parent_element_2657", "JSX expressions must have one parent element."), 6039 Type_0_provides_no_match_for_the_signature_1: diag(2658, 1 /* Error */, "Type_0_provides_no_match_for_the_signature_1_2658", "Type '{0}' provides no match for the signature '{1}'."), 6040 super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: diag(2659, 1 /* Error */, "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."), 6041 super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: diag(2660, 1 /* Error */, "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660", "'super' can only be referenced in members of derived classes or object literal expressions."), 6042 Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module: diag(2661, 1 /* Error */, "Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module_2661", "Cannot export '{0}'. Only local declarations can be exported from a module."), 6043 Cannot_find_name_0_Did_you_mean_the_static_member_1_0: diag(2662, 1 /* Error */, "Cannot_find_name_0_Did_you_mean_the_static_member_1_0_2662", "Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?"), 6044 Cannot_find_name_0_Did_you_mean_the_instance_member_this_0: diag(2663, 1 /* Error */, "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663", "Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?"), 6045 Invalid_module_name_in_augmentation_module_0_cannot_be_found: diag(2664, 1 /* Error */, "Invalid_module_name_in_augmentation_module_0_cannot_be_found_2664", "Invalid module name in augmentation, module '{0}' cannot be found."), 6046 Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented: diag(2665, 1 /* Error */, "Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augm_2665", "Invalid module name in augmentation. Module '{0}' resolves to an untyped module at '{1}', which cannot be augmented."), 6047 Exports_and_export_assignments_are_not_permitted_in_module_augmentations: diag(2666, 1 /* Error */, "Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666", "Exports and export assignments are not permitted in module augmentations."), 6048 Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module: diag(2667, 1 /* Error */, "Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667", "Imports are not permitted in module augmentations. Consider moving them to the enclosing external module."), 6049 export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible: diag(2668, 1 /* Error */, "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668", "'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible."), 6050 Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations: diag(2669, 1 /* Error */, "Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669", "Augmentations for the global scope can only be directly nested in external modules or ambient module declarations."), 6051 Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context: diag(2670, 1 /* Error */, "Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambien_2670", "Augmentations for the global scope should have 'declare' modifier unless they appear in already ambient context."), 6052 Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity: diag(2671, 1 /* Error */, "Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity_2671", "Cannot augment module '{0}' because it resolves to a non-module entity."), 6053 Cannot_assign_a_0_constructor_type_to_a_1_constructor_type: diag(2672, 1 /* Error */, "Cannot_assign_a_0_constructor_type_to_a_1_constructor_type_2672", "Cannot assign a '{0}' constructor type to a '{1}' constructor type."), 6054 Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration: diag(2673, 1 /* Error */, "Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration_2673", "Constructor of class '{0}' is private and only accessible within the class declaration."), 6055 Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration: diag(2674, 1 /* Error */, "Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration_2674", "Constructor of class '{0}' is protected and only accessible within the class declaration."), 6056 Cannot_extend_a_class_0_Class_constructor_is_marked_as_private: diag(2675, 1 /* Error */, "Cannot_extend_a_class_0_Class_constructor_is_marked_as_private_2675", "Cannot extend a class '{0}'. Class constructor is marked as private."), 6057 Accessors_must_both_be_abstract_or_non_abstract: diag(2676, 1 /* Error */, "Accessors_must_both_be_abstract_or_non_abstract_2676", "Accessors must both be abstract or non-abstract."), 6058 A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type: diag(2677, 1 /* Error */, "A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677", "A type predicate's type must be assignable to its parameter's type."), 6059 Type_0_is_not_comparable_to_type_1: diag(2678, 1 /* Error */, "Type_0_is_not_comparable_to_type_1_2678", "Type '{0}' is not comparable to type '{1}'."), 6060 A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void: diag(2679, 1 /* Error */, "A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void_2679", "A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'."), 6061 A_0_parameter_must_be_the_first_parameter: diag(2680, 1 /* Error */, "A_0_parameter_must_be_the_first_parameter_2680", "A '{0}' parameter must be the first parameter."), 6062 A_constructor_cannot_have_a_this_parameter: diag(2681, 1 /* Error */, "A_constructor_cannot_have_a_this_parameter_2681", "A constructor cannot have a 'this' parameter."), 6063 this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation: diag(2683, 1 /* Error */, "this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_2683", "'this' implicitly has type 'any' because it does not have a type annotation."), 6064 The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1: diag(2684, 1 /* Error */, "The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684", "The 'this' context of type '{0}' is not assignable to method's 'this' of type '{1}'."), 6065 The_this_types_of_each_signature_are_incompatible: diag(2685, 1 /* Error */, "The_this_types_of_each_signature_are_incompatible_2685", "The 'this' types of each signature are incompatible."), 6066 _0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead: diag(2686, 1 /* Error */, "_0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead_2686", "'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead."), 6067 All_declarations_of_0_must_have_identical_modifiers: diag(2687, 1 /* Error */, "All_declarations_of_0_must_have_identical_modifiers_2687", "All declarations of '{0}' must have identical modifiers."), 6068 Cannot_find_type_definition_file_for_0: diag(2688, 1 /* Error */, "Cannot_find_type_definition_file_for_0_2688", "Cannot find type definition file for '{0}'."), 6069 Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, 1 /* Error */, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"), 6070 _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"), 6071 An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: diag(2691, 1 /* Error */, "An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead_2691", "An import path cannot end with a '{0}' extension. Consider importing '{1}' instead."), 6072 _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, 1 /* Error */, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."), 6073 _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."), 6074 Namespace_0_has_no_exported_member_1: diag(2694, 1 /* Error */, "Namespace_0_has_no_exported_member_1_2694", "Namespace '{0}' has no exported member '{1}'."), 6075 Left_side_of_comma_operator_is_unused_and_has_no_side_effects: diag(2695, 1 /* Error */, "Left_side_of_comma_operator_is_unused_and_has_no_side_effects_2695", "Left side of comma operator is unused and has no side effects.", true), 6076 The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: diag(2696, 1 /* Error */, "The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead_2696", "The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead?"), 6077 An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: diag(2697, 1 /* Error */, "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697", "An async function or method must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."), 6078 Spread_types_may_only_be_created_from_object_types: diag(2698, 1 /* Error */, "Spread_types_may_only_be_created_from_object_types_2698", "Spread types may only be created from object types."), 6079 Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1: diag(2699, 1 /* Error */, "Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699", "Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'."), 6080 Rest_types_may_only_be_created_from_object_types: diag(2700, 1 /* Error */, "Rest_types_may_only_be_created_from_object_types_2700", "Rest types may only be created from object types."), 6081 The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: diag(2701, 1 /* Error */, "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701", "The target of an object rest assignment must be a variable or a property access."), 6082 _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: diag(2702, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702", "'{0}' only refers to a type, but is being used as a namespace here."), 6083 The_operand_of_a_delete_operator_must_be_a_property_reference: diag(2703, 1 /* Error */, "The_operand_of_a_delete_operator_must_be_a_property_reference_2703", "The operand of a 'delete' operator must be a property reference."), 6084 The_operand_of_a_delete_operator_cannot_be_a_read_only_property: diag(2704, 1 /* Error */, "The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704", "The operand of a 'delete' operator cannot be a read-only property."), 6085 An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: diag(2705, 1 /* Error */, "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705", "An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."), 6086 Required_type_parameters_may_not_follow_optional_type_parameters: diag(2706, 1 /* Error */, "Required_type_parameters_may_not_follow_optional_type_parameters_2706", "Required type parameters may not follow optional type parameters."), 6087 Generic_type_0_requires_between_1_and_2_type_arguments: diag(2707, 1 /* Error */, "Generic_type_0_requires_between_1_and_2_type_arguments_2707", "Generic type '{0}' requires between {1} and {2} type arguments."), 6088 Cannot_use_namespace_0_as_a_value: diag(2708, 1 /* Error */, "Cannot_use_namespace_0_as_a_value_2708", "Cannot use namespace '{0}' as a value."), 6089 Cannot_use_namespace_0_as_a_type: diag(2709, 1 /* Error */, "Cannot_use_namespace_0_as_a_type_2709", "Cannot use namespace '{0}' as a type."), 6090 _0_are_specified_twice_The_attribute_named_0_will_be_overwritten: diag(2710, 1 /* Error */, "_0_are_specified_twice_The_attribute_named_0_will_be_overwritten_2710", "'{0}' are specified twice. The attribute named '{0}' will be overwritten."), 6091 A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: diag(2711, 1 /* Error */, "A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711", "A dynamic import call returns a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your '--lib' option."), 6092 A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: diag(2712, 1 /* Error */, "A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declarat_2712", "A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."), 6093 Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1: diag(2713, 1 /* Error */, "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713", `Cannot access '{0}.{1}' because '{0}' is a type, but not a namespace. Did you mean to retrieve the type of the property '{1}' in '{0}' with '{0}["{1}"]'?`), 6094 The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context: diag(2714, 1 /* Error */, "The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714", "The expression of an export assignment must be an identifier or qualified name in an ambient context."), 6095 Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor: diag(2715, 1 /* Error */, "Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor_2715", "Abstract property '{0}' in class '{1}' cannot be accessed in the constructor."), 6096 Type_parameter_0_has_a_circular_default: diag(2716, 1 /* Error */, "Type_parameter_0_has_a_circular_default_2716", "Type parameter '{0}' has a circular default."), 6097 Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2: diag(2717, 1 /* Error */, "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717", "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."), 6098 Duplicate_property_0: diag(2718, 1 /* Error */, "Duplicate_property_0_2718", "Duplicate property '{0}'."), 6099 Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: diag(2719, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719", "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."), 6100 Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass: diag(2720, 1 /* Error */, "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720", "Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"), 6101 Cannot_invoke_an_object_which_is_possibly_null: diag(2721, 1 /* Error */, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), 6102 Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, 1 /* Error */, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), 6103 Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, 1 /* Error */, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), 6104 _0_has_no_exported_member_named_1_Did_you_mean_2: diag(2724, 1 /* Error */, "_0_has_no_exported_member_named_1_Did_you_mean_2_2724", "'{0}' has no exported member named '{1}'. Did you mean '{2}'?"), 6105 Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, 1 /* Error */, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."), 6106 Cannot_find_lib_definition_for_0: diag(2726, 1 /* Error */, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."), 6107 Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, 1 /* Error */, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"), 6108 _0_is_declared_here: diag(2728, 3 /* Message */, "_0_is_declared_here_2728", "'{0}' is declared here."), 6109 Property_0_is_used_before_its_initialization: diag(2729, 1 /* Error */, "Property_0_is_used_before_its_initialization_2729", "Property '{0}' is used before its initialization."), 6110 An_arrow_function_cannot_have_a_this_parameter: diag(2730, 1 /* Error */, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."), 6111 Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, 1 /* Error */, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."), 6112 Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, 1 /* Error */, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."), 6113 Property_0_was_also_declared_here: diag(2733, 1 /* Error */, "Property_0_was_also_declared_here_2733", "Property '{0}' was also declared here."), 6114 Are_you_missing_a_semicolon: diag(2734, 1 /* Error */, "Are_you_missing_a_semicolon_2734", "Are you missing a semicolon?"), 6115 Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, 1 /* Error */, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"), 6116 Operator_0_cannot_be_applied_to_type_1: diag(2736, 1 /* Error */, "Operator_0_cannot_be_applied_to_type_1_2736", "Operator '{0}' cannot be applied to type '{1}'."), 6117 BigInt_literals_are_not_available_when_targeting_lower_than_ES2020: diag(2737, 1 /* Error */, "BigInt_literals_are_not_available_when_targeting_lower_than_ES2020_2737", "BigInt literals are not available when targeting lower than ES2020."), 6118 An_outer_value_of_this_is_shadowed_by_this_container: diag(2738, 3 /* Message */, "An_outer_value_of_this_is_shadowed_by_this_container_2738", "An outer value of 'this' is shadowed by this container."), 6119 Type_0_is_missing_the_following_properties_from_type_1_Colon_2: diag(2739, 1 /* Error */, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739", "Type '{0}' is missing the following properties from type '{1}': {2}"), 6120 Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more: diag(2740, 1 /* Error */, "Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740", "Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more."), 6121 Property_0_is_missing_in_type_1_but_required_in_type_2: diag(2741, 1 /* Error */, "Property_0_is_missing_in_type_1_but_required_in_type_2_2741", "Property '{0}' is missing in type '{1}' but required in type '{2}'."), 6122 The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_annotation_is_necessary: diag(2742, 1 /* Error */, "The_inferred_type_of_0_cannot_be_named_without_a_reference_to_1_This_is_likely_not_portable_A_type_a_2742", "The inferred type of '{0}' cannot be named without a reference to '{1}'. This is likely not portable. A type annotation is necessary."), 6123 No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments: diag(2743, 1 /* Error */, "No_overload_expects_0_type_arguments_but_overloads_do_exist_that_expect_either_1_or_2_type_arguments_2743", "No overload expects {0} type arguments, but overloads do exist that expect either {1} or {2} type arguments."), 6124 Type_parameter_defaults_can_only_reference_previously_declared_type_parameters: diag(2744, 1 /* Error */, "Type_parameter_defaults_can_only_reference_previously_declared_type_parameters_2744", "Type parameter defaults can only reference previously declared type parameters."), 6125 This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_provided: diag(2745, 1 /* Error */, "This_JSX_tag_s_0_prop_expects_type_1_which_requires_multiple_children_but_only_a_single_child_was_pr_2745", "This JSX tag's '{0}' prop expects type '{1}' which requires multiple children, but only a single child was provided."), 6126 This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided: diag(2746, 1 /* Error */, "This_JSX_tag_s_0_prop_expects_a_single_child_of_type_1_but_multiple_children_were_provided_2746", "This JSX tag's '{0}' prop expects a single child of type '{1}', but multiple children were provided."), 6127 _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, 1 /* Error */, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."), 6128 Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided: diag(2748, 1 /* Error */, "Cannot_access_ambient_const_enums_when_the_isolatedModules_flag_is_provided_2748", "Cannot access ambient const enums when the '--isolatedModules' flag is provided."), 6129 _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, 1 /* Error */, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"), 6130 The_implementation_signature_is_declared_here: diag(2750, 1 /* Error */, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."), 6131 Circularity_originates_in_type_at_this_location: diag(2751, 1 /* Error */, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."), 6132 The_first_export_default_is_here: diag(2752, 1 /* Error */, "The_first_export_default_is_here_2752", "The first export default is here."), 6133 Another_export_default_is_here: diag(2753, 1 /* Error */, "Another_export_default_is_here_2753", "Another export default is here."), 6134 super_may_not_use_type_arguments: diag(2754, 1 /* Error */, "super_may_not_use_type_arguments_2754", "'super' may not use type arguments."), 6135 No_constituent_of_type_0_is_callable: diag(2755, 1 /* Error */, "No_constituent_of_type_0_is_callable_2755", "No constituent of type '{0}' is callable."), 6136 Not_all_constituents_of_type_0_are_callable: diag(2756, 1 /* Error */, "Not_all_constituents_of_type_0_are_callable_2756", "Not all constituents of type '{0}' are callable."), 6137 Type_0_has_no_call_signatures: diag(2757, 1 /* Error */, "Type_0_has_no_call_signatures_2757", "Type '{0}' has no call signatures."), 6138 Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_other: diag(2758, 1 /* Error */, "Each_member_of_the_union_type_0_has_signatures_but_none_of_those_signatures_are_compatible_with_each_2758", "Each member of the union type '{0}' has signatures, but none of those signatures are compatible with each other."), 6139 No_constituent_of_type_0_is_constructable: diag(2759, 1 /* Error */, "No_constituent_of_type_0_is_constructable_2759", "No constituent of type '{0}' is constructable."), 6140 Not_all_constituents_of_type_0_are_constructable: diag(2760, 1 /* Error */, "Not_all_constituents_of_type_0_are_constructable_2760", "Not all constituents of type '{0}' are constructable."), 6141 Type_0_has_no_construct_signatures: diag(2761, 1 /* Error */, "Type_0_has_no_construct_signatures_2761", "Type '{0}' has no construct signatures."), 6142 Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_with_each_other: diag(2762, 1 /* Error */, "Each_member_of_the_union_type_0_has_construct_signatures_but_none_of_those_signatures_are_compatible_2762", "Each member of the union type '{0}' has construct signatures, but none of those signatures are compatible with each other."), 6143 Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_send_0: diag(2763, 1 /* Error */, "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_for_of_will_always_s_2763", "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'."), 6144 Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_always_send_0: diag(2764, 1 /* Error */, "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_spread_will_al_2764", "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'."), 6145 Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring_will_always_send_0: diag(2765, 1 /* Error */, "Cannot_iterate_value_because_the_next_method_of_its_iterator_expects_type_1_but_array_destructuring__2765", "Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'."), 6146 Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_containing_generator_will_always_send_0: diag(2766, 1 /* Error */, "Cannot_delegate_iteration_to_value_because_the_next_method_of_its_iterator_expects_type_1_but_the_co_2766", "Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'."), 6147 The_0_property_of_an_iterator_must_be_a_method: diag(2767, 1 /* Error */, "The_0_property_of_an_iterator_must_be_a_method_2767", "The '{0}' property of an iterator must be a method."), 6148 The_0_property_of_an_async_iterator_must_be_a_method: diag(2768, 1 /* Error */, "The_0_property_of_an_async_iterator_must_be_a_method_2768", "The '{0}' property of an async iterator must be a method."), 6149 No_overload_matches_this_call: diag(2769, 1 /* Error */, "No_overload_matches_this_call_2769", "No overload matches this call."), 6150 The_last_overload_gave_the_following_error: diag(2770, 1 /* Error */, "The_last_overload_gave_the_following_error_2770", "The last overload gave the following error."), 6151 The_last_overload_is_declared_here: diag(2771, 1 /* Error */, "The_last_overload_is_declared_here_2771", "The last overload is declared here."), 6152 Overload_0_of_1_2_gave_the_following_error: diag(2772, 1 /* Error */, "Overload_0_of_1_2_gave_the_following_error_2772", "Overload {0} of {1}, '{2}', gave the following error."), 6153 Did_you_forget_to_use_await: diag(2773, 1 /* Error */, "Did_you_forget_to_use_await_2773", "Did you forget to use 'await'?"), 6154 This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead: diag(2774, 1 /* Error */, "This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774", "This condition will always return true since this function is always defined. Did you mean to call it instead?"), 6155 Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation: diag(2775, 1 /* Error */, "Assertions_require_every_name_in_the_call_target_to_be_declared_with_an_explicit_type_annotation_2775", "Assertions require every name in the call target to be declared with an explicit type annotation."), 6156 Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name: diag(2776, 1 /* Error */, "Assertions_require_the_call_target_to_be_an_identifier_or_qualified_name_2776", "Assertions require the call target to be an identifier or qualified name."), 6157 The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access: diag(2777, 1 /* Error */, "The_operand_of_an_increment_or_decrement_operator_may_not_be_an_optional_property_access_2777", "The operand of an increment or decrement operator may not be an optional property access."), 6158 The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access: diag(2778, 1 /* Error */, "The_target_of_an_object_rest_assignment_may_not_be_an_optional_property_access_2778", "The target of an object rest assignment may not be an optional property access."), 6159 The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access: diag(2779, 1 /* Error */, "The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779", "The left-hand side of an assignment expression may not be an optional property access."), 6160 The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access: diag(2780, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_may_not_be_an_optional_property_access_2780", "The left-hand side of a 'for...in' statement may not be an optional property access."), 6161 The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access: diag(2781, 1 /* Error */, "The_left_hand_side_of_a_for_of_statement_may_not_be_an_optional_property_access_2781", "The left-hand side of a 'for...of' statement may not be an optional property access."), 6162 _0_needs_an_explicit_type_annotation: diag(2782, 3 /* Message */, "_0_needs_an_explicit_type_annotation_2782", "'{0}' needs an explicit type annotation."), 6163 _0_is_specified_more_than_once_so_this_usage_will_be_overwritten: diag(2783, 1 /* Error */, "_0_is_specified_more_than_once_so_this_usage_will_be_overwritten_2783", "'{0}' is specified more than once, so this usage will be overwritten."), 6164 get_and_set_accessors_cannot_declare_this_parameters: diag(2784, 1 /* Error */, "get_and_set_accessors_cannot_declare_this_parameters_2784", "'get' and 'set' accessors cannot declare 'this' parameters."), 6165 This_spread_always_overwrites_this_property: diag(2785, 1 /* Error */, "This_spread_always_overwrites_this_property_2785", "This spread always overwrites this property."), 6166 _0_cannot_be_used_as_a_JSX_component: diag(2786, 1 /* Error */, "_0_cannot_be_used_as_a_JSX_component_2786", "'{0}' cannot be used as a JSX component."), 6167 Its_return_type_0_is_not_a_valid_JSX_element: diag(2787, 1 /* Error */, "Its_return_type_0_is_not_a_valid_JSX_element_2787", "Its return type '{0}' is not a valid JSX element."), 6168 Its_instance_type_0_is_not_a_valid_JSX_element: diag(2788, 1 /* Error */, "Its_instance_type_0_is_not_a_valid_JSX_element_2788", "Its instance type '{0}' is not a valid JSX element."), 6169 Its_element_type_0_is_not_a_valid_JSX_element: diag(2789, 1 /* Error */, "Its_element_type_0_is_not_a_valid_JSX_element_2789", "Its element type '{0}' is not a valid JSX element."), 6170 The_operand_of_a_delete_operator_must_be_optional: diag(2790, 1 /* Error */, "The_operand_of_a_delete_operator_must_be_optional_2790", "The operand of a 'delete' operator must be optional."), 6171 Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_later: diag(2791, 1 /* Error */, "Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791", "Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later."), 6172 Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option: diag(2792, 1 /* Error */, "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_th_2792", "Cannot find module '{0}'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?"), 6173 The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_are_not_externally_visible: diag(2793, 1 /* Error */, "The_call_would_have_succeeded_against_this_implementation_but_implementation_signatures_of_overloads_2793", "The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible."), 6174 Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise: diag(2794, 1 /* Error */, "Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise_2794", "Expected {0} arguments, but got {1}. Did you forget to include 'void' in your type argument to 'Promise'?"), 6175 The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types: diag(2795, 1 /* Error */, "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795", "The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."), 6176 It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked: diag(2796, 1 /* Error */, "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796", "It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."), 6177 A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract: diag(2797, 1 /* Error */, "A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797", "A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'."), 6178 The_declaration_was_marked_as_deprecated_here: diag(2798, 1 /* Error */, "The_declaration_was_marked_as_deprecated_here_2798", "The declaration was marked as deprecated here."), 6179 Type_produces_a_tuple_type_that_is_too_large_to_represent: diag(2799, 1 /* Error */, "Type_produces_a_tuple_type_that_is_too_large_to_represent_2799", "Type produces a tuple type that is too large to represent."), 6180 Expression_produces_a_tuple_type_that_is_too_large_to_represent: diag(2800, 1 /* Error */, "Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800", "Expression produces a tuple type that is too large to represent."), 6181 This_condition_will_always_return_true_since_this_0_is_always_defined: diag(2801, 1 /* Error */, "This_condition_will_always_return_true_since_this_0_is_always_defined_2801", "This condition will always return true since this '{0}' is always defined."), 6182 Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher: diag(2802, 1 /* Error */, "Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802", "Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."), 6183 Cannot_assign_to_private_method_0_Private_methods_are_not_writable: diag(2803, 1 /* Error */, "Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803", "Cannot assign to private method '{0}'. Private methods are not writable."), 6184 Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name: diag(2804, 1 /* Error */, "Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804", "Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."), 6185 Private_accessor_was_defined_without_a_getter: diag(2806, 1 /* Error */, "Private_accessor_was_defined_without_a_getter_2806", "Private accessor was defined without a getter."), 6186 This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: diag(2807, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."), 6187 A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, 1 /* Error */, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"), 6188 Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses: diag(2809, 1 /* Error */, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."), 6189 Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments: diag(2810, 1 /* Error */, "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810", "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."), 6190 Initializer_for_property_0: diag(2811, 1 /* Error */, "Initializer_for_property_0_2811", "Initializer for property '{0}'"), 6191 Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, 1 /* Error */, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."), 6192 Class_declaration_cannot_implement_overload_list_for_0: diag(2813, 1 /* Error */, "Class_declaration_cannot_implement_overload_list_for_0_2813", "Class declaration cannot implement overload list for '{0}'."), 6193 Function_with_bodies_can_only_merge_with_classes_that_are_ambient: diag(2814, 1 /* Error */, "Function_with_bodies_can_only_merge_with_classes_that_are_ambient_2814", "Function with bodies can only merge with classes that are ambient."), 6194 arguments_cannot_be_referenced_in_property_initializers: diag(2815, 1 /* Error */, "arguments_cannot_be_referenced_in_property_initializers_2815", "'arguments' cannot be referenced in property initializers."), 6195 Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class: diag(2816, 1 /* Error */, "Cannot_use_this_in_a_static_property_initializer_of_a_decorated_class_2816", "Cannot use 'this' in a static property initializer of a decorated class."), 6196 Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block: diag(2817, 1 /* Error */, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817", "Property '{0}' has no initializer and is not definitely assigned in a class static block."), 6197 Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers: diag(2818, 1 /* Error */, "Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818", "Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."), 6198 Namespace_name_cannot_be_0: diag(2819, 1 /* Error */, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."), 6199 Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"), 6200 Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'."), 6201 Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, 1 /* Error */, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."), 6202 Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1 /* Error */, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"), 6203 Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."), 6204 Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"), 6205 Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls: diag(2836, 1 /* Error */, "Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836", "Import assertions are not allowed on statements that transpile to commonjs 'require' calls."), 6206 Import_assertion_values_must_be_string_literal_expressions: diag(2837, 1 /* Error */, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."), 6207 All_declarations_of_0_must_have_identical_constraints: diag(2838, 1 /* Error */, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."), 6208 This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: diag(2839, 1 /* Error */, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."), 6209 An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes: diag(2840, 1 /* Error */, "An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_clas_2840", "An interface cannot extend a primitive type like '{0}'; an interface can only extend named types and classes"), 6210 The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(2841, 1 /* Error */, "The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_2841", "The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."), 6211 _0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation: diag(2842, 1 /* Error */, "_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842", "'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"), 6212 We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here: diag(2843, 1 /* Error */, "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843", "We can only write a type for '{0}' by adding a type for the entire parameter here."), 6213 Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2844, 1 /* Error */, "Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844", "Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), 6214 This_condition_will_always_return_0: diag(2845, 1 /* Error */, "This_condition_will_always_return_0_2845", "This condition will always return '{0}'."), 6215 Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), 6216 Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), 6217 Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), 6218 Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4006, 1 /* Error */, "Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006", "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."), 6219 Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4008, 1 /* Error */, "Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008", "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'."), 6220 Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: diag(4010, 1 /* Error */, "Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010", "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'."), 6221 Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: diag(4012, 1 /* Error */, "Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012", "Type parameter '{0}' of public method from exported class has or is using private name '{1}'."), 6222 Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: diag(4014, 1 /* Error */, "Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014", "Type parameter '{0}' of method from exported interface has or is using private name '{1}'."), 6223 Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: diag(4016, 1 /* Error */, "Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016", "Type parameter '{0}' of exported function has or is using private name '{1}'."), 6224 Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: diag(4019, 1 /* Error */, "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019", "Implements clause of exported class '{0}' has or is using private name '{1}'."), 6225 extends_clause_of_exported_class_0_has_or_is_using_private_name_1: diag(4020, 1 /* Error */, "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020", "'extends' clause of exported class '{0}' has or is using private name '{1}'."), 6226 extends_clause_of_exported_class_has_or_is_using_private_name_0: diag(4021, 1 /* Error */, "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021", "'extends' clause of exported class has or is using private name '{0}'."), 6227 extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: diag(4022, 1 /* Error */, "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022", "'extends' clause of exported interface '{0}' has or is using private name '{1}'."), 6228 Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4023, 1 /* Error */, "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023", "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named."), 6229 Exported_variable_0_has_or_is_using_name_1_from_private_module_2: diag(4024, 1 /* Error */, "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024", "Exported variable '{0}' has or is using name '{1}' from private module '{2}'."), 6230 Exported_variable_0_has_or_is_using_private_name_1: diag(4025, 1 /* Error */, "Exported_variable_0_has_or_is_using_private_name_1_4025", "Exported variable '{0}' has or is using private name '{1}'."), 6231 Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4026, 1 /* Error */, "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026", "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."), 6232 Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4027, 1 /* Error */, "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027", "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'."), 6233 Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: diag(4028, 1 /* Error */, "Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028", "Public static property '{0}' of exported class has or is using private name '{1}'."), 6234 Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4029, 1 /* Error */, "Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029", "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."), 6235 Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4030, 1 /* Error */, "Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030", "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'."), 6236 Public_property_0_of_exported_class_has_or_is_using_private_name_1: diag(4031, 1 /* Error */, "Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031", "Public property '{0}' of exported class has or is using private name '{1}'."), 6237 Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4032, 1 /* Error */, "Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032", "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'."), 6238 Property_0_of_exported_interface_has_or_is_using_private_name_1: diag(4033, 1 /* Error */, "Property_0_of_exported_interface_has_or_is_using_private_name_1_4033", "Property '{0}' of exported interface has or is using private name '{1}'."), 6239 Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4034, 1 /* Error */, "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034", "Parameter type of public static setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."), 6240 Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1: diag(4035, 1 /* Error */, "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035", "Parameter type of public static setter '{0}' from exported class has or is using private name '{1}'."), 6241 Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4036, 1 /* Error */, "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036", "Parameter type of public setter '{0}' from exported class has or is using name '{1}' from private module '{2}'."), 6242 Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1: diag(4037, 1 /* Error */, "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037", "Parameter type of public setter '{0}' from exported class has or is using private name '{1}'."), 6243 Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4038, 1 /* Error */, "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038", "Return type of public static getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."), 6244 Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4039, 1 /* Error */, "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039", "Return type of public static getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."), 6245 Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1: diag(4040, 1 /* Error */, "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040", "Return type of public static getter '{0}' from exported class has or is using private name '{1}'."), 6246 Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4041, 1 /* Error */, "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041", "Return type of public getter '{0}' from exported class has or is using name '{1}' from external module {2} but cannot be named."), 6247 Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4042, 1 /* Error */, "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042", "Return type of public getter '{0}' from exported class has or is using name '{1}' from private module '{2}'."), 6248 Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1: diag(4043, 1 /* Error */, "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043", "Return type of public getter '{0}' from exported class has or is using private name '{1}'."), 6249 Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4044, 1 /* Error */, "Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044", "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'."), 6250 Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: diag(4045, 1 /* Error */, "Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045", "Return type of constructor signature from exported interface has or is using private name '{0}'."), 6251 Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4046, 1 /* Error */, "Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046", "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'."), 6252 Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: diag(4047, 1 /* Error */, "Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047", "Return type of call signature from exported interface has or is using private name '{0}'."), 6253 Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4048, 1 /* Error */, "Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048", "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'."), 6254 Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: diag(4049, 1 /* Error */, "Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049", "Return type of index signature from exported interface has or is using private name '{0}'."), 6255 Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: diag(4050, 1 /* Error */, "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050", "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named."), 6256 Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: diag(4051, 1 /* Error */, "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051", "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'."), 6257 Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: diag(4052, 1 /* Error */, "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052", "Return type of public static method from exported class has or is using private name '{0}'."), 6258 Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: diag(4053, 1 /* Error */, "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053", "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named."), 6259 Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: diag(4054, 1 /* Error */, "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054", "Return type of public method from exported class has or is using name '{0}' from private module '{1}'."), 6260 Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: diag(4055, 1 /* Error */, "Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055", "Return type of public method from exported class has or is using private name '{0}'."), 6261 Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: diag(4056, 1 /* Error */, "Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056", "Return type of method from exported interface has or is using name '{0}' from private module '{1}'."), 6262 Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: diag(4057, 1 /* Error */, "Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057", "Return type of method from exported interface has or is using private name '{0}'."), 6263 Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: diag(4058, 1 /* Error */, "Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058", "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named."), 6264 Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: diag(4059, 1 /* Error */, "Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059", "Return type of exported function has or is using name '{0}' from private module '{1}'."), 6265 Return_type_of_exported_function_has_or_is_using_private_name_0: diag(4060, 0 /* Warning */, "Return_type_of_exported_function_has_or_is_using_private_name_0_4060", "Return type of exported function has or is using private name '{0}'."), 6266 Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4061, 1 /* Error */, "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061", "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named."), 6267 Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4062, 1 /* Error */, "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062", "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'."), 6268 Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: diag(4063, 1 /* Error */, "Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063", "Parameter '{0}' of constructor from exported class has or is using private name '{1}'."), 6269 Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4064, 1 /* Error */, "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064", "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'."), 6270 Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4065, 1 /* Error */, "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065", "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'."), 6271 Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4066, 1 /* Error */, "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066", "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'."), 6272 Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4067, 1 /* Error */, "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067", "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'."), 6273 Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4068, 1 /* Error */, "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068", "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named."), 6274 Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4069, 1 /* Error */, "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069", "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'."), 6275 Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: diag(4070, 1 /* Error */, "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070", "Parameter '{0}' of public static method from exported class has or is using private name '{1}'."), 6276 Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4071, 1 /* Error */, "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071", "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named."), 6277 Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4072, 1 /* Error */, "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072", "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'."), 6278 Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: diag(4073, 1 /* Error */, "Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073", "Parameter '{0}' of public method from exported class has or is using private name '{1}'."), 6279 Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4074, 1 /* Error */, "Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074", "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'."), 6280 Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: diag(4075, 1 /* Error */, "Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075", "Parameter '{0}' of method from exported interface has or is using private name '{1}'."), 6281 Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4076, 1 /* Error */, "Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076", "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named."), 6282 Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: diag(4077, 1 /* Error */, "Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077", "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'."), 6283 Parameter_0_of_exported_function_has_or_is_using_private_name_1: diag(4078, 1 /* Error */, "Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078", "Parameter '{0}' of exported function has or is using private name '{1}'."), 6284 Exported_type_alias_0_has_or_is_using_private_name_1: diag(4081, 1 /* Error */, "Exported_type_alias_0_has_or_is_using_private_name_1_4081", "Exported type alias '{0}' has or is using private name '{1}'."), 6285 Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, 1 /* Error */, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."), 6286 Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, 1 /* Error */, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."), 6287 Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2: diag(4084, 1 /* Error */, "Exported_type_alias_0_has_or_is_using_private_name_1_from_module_2_4084", "Exported type alias '{0}' has or is using private name '{1}' from module {2}."), 6288 Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, 1 /* Error */, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."), 6289 Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."), 6290 Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, 1 /* Error */, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."), 6291 Property_0_of_exported_class_expression_may_not_be_private_or_protected: diag(4094, 1 /* Error */, "Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094", "Property '{0}' of exported class expression may not be private or protected."), 6292 Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4095, 1 /* Error */, "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095", "Public static method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."), 6293 Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4096, 1 /* Error */, "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096", "Public static method '{0}' of exported class has or is using name '{1}' from private module '{2}'."), 6294 Public_static_method_0_of_exported_class_has_or_is_using_private_name_1: diag(4097, 1 /* Error */, "Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097", "Public static method '{0}' of exported class has or is using private name '{1}'."), 6295 Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4098, 1 /* Error */, "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098", "Public method '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named."), 6296 Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: diag(4099, 1 /* Error */, "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099", "Public method '{0}' of exported class has or is using name '{1}' from private module '{2}'."), 6297 Public_method_0_of_exported_class_has_or_is_using_private_name_1: diag(4100, 1 /* Error */, "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100", "Public method '{0}' of exported class has or is using private name '{1}'."), 6298 Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4101, 1 /* Error */, "Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101", "Method '{0}' of exported interface has or is using name '{1}' from private module '{2}'."), 6299 Method_0_of_exported_interface_has_or_is_using_private_name_1: diag(4102, 1 /* Error */, "Method_0_of_exported_interface_has_or_is_using_private_name_1_4102", "Method '{0}' of exported interface has or is using private name '{1}'."), 6300 Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1: diag(4103, 1 /* Error */, "Type_parameter_0_of_exported_mapped_object_type_is_using_private_name_1_4103", "Type parameter '{0}' of exported mapped object type is using private name '{1}'."), 6301 The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1: diag(4104, 1 /* Error */, "The_type_0_is_readonly_and_cannot_be_assigned_to_the_mutable_type_1_4104", "The type '{0}' is 'readonly' and cannot be assigned to the mutable type '{1}'."), 6302 Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter: diag(4105, 1 /* Error */, "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105", "Private or protected member '{0}' cannot be accessed on a type parameter."), 6303 Parameter_0_of_accessor_has_or_is_using_private_name_1: diag(4106, 1 /* Error */, "Parameter_0_of_accessor_has_or_is_using_private_name_1_4106", "Parameter '{0}' of accessor has or is using private name '{1}'."), 6304 Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2: diag(4107, 1 /* Error */, "Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2_4107", "Parameter '{0}' of accessor has or is using name '{1}' from private module '{2}'."), 6305 Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: diag(4108, 1 /* Error */, "Parameter_0_of_accessor_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4108", "Parameter '{0}' of accessor has or is using name '{1}' from external module '{2}' but cannot be named."), 6306 Type_arguments_for_0_circularly_reference_themselves: diag(4109, 1 /* Error */, "Type_arguments_for_0_circularly_reference_themselves_4109", "Type arguments for '{0}' circularly reference themselves."), 6307 Tuple_type_arguments_circularly_reference_themselves: diag(4110, 1 /* Error */, "Tuple_type_arguments_circularly_reference_themselves_4110", "Tuple type arguments circularly reference themselves."), 6308 Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0: diag(4111, 1 /* Error */, "Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0_4111", "Property '{0}' comes from an index signature, so it must be accessed with ['{0}']."), 6309 This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class: diag(4112, 1 /* Error */, "This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another__4112", "This member cannot have an 'override' modifier because its containing class '{0}' does not extend another class."), 6310 This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0: diag(4113, 1 /* Error */, "This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_4113", "This member cannot have an 'override' modifier because it is not declared in the base class '{0}'."), 6311 This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0: diag(4114, 1 /* Error */, "This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0_4114", "This member must have an 'override' modifier because it overrides a member in the base class '{0}'."), 6312 This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0: diag(4115, 1 /* Error */, "This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0_4115", "This parameter property must have an 'override' modifier because it overrides a member in base class '{0}'."), 6313 This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0: diag(4116, 1 /* Error */, "This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116", "This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."), 6314 This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4117, 1 /* Error */, "This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117", "This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"), 6315 The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized: diag(4118, 1 /* Error */, "The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118", "The type of this node cannot be serialized because its property '{0}' cannot be serialized."), 6316 This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0: diag(4119, 1 /* Error */, "This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119", "This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."), 6317 This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0: diag(4120, 1 /* Error */, "This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120", "This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."), 6318 This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class: diag(4121, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121", "This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."), 6319 This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."), 6320 This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"), 6321 Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."), 6322 resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4125, 1 /* Error */, "resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_wi_4125", "'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."), 6323 The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."), 6324 Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."), 6325 File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."), 6326 Cannot_read_file_0_Colon_1: diag(5012, 1 /* Error */, "Cannot_read_file_0_Colon_1_5012", "Cannot read file '{0}': {1}."), 6327 Failed_to_parse_file_0_Colon_1: diag(5014, 1 /* Error */, "Failed_to_parse_file_0_Colon_1_5014", "Failed to parse file '{0}': {1}."), 6328 Unknown_compiler_option_0: diag(5023, 1 /* Error */, "Unknown_compiler_option_0_5023", "Unknown compiler option '{0}'."), 6329 Compiler_option_0_requires_a_value_of_type_1: diag(5024, 1 /* Error */, "Compiler_option_0_requires_a_value_of_type_1_5024", "Compiler option '{0}' requires a value of type {1}."), 6330 Unknown_compiler_option_0_Did_you_mean_1: diag(5025, 1 /* Error */, "Unknown_compiler_option_0_Did_you_mean_1_5025", "Unknown compiler option '{0}'. Did you mean '{1}'?"), 6331 Could_not_write_file_0_Colon_1: diag(5033, 1 /* Error */, "Could_not_write_file_0_Colon_1_5033", "Could not write file '{0}': {1}."), 6332 Option_project_cannot_be_mixed_with_source_files_on_a_command_line: diag(5042, 1 /* Error */, "Option_project_cannot_be_mixed_with_source_files_on_a_command_line_5042", "Option 'project' cannot be mixed with source files on a command line."), 6333 Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher: diag(5047, 1 /* Error */, "Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES_5047", "Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher."), 6334 Option_0_cannot_be_specified_when_option_target_is_ES3: diag(5048, 1 /* Error */, "Option_0_cannot_be_specified_when_option_target_is_ES3_5048", "Option '{0}' cannot be specified when option 'target' is 'ES3'."), 6335 Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: diag(5051, 1 /* Error */, "Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided_5051", "Option '{0} can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided."), 6336 Option_0_cannot_be_specified_without_specifying_option_1: diag(5052, 1 /* Error */, "Option_0_cannot_be_specified_without_specifying_option_1_5052", "Option '{0}' cannot be specified without specifying option '{1}'."), 6337 Option_0_cannot_be_specified_with_option_1: diag(5053, 1 /* Error */, "Option_0_cannot_be_specified_with_option_1_5053", "Option '{0}' cannot be specified with option '{1}'."), 6338 A_tsconfig_json_file_is_already_defined_at_Colon_0: diag(5054, 1 /* Error */, "A_tsconfig_json_file_is_already_defined_at_Colon_0_5054", "A 'tsconfig.json' file is already defined at: '{0}'."), 6339 Cannot_write_file_0_because_it_would_overwrite_input_file: diag(5055, 1 /* Error */, "Cannot_write_file_0_because_it_would_overwrite_input_file_5055", "Cannot write file '{0}' because it would overwrite input file."), 6340 Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: diag(5056, 1 /* Error */, "Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files_5056", "Cannot write file '{0}' because it would be overwritten by multiple input files."), 6341 Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: diag(5057, 1 /* Error */, "Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0_5057", "Cannot find a tsconfig.json file at the specified directory: '{0}'."), 6342 The_specified_path_does_not_exist_Colon_0: diag(5058, 1 /* Error */, "The_specified_path_does_not_exist_Colon_0_5058", "The specified path does not exist: '{0}'."), 6343 Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: diag(5059, 1 /* Error */, "Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier_5059", "Invalid value for '--reactNamespace'. '{0}' is not a valid identifier."), 6344 Pattern_0_can_have_at_most_one_Asterisk_character: diag(5061, 1 /* Error */, "Pattern_0_can_have_at_most_one_Asterisk_character_5061", "Pattern '{0}' can have at most one '*' character."), 6345 Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character: diag(5062, 1 /* Error */, "Substitution_0_in_pattern_1_can_have_at_most_one_Asterisk_character_5062", "Substitution '{0}' in pattern '{1}' can have at most one '*' character."), 6346 Substitutions_for_pattern_0_should_be_an_array: diag(5063, 1 /* Error */, "Substitutions_for_pattern_0_should_be_an_array_5063", "Substitutions for pattern '{0}' should be an array."), 6347 Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: diag(5064, 1 /* Error */, "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064", "Substitution '{0}' for pattern '{1}' has incorrect type, expected 'string', got '{2}'."), 6348 File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5065, 1 /* Error */, "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065", "File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '{0}'."), 6349 Substitutions_for_pattern_0_shouldn_t_be_an_empty_array: diag(5066, 1 /* Error */, "Substitutions_for_pattern_0_shouldn_t_be_an_empty_array_5066", "Substitutions for pattern '{0}' shouldn't be an empty array."), 6350 Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name: diag(5067, 1 /* Error */, "Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name_5067", "Invalid value for 'jsxFactory'. '{0}' is not a valid identifier or qualified-name."), 6351 Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: diag(5068, 1 /* Error */, "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068", "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig."), 6352 Option_0_cannot_be_specified_without_specifying_option_1_or_option_2: diag(5069, 1 /* Error */, "Option_0_cannot_be_specified_without_specifying_option_1_or_option_2_5069", "Option '{0}' cannot be specified without specifying option '{1}' or option '{2}'."), 6353 Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy: diag(5070, 1 /* Error */, "Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy_5070", "Option '--resolveJsonModule' cannot be specified without 'node' module resolution strategy."), 6354 Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_esNext: diag(5071, 1 /* Error */, "Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs_amd_es2015_or_5071", "Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs', 'amd', 'es2015' or 'esNext'."), 6355 Unknown_build_option_0: diag(5072, 1 /* Error */, "Unknown_build_option_0_5072", "Unknown build option '{0}'."), 6356 Build_option_0_requires_a_value_of_type_1: diag(5073, 1 /* Error */, "Build_option_0_requires_a_value_of_type_1_5073", "Build option '{0}' requires a value of type {1}."), 6357 Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified: diag(5074, 1 /* Error */, "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074", "Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."), 6358 _0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2: diag(5075, 1 /* Error */, "_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075", "'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."), 6359 _0_and_1_operations_cannot_be_mixed_without_parentheses: diag(5076, 1 /* Error */, "_0_and_1_operations_cannot_be_mixed_without_parentheses_5076", "'{0}' and '{1}' operations cannot be mixed without parentheses."), 6360 Unknown_build_option_0_Did_you_mean_1: diag(5077, 1 /* Error */, "Unknown_build_option_0_Did_you_mean_1_5077", "Unknown build option '{0}'. Did you mean '{1}'?"), 6361 Unknown_watch_option_0: diag(5078, 1 /* Error */, "Unknown_watch_option_0_5078", "Unknown watch option '{0}'."), 6362 Unknown_watch_option_0_Did_you_mean_1: diag(5079, 1 /* Error */, "Unknown_watch_option_0_Did_you_mean_1_5079", "Unknown watch option '{0}'. Did you mean '{1}'?"), 6363 Watch_option_0_requires_a_value_of_type_1: diag(5080, 1 /* Error */, "Watch_option_0_requires_a_value_of_type_1_5080", "Watch option '{0}' requires a value of type {1}."), 6364 Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0: diag(5081, 1 /* Error */, "Cannot_find_a_tsconfig_json_file_at_the_current_directory_Colon_0_5081", "Cannot find a tsconfig.json file at the current directory: {0}."), 6365 _0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1: diag(5082, 1 /* Error */, "_0_could_be_instantiated_with_an_arbitrary_type_which_could_be_unrelated_to_1_5082", "'{0}' could be instantiated with an arbitrary type which could be unrelated to '{1}'."), 6366 Cannot_read_file_0: diag(5083, 1 /* Error */, "Cannot_read_file_0_5083", "Cannot read file '{0}'."), 6367 Tuple_members_must_all_have_names_or_all_not_have_names: diag(5084, 1 /* Error */, "Tuple_members_must_all_have_names_or_all_not_have_names_5084", "Tuple members must all have names or all not have names."), 6368 A_tuple_member_cannot_be_both_optional_and_rest: diag(5085, 1 /* Error */, "A_tuple_member_cannot_be_both_optional_and_rest_5085", "A tuple member cannot be both optional and rest."), 6369 A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type: diag(5086, 1 /* Error */, "A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_c_5086", "A labeled tuple element is declared as optional with a question mark after the name and before the colon, rather than after the type."), 6370 A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type: diag(5087, 1 /* Error */, "A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type_5087", "A labeled tuple element is declared as rest with a '...' before the name, rather than before the type."), 6371 The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialized_A_type_annotation_is_necessary: diag(5088, 1 /* Error */, "The_inferred_type_of_0_references_a_type_with_a_cyclic_structure_which_cannot_be_trivially_serialize_5088", "The inferred type of '{0}' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary."), 6372 Option_0_cannot_be_specified_when_option_jsx_is_1: diag(5089, 1 /* Error */, "Option_0_cannot_be_specified_when_option_jsx_is_1_5089", "Option '{0}' cannot be specified when option 'jsx' is '{1}'."), 6373 Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash: diag(5090, 1 /* Error */, "Non_relative_paths_are_not_allowed_when_baseUrl_is_not_set_Did_you_forget_a_leading_Slash_5090", "Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?"), 6374 Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled: diag(5091, 1 /* Error */, "Option_preserveConstEnums_cannot_be_disabled_when_isolatedModules_is_enabled_5091", "Option 'preserveConstEnums' cannot be disabled when 'isolatedModules' is enabled."), 6375 The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."), 6376 Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."), 6377 Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."), 6378 Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_preserveValueImports_can_only_be_used_when_module_is_set_to_es2015_or_later_5095", "Option 'preserveValueImports' can only be used when 'module' is set to 'es2015' or later."), 6379 Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."), 6380 Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."), 6381 Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."), 6382 Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: diag(6004, 3 /* Message */, "Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations_6004", "Specify the location where debugger should locate TypeScript files instead of source locations."), 6383 Watch_input_files: diag(6005, 3 /* Message */, "Watch_input_files_6005", "Watch input files."), 6384 Redirect_output_structure_to_the_directory: diag(6006, 3 /* Message */, "Redirect_output_structure_to_the_directory_6006", "Redirect output structure to the directory."), 6385 Do_not_erase_const_enum_declarations_in_generated_code: diag(6007, 3 /* Message */, "Do_not_erase_const_enum_declarations_in_generated_code_6007", "Do not erase const enum declarations in generated code."), 6386 Do_not_emit_outputs_if_any_errors_were_reported: diag(6008, 3 /* Message */, "Do_not_emit_outputs_if_any_errors_were_reported_6008", "Do not emit outputs if any errors were reported."), 6387 Do_not_emit_comments_to_output: diag(6009, 3 /* Message */, "Do_not_emit_comments_to_output_6009", "Do not emit comments to output."), 6388 Do_not_emit_outputs: diag(6010, 3 /* Message */, "Do_not_emit_outputs_6010", "Do not emit outputs."), 6389 Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, 3 /* Message */, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."), 6390 Skip_type_checking_of_declaration_files: diag(6012, 3 /* Message */, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."), 6391 Do_not_resolve_the_real_path_of_symlinks: diag(6013, 3 /* Message */, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."), 6392 Only_emit_d_ts_declaration_files: diag(6014, 3 /* Message */, "Only_emit_d_ts_declaration_files_6014", "Only emit '.d.ts' declaration files."), 6393 Specify_ECMAScript_target_version: diag(6015, 3 /* Message */, "Specify_ECMAScript_target_version_6015", "Specify ECMAScript target version."), 6394 Specify_module_code_generation: diag(6016, 3 /* Message */, "Specify_module_code_generation_6016", "Specify module code generation."), 6395 Print_this_message: diag(6017, 3 /* Message */, "Print_this_message_6017", "Print this message."), 6396 Print_the_compiler_s_version: diag(6019, 3 /* Message */, "Print_the_compiler_s_version_6019", "Print the compiler's version."), 6397 Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json: diag(6020, 3 /* Message */, "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020", "Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'."), 6398 Syntax_Colon_0: diag(6023, 3 /* Message */, "Syntax_Colon_0_6023", "Syntax: {0}"), 6399 options: diag(6024, 3 /* Message */, "options_6024", "options"), 6400 file: diag(6025, 3 /* Message */, "file_6025", "file"), 6401 Examples_Colon_0: diag(6026, 3 /* Message */, "Examples_Colon_0_6026", "Examples: {0}"), 6402 Options_Colon: diag(6027, 3 /* Message */, "Options_Colon_6027", "Options:"), 6403 Version_0: diag(6029, 3 /* Message */, "Version_0_6029", "Version {0}"), 6404 Insert_command_line_options_and_files_from_a_file: diag(6030, 3 /* Message */, "Insert_command_line_options_and_files_from_a_file_6030", "Insert command line options and files from a file."), 6405 Starting_compilation_in_watch_mode: diag(6031, 3 /* Message */, "Starting_compilation_in_watch_mode_6031", "Starting compilation in watch mode..."), 6406 File_change_detected_Starting_incremental_compilation: diag(6032, 3 /* Message */, "File_change_detected_Starting_incremental_compilation_6032", "File change detected. Starting incremental compilation..."), 6407 KIND: diag(6034, 3 /* Message */, "KIND_6034", "KIND"), 6408 FILE: diag(6035, 3 /* Message */, "FILE_6035", "FILE"), 6409 VERSION: diag(6036, 3 /* Message */, "VERSION_6036", "VERSION"), 6410 LOCATION: diag(6037, 3 /* Message */, "LOCATION_6037", "LOCATION"), 6411 DIRECTORY: diag(6038, 3 /* Message */, "DIRECTORY_6038", "DIRECTORY"), 6412 STRATEGY: diag(6039, 3 /* Message */, "STRATEGY_6039", "STRATEGY"), 6413 FILE_OR_DIRECTORY: diag(6040, 3 /* Message */, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"), 6414 Errors_Files: diag(6041, 3 /* Message */, "Errors_Files_6041", "Errors Files"), 6415 Generates_corresponding_map_file: diag(6043, 3 /* Message */, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."), 6416 Compiler_option_0_expects_an_argument: diag(6044, 1 /* Error */, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."), 6417 Unterminated_quoted_string_in_response_file_0: diag(6045, 1 /* Error */, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."), 6418 Argument_for_0_option_must_be_Colon_1: diag(6046, 1 /* Error */, "Argument_for_0_option_must_be_Colon_1_6046", "Argument for '{0}' option must be: {1}."), 6419 Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: diag(6048, 1 /* Error */, "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048", "Locale must be of the form <language> or <language>-<territory>. For example '{0}' or '{1}'."), 6420 Unable_to_open_file_0: diag(6050, 1 /* Error */, "Unable_to_open_file_0_6050", "Unable to open file '{0}'."), 6421 Corrupted_locale_file_0: diag(6051, 1 /* Error */, "Corrupted_locale_file_0_6051", "Corrupted locale file {0}."), 6422 Raise_error_on_expressions_and_declarations_with_an_implied_any_type: diag(6052, 3 /* Message */, "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052", "Raise error on expressions and declarations with an implied 'any' type."), 6423 File_0_not_found: diag(6053, 1 /* Error */, "File_0_not_found_6053", "File '{0}' not found."), 6424 File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1: diag(6054, 1 /* Error */, "File_0_has_an_unsupported_extension_The_only_supported_extensions_are_1_6054", "File '{0}' has an unsupported extension. The only supported extensions are {1}."), 6425 Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: diag(6055, 3 /* Message */, "Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures_6055", "Suppress noImplicitAny errors for indexing objects lacking index signatures."), 6426 Do_not_emit_declarations_for_code_that_has_an_internal_annotation: diag(6056, 3 /* Message */, "Do_not_emit_declarations_for_code_that_has_an_internal_annotation_6056", "Do not emit declarations for code that has an '@internal' annotation."), 6427 Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: diag(6058, 3 /* Message */, "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058", "Specify the root directory of input files. Use to control the output directory structure with --outDir."), 6428 File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: diag(6059, 1 /* Error */, "File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files_6059", "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files."), 6429 Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: diag(6060, 3 /* Message */, "Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix_6060", "Specify the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)."), 6430 NEWLINE: diag(6061, 3 /* Message */, "NEWLINE_6061", "NEWLINE"), 6431 Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line: diag(6064, 1 /* Error */, "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_null_on_command_line_6064", "Option '{0}' can only be specified in 'tsconfig.json' file or set to 'null' on command line."), 6432 Enables_experimental_support_for_ES7_decorators: diag(6065, 3 /* Message */, "Enables_experimental_support_for_ES7_decorators_6065", "Enables experimental support for ES7 decorators."), 6433 Enables_experimental_support_for_emitting_type_metadata_for_decorators: diag(6066, 3 /* Message */, "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066", "Enables experimental support for emitting type metadata for decorators."), 6434 Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6: diag(6069, 3 /* Message */, "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069", "Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6)."), 6435 Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: diag(6070, 3 /* Message */, "Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file_6070", "Initializes a TypeScript project and creates a tsconfig.json file."), 6436 Successfully_created_a_tsconfig_json_file: diag(6071, 3 /* Message */, "Successfully_created_a_tsconfig_json_file_6071", "Successfully created a tsconfig.json file."), 6437 Suppress_excess_property_checks_for_object_literals: diag(6072, 3 /* Message */, "Suppress_excess_property_checks_for_object_literals_6072", "Suppress excess property checks for object literals."), 6438 Stylize_errors_and_messages_using_color_and_context_experimental: diag(6073, 3 /* Message */, "Stylize_errors_and_messages_using_color_and_context_experimental_6073", "Stylize errors and messages using color and context (experimental)."), 6439 Do_not_report_errors_on_unused_labels: diag(6074, 3 /* Message */, "Do_not_report_errors_on_unused_labels_6074", "Do not report errors on unused labels."), 6440 Report_error_when_not_all_code_paths_in_function_return_a_value: diag(6075, 3 /* Message */, "Report_error_when_not_all_code_paths_in_function_return_a_value_6075", "Report error when not all code paths in function return a value."), 6441 Report_errors_for_fallthrough_cases_in_switch_statement: diag(6076, 3 /* Message */, "Report_errors_for_fallthrough_cases_in_switch_statement_6076", "Report errors for fallthrough cases in switch statement."), 6442 Do_not_report_errors_on_unreachable_code: diag(6077, 3 /* Message */, "Do_not_report_errors_on_unreachable_code_6077", "Do not report errors on unreachable code."), 6443 Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, 3 /* Message */, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."), 6444 Specify_library_files_to_be_included_in_the_compilation: diag(6079, 3 /* Message */, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."), 6445 Specify_JSX_code_generation: diag(6080, 3 /* Message */, "Specify_JSX_code_generation_6080", "Specify JSX code generation."), 6446 File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, 3 /* Message */, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."), 6447 Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, 1 /* Error */, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."), 6448 Base_directory_to_resolve_non_absolute_module_names: diag(6083, 3 /* Message */, "Base_directory_to_resolve_non_absolute_module_names_6083", "Base directory to resolve non-absolute module names."), 6449 Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: diag(6084, 3 /* Message */, "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"), 6450 Enable_tracing_of_the_name_resolution_process: diag(6085, 3 /* Message */, "Enable_tracing_of_the_name_resolution_process_6085", "Enable tracing of the name resolution process."), 6451 Resolving_module_0_from_1: diag(6086, 3 /* Message */, "Resolving_module_0_from_1_6086", "======== Resolving module '{0}' from '{1}'. ========"), 6452 Explicitly_specified_module_resolution_kind_Colon_0: diag(6087, 3 /* Message */, "Explicitly_specified_module_resolution_kind_Colon_0_6087", "Explicitly specified module resolution kind: '{0}'."), 6453 Module_resolution_kind_is_not_specified_using_0: diag(6088, 3 /* Message */, "Module_resolution_kind_is_not_specified_using_0_6088", "Module resolution kind is not specified, using '{0}'."), 6454 Module_name_0_was_successfully_resolved_to_1: diag(6089, 3 /* Message */, "Module_name_0_was_successfully_resolved_to_1_6089", "======== Module name '{0}' was successfully resolved to '{1}'. ========"), 6455 Module_name_0_was_not_resolved: diag(6090, 3 /* Message */, "Module_name_0_was_not_resolved_6090", "======== Module name '{0}' was not resolved. ========"), 6456 paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0: diag(6091, 3 /* Message */, "paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091", "'paths' option is specified, looking for a pattern to match module name '{0}'."), 6457 Module_name_0_matched_pattern_1: diag(6092, 3 /* Message */, "Module_name_0_matched_pattern_1_6092", "Module name '{0}', matched pattern '{1}'."), 6458 Trying_substitution_0_candidate_module_location_Colon_1: diag(6093, 3 /* Message */, "Trying_substitution_0_candidate_module_location_Colon_1_6093", "Trying substitution '{0}', candidate module location: '{1}'."), 6459 Resolving_module_name_0_relative_to_base_url_1_2: diag(6094, 3 /* Message */, "Resolving_module_name_0_relative_to_base_url_1_2_6094", "Resolving module name '{0}' relative to base url '{1}' - '{2}'."), 6460 Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1: diag(6095, 3 /* Message */, "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095", "Loading module as file / folder, candidate module location '{0}', target file type '{1}'."), 6461 File_0_does_not_exist: diag(6096, 3 /* Message */, "File_0_does_not_exist_6096", "File '{0}' does not exist."), 6462 File_0_exist_use_it_as_a_name_resolution_result: diag(6097, 3 /* Message */, "File_0_exist_use_it_as_a_name_resolution_result_6097", "File '{0}' exist - use it as a name resolution result."), 6463 Loading_module_0_from_node_modules_folder_target_file_type_1: diag(6098, 3 /* Message */, "Loading_module_0_from_node_modules_folder_target_file_type_1_6098", "Loading module '{0}' from 'node_modules' folder, target file type '{1}'."), 6464 Found_package_json_at_0: diag(6099, 3 /* Message */, "Found_package_json_at_0_6099", "Found 'package.json' at '{0}'."), 6465 package_json_does_not_have_a_0_field: diag(6100, 3 /* Message */, "package_json_does_not_have_a_0_field_6100", "'package.json' does not have a '{0}' field."), 6466 package_json_has_0_field_1_that_references_2: diag(6101, 3 /* Message */, "package_json_has_0_field_1_that_references_2_6101", "'package.json' has '{0}' field '{1}' that references '{2}'."), 6467 Allow_javascript_files_to_be_compiled: diag(6102, 3 /* Message */, "Allow_javascript_files_to_be_compiled_6102", "Allow javascript files to be compiled."), 6468 Checking_if_0_is_the_longest_matching_prefix_for_1_2: diag(6104, 3 /* Message */, "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104", "Checking if '{0}' is the longest matching prefix for '{1}' - '{2}'."), 6469 Expected_type_of_0_field_in_package_json_to_be_1_got_2: diag(6105, 3 /* Message */, "Expected_type_of_0_field_in_package_json_to_be_1_got_2_6105", "Expected type of '{0}' field in 'package.json' to be '{1}', got '{2}'."), 6470 baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: diag(6106, 3 /* Message */, "baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1_6106", "'baseUrl' option is set to '{0}', using this value to resolve non-relative module name '{1}'."), 6471 rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: diag(6107, 3 /* Message */, "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107", "'rootDirs' option is set, using it to resolve relative module name '{0}'."), 6472 Longest_matching_prefix_for_0_is_1: diag(6108, 3 /* Message */, "Longest_matching_prefix_for_0_is_1_6108", "Longest matching prefix for '{0}' is '{1}'."), 6473 Loading_0_from_the_root_dir_1_candidate_location_2: diag(6109, 3 /* Message */, "Loading_0_from_the_root_dir_1_candidate_location_2_6109", "Loading '{0}' from the root dir '{1}', candidate location '{2}'."), 6474 Trying_other_entries_in_rootDirs: diag(6110, 3 /* Message */, "Trying_other_entries_in_rootDirs_6110", "Trying other entries in 'rootDirs'."), 6475 Module_resolution_using_rootDirs_has_failed: diag(6111, 3 /* Message */, "Module_resolution_using_rootDirs_has_failed_6111", "Module resolution using 'rootDirs' has failed."), 6476 Do_not_emit_use_strict_directives_in_module_output: diag(6112, 3 /* Message */, "Do_not_emit_use_strict_directives_in_module_output_6112", "Do not emit 'use strict' directives in module output."), 6477 Enable_strict_null_checks: diag(6113, 3 /* Message */, "Enable_strict_null_checks_6113", "Enable strict null checks."), 6478 Unknown_option_excludes_Did_you_mean_exclude: diag(6114, 1 /* Error */, "Unknown_option_excludes_Did_you_mean_exclude_6114", "Unknown option 'excludes'. Did you mean 'exclude'?"), 6479 Raise_error_on_this_expressions_with_an_implied_any_type: diag(6115, 3 /* Message */, "Raise_error_on_this_expressions_with_an_implied_any_type_6115", "Raise error on 'this' expressions with an implied 'any' type."), 6480 Resolving_type_reference_directive_0_containing_file_1_root_directory_2: diag(6116, 3 /* Message */, "Resolving_type_reference_directive_0_containing_file_1_root_directory_2_6116", "======== Resolving type reference directive '{0}', containing file '{1}', root directory '{2}'. ========"), 6481 Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: diag(6119, 3 /* Message */, "Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2_6119", "======== Type reference directive '{0}' was successfully resolved to '{1}', primary: {2}. ========"), 6482 Type_reference_directive_0_was_not_resolved: diag(6120, 3 /* Message */, "Type_reference_directive_0_was_not_resolved_6120", "======== Type reference directive '{0}' was not resolved. ========"), 6483 Resolving_with_primary_search_path_0: diag(6121, 3 /* Message */, "Resolving_with_primary_search_path_0_6121", "Resolving with primary search path '{0}'."), 6484 Root_directory_cannot_be_determined_skipping_primary_search_paths: diag(6122, 3 /* Message */, "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122", "Root directory cannot be determined, skipping primary search paths."), 6485 Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set: diag(6123, 3 /* Message */, "Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set_6123", "======== Resolving type reference directive '{0}', containing file '{1}', root directory not set. ========"), 6486 Type_declaration_files_to_be_included_in_compilation: diag(6124, 3 /* Message */, "Type_declaration_files_to_be_included_in_compilation_6124", "Type declaration files to be included in compilation."), 6487 Looking_up_in_node_modules_folder_initial_location_0: diag(6125, 3 /* Message */, "Looking_up_in_node_modules_folder_initial_location_0_6125", "Looking up in 'node_modules' folder, initial location '{0}'."), 6488 Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder: diag(6126, 3 /* Message */, "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126", "Containing file is not specified and root directory cannot be determined, skipping lookup in 'node_modules' folder."), 6489 Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1: diag(6127, 3 /* Message */, "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1_6127", "======== Resolving type reference directive '{0}', containing file not set, root directory '{1}'. ========"), 6490 Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: diag(6128, 3 /* Message */, "Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set_6128", "======== Resolving type reference directive '{0}', containing file not set, root directory not set. ========"), 6491 Resolving_real_path_for_0_result_1: diag(6130, 3 /* Message */, "Resolving_real_path_for_0_result_1_6130", "Resolving real path for '{0}', result '{1}'."), 6492 Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: diag(6131, 1 /* Error */, "Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system_6131", "Cannot compile modules using option '{0}' unless the '--module' flag is 'amd' or 'system'."), 6493 File_name_0_has_a_1_extension_stripping_it: diag(6132, 3 /* Message */, "File_name_0_has_a_1_extension_stripping_it_6132", "File name '{0}' has a '{1}' extension - stripping it."), 6494 _0_is_declared_but_its_value_is_never_read: diag(6133, 1 /* Error */, "_0_is_declared_but_its_value_is_never_read_6133", "'{0}' is declared but its value is never read.", true), 6495 Report_errors_on_unused_locals: diag(6134, 3 /* Message */, "Report_errors_on_unused_locals_6134", "Report errors on unused locals."), 6496 Report_errors_on_unused_parameters: diag(6135, 3 /* Message */, "Report_errors_on_unused_parameters_6135", "Report errors on unused parameters."), 6497 The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: diag(6136, 3 /* Message */, "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136", "The maximum dependency depth to search under node_modules and load JavaScript files."), 6498 Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1: diag(6137, 1 /* Error */, "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137", "Cannot import type declaration files. Consider importing '{0}' instead of '{1}'."), 6499 Property_0_is_declared_but_its_value_is_never_read: diag(6138, 1 /* Error */, "Property_0_is_declared_but_its_value_is_never_read_6138", "Property '{0}' is declared but its value is never read.", true), 6500 Import_emit_helpers_from_tslib: diag(6139, 3 /* Message */, "Import_emit_helpers_from_tslib_6139", "Import emit helpers from 'tslib'."), 6501 Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2: diag(6140, 1 /* Error */, "Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using__6140", "Auto discovery for typings is enabled in project '{0}'. Running extra resolution pass for module '{1}' using cache location '{2}'."), 6502 Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: diag(6141, 3 /* Message */, "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141", 'Parse in strict mode and emit "use strict" for each source file.'), 6503 Module_0_was_resolved_to_1_but_jsx_is_not_set: diag(6142, 1 /* Error */, "Module_0_was_resolved_to_1_but_jsx_is_not_set_6142", "Module '{0}' was resolved to '{1}', but '--jsx' is not set."), 6504 Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: diag(6144, 3 /* Message */, "Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144", "Module '{0}' was resolved as locally declared ambient module in file '{1}'."), 6505 Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified: diag(6145, 3 /* Message */, "Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145", "Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified."), 6506 Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h: diag(6146, 3 /* Message */, "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146", "Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."), 6507 Resolution_for_module_0_was_found_in_cache_from_location_1: diag(6147, 3 /* Message */, "Resolution_for_module_0_was_found_in_cache_from_location_1_6147", "Resolution for module '{0}' was found in cache from location '{1}'."), 6508 Directory_0_does_not_exist_skipping_all_lookups_in_it: diag(6148, 3 /* Message */, "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148", "Directory '{0}' does not exist, skipping all lookups in it."), 6509 Show_diagnostic_information: diag(6149, 3 /* Message */, "Show_diagnostic_information_6149", "Show diagnostic information."), 6510 Show_verbose_diagnostic_information: diag(6150, 3 /* Message */, "Show_verbose_diagnostic_information_6150", "Show verbose diagnostic information."), 6511 Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file: diag(6151, 3 /* Message */, "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151", "Emit a single file with source maps instead of having a separate file."), 6512 Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set: diag(6152, 3 /* Message */, "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152", "Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set."), 6513 Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule: diag(6153, 3 /* Message */, "Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule_6153", "Transpile each file as a separate module (similar to 'ts.transpileModule')."), 6514 Print_names_of_generated_files_part_of_the_compilation: diag(6154, 3 /* Message */, "Print_names_of_generated_files_part_of_the_compilation_6154", "Print names of generated files part of the compilation."), 6515 Print_names_of_files_part_of_the_compilation: diag(6155, 3 /* Message */, "Print_names_of_files_part_of_the_compilation_6155", "Print names of files part of the compilation."), 6516 The_locale_used_when_displaying_messages_to_the_user_e_g_en_us: diag(6156, 3 /* Message */, "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156", "The locale used when displaying messages to the user (e.g. 'en-us')"), 6517 Do_not_generate_custom_helper_functions_like_extends_in_compiled_output: diag(6157, 3 /* Message */, "Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157", "Do not generate custom helper functions like '__extends' in compiled output."), 6518 Do_not_include_the_default_library_file_lib_d_ts: diag(6158, 3 /* Message */, "Do_not_include_the_default_library_file_lib_d_ts_6158", "Do not include the default library file (lib.d.ts)."), 6519 Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files: diag(6159, 3 /* Message */, "Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files_6159", "Do not add triple-slash references or imported modules to the list of compiled files."), 6520 Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files: diag(6160, 3 /* Message */, "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160", "[Deprecated] Use '--skipLibCheck' instead. Skip type checking of default library declaration files."), 6521 List_of_folders_to_include_type_definitions_from: diag(6161, 3 /* Message */, "List_of_folders_to_include_type_definitions_from_6161", "List of folders to include type definitions from."), 6522 Disable_size_limitations_on_JavaScript_projects: diag(6162, 3 /* Message */, "Disable_size_limitations_on_JavaScript_projects_6162", "Disable size limitations on JavaScript projects."), 6523 The_character_set_of_the_input_files: diag(6163, 3 /* Message */, "The_character_set_of_the_input_files_6163", "The character set of the input files."), 6524 Do_not_truncate_error_messages: diag(6165, 3 /* Message */, "Do_not_truncate_error_messages_6165", "Do not truncate error messages."), 6525 Output_directory_for_generated_declaration_files: diag(6166, 3 /* Message */, "Output_directory_for_generated_declaration_files_6166", "Output directory for generated declaration files."), 6526 A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl: diag(6167, 3 /* Message */, "A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl_6167", "A series of entries which re-map imports to lookup locations relative to the 'baseUrl'."), 6527 List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime: diag(6168, 3 /* Message */, "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168", "List of root folders whose combined content represents the structure of the project at runtime."), 6528 Show_all_compiler_options: diag(6169, 3 /* Message */, "Show_all_compiler_options_6169", "Show all compiler options."), 6529 Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file: diag(6170, 3 /* Message */, "Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170", "[Deprecated] Use '--outFile' instead. Concatenate and emit output to single file"), 6530 Command_line_Options: diag(6171, 3 /* Message */, "Command_line_Options_6171", "Command-line Options"), 6531 Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3: diag(6179, 3 /* Message */, "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179", "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'."), 6532 Enable_all_strict_type_checking_options: diag(6180, 3 /* Message */, "Enable_all_strict_type_checking_options_6180", "Enable all strict type-checking options."), 6533 Scoped_package_detected_looking_in_0: diag(6182, 3 /* Message */, "Scoped_package_detected_looking_in_0_6182", "Scoped package detected, looking in '{0}'"), 6534 Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2: diag(6183, 3 /* Message */, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183", "Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."), 6535 Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3: diag(6184, 3 /* Message */, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184", "Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."), 6536 Enable_strict_checking_of_function_types: diag(6186, 3 /* Message */, "Enable_strict_checking_of_function_types_6186", "Enable strict checking of function types."), 6537 Enable_strict_checking_of_property_initialization_in_classes: diag(6187, 3 /* Message */, "Enable_strict_checking_of_property_initialization_in_classes_6187", "Enable strict checking of property initialization in classes."), 6538 Numeric_separators_are_not_allowed_here: diag(6188, 1 /* Error */, "Numeric_separators_are_not_allowed_here_6188", "Numeric separators are not allowed here."), 6539 Multiple_consecutive_numeric_separators_are_not_permitted: diag(6189, 1 /* Error */, "Multiple_consecutive_numeric_separators_are_not_permitted_6189", "Multiple consecutive numeric separators are not permitted."), 6540 Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen: diag(6191, 3 /* Message */, "Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191", "Whether to keep outdated console output in watch mode instead of clearing the screen."), 6541 All_imports_in_import_declaration_are_unused: diag(6192, 1 /* Error */, "All_imports_in_import_declaration_are_unused_6192", "All imports in import declaration are unused.", true), 6542 Found_1_error_Watching_for_file_changes: diag(6193, 3 /* Message */, "Found_1_error_Watching_for_file_changes_6193", "Found 1 error. Watching for file changes."), 6543 Found_0_errors_Watching_for_file_changes: diag(6194, 3 /* Message */, "Found_0_errors_Watching_for_file_changes_6194", "Found {0} errors. Watching for file changes."), 6544 Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols: diag(6195, 3 /* Message */, "Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195", "Resolve 'keyof' to string valued property names only (no numbers or symbols)."), 6545 _0_is_declared_but_never_used: diag(6196, 1 /* Error */, "_0_is_declared_but_never_used_6196", "'{0}' is declared but never used.", true), 6546 Include_modules_imported_with_json_extension: diag(6197, 3 /* Message */, "Include_modules_imported_with_json_extension_6197", "Include modules imported with '.json' extension"), 6547 All_destructured_elements_are_unused: diag(6198, 1 /* Error */, "All_destructured_elements_are_unused_6198", "All destructured elements are unused.", true), 6548 All_variables_are_unused: diag(6199, 1 /* Error */, "All_variables_are_unused_6199", "All variables are unused.", true), 6549 Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0: diag(6200, 1 /* Error */, "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200", "Definitions of the following identifiers conflict with those in another file: {0}"), 6550 Conflicts_are_in_this_file: diag(6201, 3 /* Message */, "Conflicts_are_in_this_file_6201", "Conflicts are in this file."), 6551 Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, 1 /* Error */, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"), 6552 _0_was_also_declared_here: diag(6203, 3 /* Message */, "_0_was_also_declared_here_6203", "'{0}' was also declared here."), 6553 and_here: diag(6204, 3 /* Message */, "and_here_6204", "and here."), 6554 All_type_parameters_are_unused: diag(6205, 1 /* Error */, "All_type_parameters_are_unused_6205", "All type parameters are unused."), 6555 package_json_has_a_typesVersions_field_with_version_specific_path_mappings: diag(6206, 3 /* Message */, "package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206", "'package.json' has a 'typesVersions' field with version-specific path mappings."), 6556 package_json_does_not_have_a_typesVersions_entry_that_matches_version_0: diag(6207, 3 /* Message */, "package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207", "'package.json' does not have a 'typesVersions' entry that matches version '{0}'."), 6557 package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2: diag(6208, 3 /* Message */, "package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_ma_6208", "'package.json' has a 'typesVersions' entry '{0}' that matches compiler version '{1}', looking for a pattern to match module name '{2}'."), 6558 package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range: diag(6209, 3 /* Message */, "package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range_6209", "'package.json' has a 'typesVersions' entry '{0}' that is not a valid semver range."), 6559 An_argument_for_0_was_not_provided: diag(6210, 3 /* Message */, "An_argument_for_0_was_not_provided_6210", "An argument for '{0}' was not provided."), 6560 An_argument_matching_this_binding_pattern_was_not_provided: diag(6211, 3 /* Message */, "An_argument_matching_this_binding_pattern_was_not_provided_6211", "An argument matching this binding pattern was not provided."), 6561 Did_you_mean_to_call_this_expression: diag(6212, 3 /* Message */, "Did_you_mean_to_call_this_expression_6212", "Did you mean to call this expression?"), 6562 Did_you_mean_to_use_new_with_this_expression: diag(6213, 3 /* Message */, "Did_you_mean_to_use_new_with_this_expression_6213", "Did you mean to use 'new' with this expression?"), 6563 Enable_strict_bind_call_and_apply_methods_on_functions: diag(6214, 3 /* Message */, "Enable_strict_bind_call_and_apply_methods_on_functions_6214", "Enable strict 'bind', 'call', and 'apply' methods on functions."), 6564 Using_compiler_options_of_project_reference_redirect_0: diag(6215, 3 /* Message */, "Using_compiler_options_of_project_reference_redirect_0_6215", "Using compiler options of project reference redirect '{0}'."), 6565 Found_1_error: diag(6216, 3 /* Message */, "Found_1_error_6216", "Found 1 error."), 6566 Found_0_errors: diag(6217, 3 /* Message */, "Found_0_errors_6217", "Found {0} errors."), 6567 Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2: diag(6218, 3 /* Message */, "Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2_6218", "======== Module name '{0}' was successfully resolved to '{1}' with Package ID '{2}'. ========"), 6568 Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3: diag(6219, 3 /* Message */, "Type_reference_directive_0_was_successfully_resolved_to_1_with_Package_ID_2_primary_Colon_3_6219", "======== Type reference directive '{0}' was successfully resolved to '{1}' with Package ID '{2}', primary: {3}. ========"), 6569 package_json_had_a_falsy_0_field: diag(6220, 3 /* Message */, "package_json_had_a_falsy_0_field_6220", "'package.json' had a falsy '{0}' field."), 6570 Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects: diag(6221, 3 /* Message */, "Disable_use_of_source_files_instead_of_declaration_files_from_referenced_projects_6221", "Disable use of source files instead of declaration files from referenced projects."), 6571 Emit_class_fields_with_Define_instead_of_Set: diag(6222, 3 /* Message */, "Emit_class_fields_with_Define_instead_of_Set_6222", "Emit class fields with Define instead of Set."), 6572 Generates_a_CPU_profile: diag(6223, 3 /* Message */, "Generates_a_CPU_profile_6223", "Generates a CPU profile."), 6573 Disable_solution_searching_for_this_project: diag(6224, 3 /* Message */, "Disable_solution_searching_for_this_project_6224", "Disable solution searching for this project."), 6574 Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling_UseFsEvents_UseFsEventsOnParentDirectory: diag(6225, 3 /* Message */, "Specify_strategy_for_watching_file_Colon_FixedPollingInterval_default_PriorityPollingInterval_Dynami_6225", "Specify strategy for watching file: 'FixedPollingInterval' (default), 'PriorityPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling', 'UseFsEvents', 'UseFsEventsOnParentDirectory'."), 6575 Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively_Colon_UseFsEvents_default_FixedPollingInterval_DynamicPriorityPolling_FixedChunkSizePolling: diag(6226, 3 /* Message */, "Specify_strategy_for_watching_directory_on_platforms_that_don_t_support_recursive_watching_natively__6226", "Specify strategy for watching directory on platforms that don't support recursive watching natively: 'UseFsEvents' (default), 'FixedPollingInterval', 'DynamicPriorityPolling', 'FixedChunkSizePolling'."), 6576 Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_FixedInterval_default_PriorityInterval_DynamicPriority_FixedChunkSize: diag(6227, 3 /* Message */, "Specify_strategy_for_creating_a_polling_watch_when_it_fails_to_create_using_file_system_events_Colon_6227", "Specify strategy for creating a polling watch when it fails to create using file system events: 'FixedInterval' (default), 'PriorityInterval', 'DynamicPriority', 'FixedChunkSize'."), 6577 Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3: diag(6229, 1 /* Error */, "Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3_6229", "Tag '{0}' expects at least '{1}' arguments, but the JSX factory '{2}' provides at most '{3}'."), 6578 Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line: diag(6230, 1 /* Error */, "Option_0_can_only_be_specified_in_tsconfig_json_file_or_set_to_false_or_null_on_command_line_6230", "Option '{0}' can only be specified in 'tsconfig.json' file or set to 'false' or 'null' on command line."), 6579 Could_not_resolve_the_path_0_with_the_extensions_Colon_1: diag(6231, 1 /* Error */, "Could_not_resolve_the_path_0_with_the_extensions_Colon_1_6231", "Could not resolve the path '{0}' with the extensions: {1}."), 6580 Declaration_augments_declaration_in_another_file_This_cannot_be_serialized: diag(6232, 1 /* Error */, "Declaration_augments_declaration_in_another_file_This_cannot_be_serialized_6232", "Declaration augments declaration in another file. This cannot be serialized."), 6581 This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file: diag(6233, 1 /* Error */, "This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_fil_6233", "This is the declaration being augmented. Consider moving the augmenting declaration into the same file."), 6582 This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without: diag(6234, 1 /* Error */, "This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234", "This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?"), 6583 Disable_loading_referenced_projects: diag(6235, 3 /* Message */, "Disable_loading_referenced_projects_6235", "Disable loading referenced projects."), 6584 Arguments_for_the_rest_parameter_0_were_not_provided: diag(6236, 1 /* Error */, "Arguments_for_the_rest_parameter_0_were_not_provided_6236", "Arguments for the rest parameter '{0}' were not provided."), 6585 Generates_an_event_trace_and_a_list_of_types: diag(6237, 3 /* Message */, "Generates_an_event_trace_and_a_list_of_types_6237", "Generates an event trace and a list of types."), 6586 Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react: diag(6238, 1 /* Error */, "Specify_the_module_specifier_to_be_used_to_import_the_jsx_and_jsxs_factory_functions_from_eg_react_6238", "Specify the module specifier to be used to import the 'jsx' and 'jsxs' factory functions from. eg, react"), 6587 File_0_exists_according_to_earlier_cached_lookups: diag(6239, 3 /* Message */, "File_0_exists_according_to_earlier_cached_lookups_6239", "File '{0}' exists according to earlier cached lookups."), 6588 File_0_does_not_exist_according_to_earlier_cached_lookups: diag(6240, 3 /* Message */, "File_0_does_not_exist_according_to_earlier_cached_lookups_6240", "File '{0}' does not exist according to earlier cached lookups."), 6589 Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1: diag(6241, 3 /* Message */, "Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241", "Resolution for type reference directive '{0}' was found in cache from location '{1}'."), 6590 Resolving_type_reference_directive_0_containing_file_1: diag(6242, 3 /* Message */, "Resolving_type_reference_directive_0_containing_file_1_6242", "======== Resolving type reference directive '{0}', containing file '{1}'. ========"), 6591 Interpret_optional_property_types_as_written_rather_than_adding_undefined: diag(6243, 3 /* Message */, "Interpret_optional_property_types_as_written_rather_than_adding_undefined_6243", "Interpret optional property types as written, rather than adding 'undefined'."), 6592 Modules: diag(6244, 3 /* Message */, "Modules_6244", "Modules"), 6593 File_Management: diag(6245, 3 /* Message */, "File_Management_6245", "File Management"), 6594 Emit: diag(6246, 3 /* Message */, "Emit_6246", "Emit"), 6595 JavaScript_Support: diag(6247, 3 /* Message */, "JavaScript_Support_6247", "JavaScript Support"), 6596 Type_Checking: diag(6248, 3 /* Message */, "Type_Checking_6248", "Type Checking"), 6597 Editor_Support: diag(6249, 3 /* Message */, "Editor_Support_6249", "Editor Support"), 6598 Watch_and_Build_Modes: diag(6250, 3 /* Message */, "Watch_and_Build_Modes_6250", "Watch and Build Modes"), 6599 Compiler_Diagnostics: diag(6251, 3 /* Message */, "Compiler_Diagnostics_6251", "Compiler Diagnostics"), 6600 Interop_Constraints: diag(6252, 3 /* Message */, "Interop_Constraints_6252", "Interop Constraints"), 6601 Backwards_Compatibility: diag(6253, 3 /* Message */, "Backwards_Compatibility_6253", "Backwards Compatibility"), 6602 Language_and_Environment: diag(6254, 3 /* Message */, "Language_and_Environment_6254", "Language and Environment"), 6603 Projects: diag(6255, 3 /* Message */, "Projects_6255", "Projects"), 6604 Output_Formatting: diag(6256, 3 /* Message */, "Output_Formatting_6256", "Output Formatting"), 6605 Completeness: diag(6257, 3 /* Message */, "Completeness_6257", "Completeness"), 6606 _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, 1 /* Error */, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"), 6607 Found_1_error_in_1: diag(6259, 3 /* Message */, "Found_1_error_in_1_6259", "Found 1 error in {1}"), 6608 Found_0_errors_in_the_same_file_starting_at_Colon_1: diag(6260, 3 /* Message */, "Found_0_errors_in_the_same_file_starting_at_Colon_1_6260", "Found {0} errors in the same file, starting at: {1}"), 6609 Found_0_errors_in_1_files: diag(6261, 3 /* Message */, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."), 6610 Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, 3 /* Message */, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."), 6611 Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, 3 /* Message */, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."), 6612 Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, 3 /* Message */, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."), 6613 package_json_scope_0_has_no_imports_defined: diag(6273, 3 /* Message */, "package_json_scope_0_has_no_imports_defined_6273", "package.json scope '{0}' has no imports defined."), 6614 package_json_scope_0_explicitly_maps_specifier_1_to_null: diag(6274, 3 /* Message */, "package_json_scope_0_explicitly_maps_specifier_1_to_null_6274", "package.json scope '{0}' explicitly maps specifier '{1}' to null."), 6615 package_json_scope_0_has_invalid_type_for_target_of_specifier_1: diag(6275, 3 /* Message */, "package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275", "package.json scope '{0}' has invalid type for target of specifier '{1}'"), 6616 Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6276, 3 /* Message */, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."), 6617 Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"), 6618 Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."), 6619 Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."), 6620 Referenced_project_0_must_have_setting_composite_Colon_true: diag(6306, 1 /* Error */, "Referenced_project_0_must_have_setting_composite_Colon_true_6306", `Referenced project '{0}' must have setting "composite": true.`), 6621 File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_include_pattern: diag(6307, 1 /* Error */, "File_0_is_not_listed_within_the_file_list_of_project_1_Projects_must_list_all_files_or_use_an_includ_6307", "File '{0}' is not listed within the file list of project '{1}'. Projects must list all files or use an 'include' pattern."), 6622 Cannot_prepend_project_0_because_it_does_not_have_outFile_set: diag(6308, 1 /* Error */, "Cannot_prepend_project_0_because_it_does_not_have_outFile_set_6308", "Cannot prepend project '{0}' because it does not have 'outFile' set"), 6623 Output_file_0_from_project_1_does_not_exist: diag(6309, 1 /* Error */, "Output_file_0_from_project_1_does_not_exist_6309", "Output file '{0}' from project '{1}' does not exist"), 6624 Referenced_project_0_may_not_disable_emit: diag(6310, 1 /* Error */, "Referenced_project_0_may_not_disable_emit_6310", "Referenced project '{0}' may not disable emit."), 6625 Project_0_is_out_of_date_because_output_1_is_older_than_input_2: diag(6350, 3 /* Message */, "Project_0_is_out_of_date_because_output_1_is_older_than_input_2_6350", "Project '{0}' is out of date because output '{1}' is older than input '{2}'"), 6626 Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2: diag(6351, 3 /* Message */, "Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351", "Project '{0}' is up to date because newest input '{1}' is older than output '{2}'"), 6627 Project_0_is_out_of_date_because_output_file_1_does_not_exist: diag(6352, 3 /* Message */, "Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352", "Project '{0}' is out of date because output file '{1}' does not exist"), 6628 Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date: diag(6353, 3 /* Message */, "Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353", "Project '{0}' is out of date because its dependency '{1}' is out of date"), 6629 Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies: diag(6354, 3 /* Message */, "Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354", "Project '{0}' is up to date with .d.ts files from its dependencies"), 6630 Projects_in_this_build_Colon_0: diag(6355, 3 /* Message */, "Projects_in_this_build_Colon_0_6355", "Projects in this build: {0}"), 6631 A_non_dry_build_would_delete_the_following_files_Colon_0: diag(6356, 3 /* Message */, "A_non_dry_build_would_delete_the_following_files_Colon_0_6356", "A non-dry build would delete the following files: {0}"), 6632 A_non_dry_build_would_build_project_0: diag(6357, 3 /* Message */, "A_non_dry_build_would_build_project_0_6357", "A non-dry build would build project '{0}'"), 6633 Building_project_0: diag(6358, 3 /* Message */, "Building_project_0_6358", "Building project '{0}'..."), 6634 Updating_output_timestamps_of_project_0: diag(6359, 3 /* Message */, "Updating_output_timestamps_of_project_0_6359", "Updating output timestamps of project '{0}'..."), 6635 Project_0_is_up_to_date: diag(6361, 3 /* Message */, "Project_0_is_up_to_date_6361", "Project '{0}' is up to date"), 6636 Skipping_build_of_project_0_because_its_dependency_1_has_errors: diag(6362, 3 /* Message */, "Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362", "Skipping build of project '{0}' because its dependency '{1}' has errors"), 6637 Project_0_can_t_be_built_because_its_dependency_1_has_errors: diag(6363, 3 /* Message */, "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363", "Project '{0}' can't be built because its dependency '{1}' has errors"), 6638 Build_one_or_more_projects_and_their_dependencies_if_out_of_date: diag(6364, 3 /* Message */, "Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364", "Build one or more projects and their dependencies, if out of date"), 6639 Delete_the_outputs_of_all_projects: diag(6365, 3 /* Message */, "Delete_the_outputs_of_all_projects_6365", "Delete the outputs of all projects."), 6640 Show_what_would_be_built_or_deleted_if_specified_with_clean: diag(6367, 3 /* Message */, "Show_what_would_be_built_or_deleted_if_specified_with_clean_6367", "Show what would be built (or deleted, if specified with '--clean')"), 6641 Option_build_must_be_the_first_command_line_argument: diag(6369, 1 /* Error */, "Option_build_must_be_the_first_command_line_argument_6369", "Option '--build' must be the first command line argument."), 6642 Options_0_and_1_cannot_be_combined: diag(6370, 1 /* Error */, "Options_0_and_1_cannot_be_combined_6370", "Options '{0}' and '{1}' cannot be combined."), 6643 Updating_unchanged_output_timestamps_of_project_0: diag(6371, 3 /* Message */, "Updating_unchanged_output_timestamps_of_project_0_6371", "Updating unchanged output timestamps of project '{0}'..."), 6644 Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed: diag(6372, 3 /* Message */, "Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372", "Project '{0}' is out of date because output of its dependency '{1}' has changed"), 6645 Updating_output_of_project_0: diag(6373, 3 /* Message */, "Updating_output_of_project_0_6373", "Updating output of project '{0}'..."), 6646 A_non_dry_build_would_update_timestamps_for_output_of_project_0: diag(6374, 3 /* Message */, "A_non_dry_build_would_update_timestamps_for_output_of_project_0_6374", "A non-dry build would update timestamps for output of project '{0}'"), 6647 A_non_dry_build_would_update_output_of_project_0: diag(6375, 3 /* Message */, "A_non_dry_build_would_update_output_of_project_0_6375", "A non-dry build would update output of project '{0}'"), 6648 Cannot_update_output_of_project_0_because_there_was_error_reading_file_1: diag(6376, 3 /* Message */, "Cannot_update_output_of_project_0_because_there_was_error_reading_file_1_6376", "Cannot update output of project '{0}' because there was error reading file '{1}'"), 6649 Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1: diag(6377, 1 /* Error */, "Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377", "Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"), 6650 Composite_projects_may_not_disable_incremental_compilation: diag(6379, 1 /* Error */, "Composite_projects_may_not_disable_incremental_compilation_6379", "Composite projects may not disable incremental compilation."), 6651 Specify_file_to_store_incremental_compilation_information: diag(6380, 3 /* Message */, "Specify_file_to_store_incremental_compilation_information_6380", "Specify file to store incremental compilation information"), 6652 Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2: diag(6381, 3 /* Message */, "Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381", "Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"), 6653 Skipping_build_of_project_0_because_its_dependency_1_was_not_built: diag(6382, 3 /* Message */, "Skipping_build_of_project_0_because_its_dependency_1_was_not_built_6382", "Skipping build of project '{0}' because its dependency '{1}' was not built"), 6654 Project_0_can_t_be_built_because_its_dependency_1_was_not_built: diag(6383, 3 /* Message */, "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383", "Project '{0}' can't be built because its dependency '{1}' was not built"), 6655 Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6384, 3 /* Message */, "Have_recompiles_in_incremental_and_watch_assume_that_changes_within_a_file_will_only_affect_files_di_6384", "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it."), 6656 _0_is_deprecated: diag(6385, 2 /* Suggestion */, "_0_is_deprecated_6385", "'{0}' is deprecated.", void 0, void 0, true), 6657 Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found: diag(6386, 3 /* Message */, "Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_nativ_6386", "Performance timings for '--diagnostics' or '--extendedDiagnostics' are not available in this session. A native implementation of the Web Performance API could not be found."), 6658 The_signature_0_of_1_is_deprecated: diag(6387, 2 /* Suggestion */, "The_signature_0_of_1_is_deprecated_6387", "The signature '{0}' of '{1}' is deprecated.", void 0, void 0, true), 6659 Project_0_is_being_forcibly_rebuilt: diag(6388, 3 /* Message */, "Project_0_is_being_forcibly_rebuilt_6388", "Project '{0}' is being forcibly rebuilt"), 6660 Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved: diag(6389, 3 /* Message */, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved_6389", "Reusing resolution of module '{0}' from '{1}' of old program, it was not resolved."), 6661 Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2: diag(6390, 3 /* Message */, "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6390", "Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."), 6662 Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3: diag(6391, 3 /* Message */, "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved__6391", "Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."), 6663 Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved: diag(6392, 3 /* Message */, "Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved_6392", "Reusing resolution of type reference directive '{0}' from '{1}' of old program, it was not resolved."), 6664 Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3: diag(6393, 3 /* Message */, "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6393", "Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."), 6665 Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4: diag(6394, 3 /* Message */, "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_6394", "Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."), 6666 Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved: diag(6395, 3 /* Message */, "Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved_6395", "Reusing resolution of module '{0}' from '{1}' found in cache from location '{2}', it was not resolved."), 6667 Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3: diag(6396, 3 /* Message */, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6396", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}'."), 6668 Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4: diag(6397, 3 /* Message */, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_succes_6397", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was successfully resolved to '{3}' with Package ID '{4}'."), 6669 Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved: diag(6398, 3 /* Message */, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."), 6670 Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted: diag(6399, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitte_6399", "Project '{0}' is out of date because buildinfo file '{1}' indicates that some of the changes were not emitted"), 6671 Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files: diag(6400, 3 /* Message */, "Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400", "Project '{0}' is up to date but needs to update timestamps of output files that are older than input files"), 6672 Project_0_is_out_of_date_because_there_was_error_reading_file_1: diag(6401, 3 /* Message */, "Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401", "Project '{0}' is out of date because there was error reading file '{1}'"), 6673 Resolving_in_0_mode_with_conditions_1: diag(6402, 3 /* Message */, "Resolving_in_0_mode_with_conditions_1_6402", "Resolving in {0} mode with conditions {1}."), 6674 Matched_0_condition_1: diag(6403, 3 /* Message */, "Matched_0_condition_1_6403", "Matched '{0}' condition '{1}'."), 6675 Using_0_subpath_1_with_target_2: diag(6404, 3 /* Message */, "Using_0_subpath_1_with_target_2_6404", "Using '{0}' subpath '{1}' with target '{2}'."), 6676 Saw_non_matching_condition_0: diag(6405, 3 /* Message */, "Saw_non_matching_condition_0_6405", "Saw non-matching condition '{0}'."), 6677 The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"), 6678 The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."), 6679 The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."), 6680 Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing: diag(6503, 3 /* Message */, "Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing_6503", "Print names of files that are part of the compilation and then stop processing."), 6681 File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: diag(6504, 1 /* Error */, "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504", "File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"), 6682 Print_names_of_files_and_the_reason_they_are_part_of_the_compilation: diag(6505, 3 /* Message */, "Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505", "Print names of files and the reason they are part of the compilation."), 6683 Consider_adding_a_declare_modifier_to_this_class: diag(6506, 3 /* Message */, "Consider_adding_a_declare_modifier_to_this_class_6506", "Consider adding a 'declare' modifier to this class."), 6684 Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files: diag(6600, 3 /* Message */, "Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600", "Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files."), 6685 Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export: diag(6601, 3 /* Message */, "Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601", "Allow 'import x from y' when a module doesn't have a default export."), 6686 Allow_accessing_UMD_globals_from_modules: diag(6602, 3 /* Message */, "Allow_accessing_UMD_globals_from_modules_6602", "Allow accessing UMD globals from modules."), 6687 Disable_error_reporting_for_unreachable_code: diag(6603, 3 /* Message */, "Disable_error_reporting_for_unreachable_code_6603", "Disable error reporting for unreachable code."), 6688 Disable_error_reporting_for_unused_labels: diag(6604, 3 /* Message */, "Disable_error_reporting_for_unused_labels_6604", "Disable error reporting for unused labels."), 6689 Ensure_use_strict_is_always_emitted: diag(6605, 3 /* Message */, "Ensure_use_strict_is_always_emitted_6605", "Ensure 'use strict' is always emitted."), 6690 Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6606, 3 /* Message */, "Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606", "Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it."), 6691 Specify_the_base_directory_to_resolve_non_relative_module_names: diag(6607, 3 /* Message */, "Specify_the_base_directory_to_resolve_non_relative_module_names_6607", "Specify the base directory to resolve non-relative module names."), 6692 No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files: diag(6608, 3 /* Message */, "No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608", "No longer supported. In early versions, manually set the text encoding for reading files."), 6693 Enable_error_reporting_in_type_checked_JavaScript_files: diag(6609, 3 /* Message */, "Enable_error_reporting_in_type_checked_JavaScript_files_6609", "Enable error reporting in type-checked JavaScript files."), 6694 Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references: diag(6611, 3 /* Message */, "Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references_6611", "Enable constraints that allow a TypeScript project to be used with project references."), 6695 Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project: diag(6612, 3 /* Message */, "Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project_6612", "Generate .d.ts files from TypeScript and JavaScript files in your project."), 6696 Specify_the_output_directory_for_generated_declaration_files: diag(6613, 3 /* Message */, "Specify_the_output_directory_for_generated_declaration_files_6613", "Specify the output directory for generated declaration files."), 6697 Create_sourcemaps_for_d_ts_files: diag(6614, 3 /* Message */, "Create_sourcemaps_for_d_ts_files_6614", "Create sourcemaps for d.ts files."), 6698 Output_compiler_performance_information_after_building: diag(6615, 3 /* Message */, "Output_compiler_performance_information_after_building_6615", "Output compiler performance information after building."), 6699 Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project: diag(6616, 3 /* Message */, "Disables_inference_for_type_acquisition_by_looking_at_filenames_in_a_project_6616", "Disables inference for type acquisition by looking at filenames in a project."), 6700 Reduce_the_number_of_projects_loaded_automatically_by_TypeScript: diag(6617, 3 /* Message */, "Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617", "Reduce the number of projects loaded automatically by TypeScript."), 6701 Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server: diag(6618, 3 /* Message */, "Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618", "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."), 6702 Opt_a_project_out_of_multi_project_reference_checking_when_editing: diag(6619, 3 /* Message */, "Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619", "Opt a project out of multi-project reference checking when editing."), 6703 Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects: diag(6620, 3 /* Message */, "Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620", "Disable preferring source files instead of declaration files when referencing composite projects."), 6704 Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration: diag(6621, 3 /* Message */, "Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621", "Emit more compliant, but verbose and less performant JavaScript for iteration."), 6705 Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: diag(6622, 3 /* Message */, "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622", "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."), 6706 Only_output_d_ts_files_and_not_JavaScript_files: diag(6623, 3 /* Message */, "Only_output_d_ts_files_and_not_JavaScript_files_6623", "Only output d.ts files and not JavaScript files."), 6707 Emit_design_type_metadata_for_decorated_declarations_in_source_files: diag(6624, 3 /* Message */, "Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624", "Emit design-type metadata for decorated declarations in source files."), 6708 Disable_the_type_acquisition_for_JavaScript_projects: diag(6625, 3 /* Message */, "Disable_the_type_acquisition_for_JavaScript_projects_6625", "Disable the type acquisition for JavaScript projects"), 6709 Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility: diag(6626, 3 /* Message */, "Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626", "Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility."), 6710 Filters_results_from_the_include_option: diag(6627, 3 /* Message */, "Filters_results_from_the_include_option_6627", "Filters results from the `include` option."), 6711 Remove_a_list_of_directories_from_the_watch_process: diag(6628, 3 /* Message */, "Remove_a_list_of_directories_from_the_watch_process_6628", "Remove a list of directories from the watch process."), 6712 Remove_a_list_of_files_from_the_watch_mode_s_processing: diag(6629, 3 /* Message */, "Remove_a_list_of_files_from_the_watch_mode_s_processing_6629", "Remove a list of files from the watch mode's processing."), 6713 Enable_experimental_support_for_TC39_stage_2_draft_decorators: diag(6630, 3 /* Message */, "Enable_experimental_support_for_TC39_stage_2_draft_decorators_6630", "Enable experimental support for TC39 stage 2 draft decorators."), 6714 Print_files_read_during_the_compilation_including_why_it_was_included: diag(6631, 3 /* Message */, "Print_files_read_during_the_compilation_including_why_it_was_included_6631", "Print files read during the compilation including why it was included."), 6715 Output_more_detailed_compiler_performance_information_after_building: diag(6632, 3 /* Message */, "Output_more_detailed_compiler_performance_information_after_building_6632", "Output more detailed compiler performance information after building."), 6716 Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited: diag(6633, 3 /* Message */, "Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633", "Specify one or more path or node module references to base configuration files from which settings are inherited."), 6717 Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers: diag(6634, 3 /* Message */, "Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634", "Specify what approach the watcher should use if the system runs out of native file watchers."), 6718 Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include: diag(6635, 3 /* Message */, "Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635", "Include a list of files. This does not support glob patterns, as opposed to `include`."), 6719 Build_all_projects_including_those_that_appear_to_be_up_to_date: diag(6636, 3 /* Message */, "Build_all_projects_including_those_that_appear_to_be_up_to_date_6636", "Build all projects, including those that appear to be up to date."), 6720 Ensure_that_casing_is_correct_in_imports: diag(6637, 3 /* Message */, "Ensure_that_casing_is_correct_in_imports_6637", "Ensure that casing is correct in imports."), 6721 Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging: diag(6638, 3 /* Message */, "Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638", "Emit a v8 CPU profile of the compiler run for debugging."), 6722 Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file: diag(6639, 3 /* Message */, "Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639", "Allow importing helper functions from tslib once per project, instead of including them per-file."), 6723 Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation: diag(6641, 3 /* Message */, "Specify_a_list_of_glob_patterns_that_match_files_to_be_included_in_compilation_6641", "Specify a list of glob patterns that match files to be included in compilation."), 6724 Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects: diag(6642, 3 /* Message */, "Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects_6642", "Save .tsbuildinfo files to allow for incremental compilation of projects."), 6725 Include_sourcemap_files_inside_the_emitted_JavaScript: diag(6643, 3 /* Message */, "Include_sourcemap_files_inside_the_emitted_JavaScript_6643", "Include sourcemap files inside the emitted JavaScript."), 6726 Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript: diag(6644, 3 /* Message */, "Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644", "Include source code in the sourcemaps inside the emitted JavaScript."), 6727 Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports: diag(6645, 3 /* Message */, "Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645", "Ensure that each file can be safely transpiled without relying on other imports."), 6728 Specify_what_JSX_code_is_generated: diag(6646, 3 /* Message */, "Specify_what_JSX_code_is_generated_6646", "Specify what JSX code is generated."), 6729 Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h: diag(6647, 3 /* Message */, "Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647", "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'."), 6730 Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment: diag(6648, 3 /* Message */, "Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648", "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."), 6731 Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk: diag(6649, 3 /* Message */, "Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649", "Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'."), 6732 Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option: diag(6650, 3 /* Message */, "Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650", "Make keyof only return strings instead of string, numbers or symbols. Legacy option."), 6733 Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment: diag(6651, 3 /* Message */, "Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651", "Specify a set of bundled library declaration files that describe the target runtime environment."), 6734 Print_the_names_of_emitted_files_after_a_compilation: diag(6652, 3 /* Message */, "Print_the_names_of_emitted_files_after_a_compilation_6652", "Print the names of emitted files after a compilation."), 6735 Print_all_of_the_files_read_during_the_compilation: diag(6653, 3 /* Message */, "Print_all_of_the_files_read_during_the_compilation_6653", "Print all of the files read during the compilation."), 6736 Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit: diag(6654, 3 /* Message */, "Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654", "Set the language of the messaging from TypeScript. This does not affect emit."), 6737 Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: diag(6655, 3 /* Message */, "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655", "Specify the location where debugger should locate map files instead of generated locations."), 6738 Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs: diag(6656, 3 /* Message */, "Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656", "Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'."), 6739 Specify_what_module_code_is_generated: diag(6657, 3 /* Message */, "Specify_what_module_code_is_generated_6657", "Specify what module code is generated."), 6740 Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier: diag(6658, 3 /* Message */, "Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658", "Specify how TypeScript looks up a file from a given module specifier."), 6741 Set_the_newline_character_for_emitting_files: diag(6659, 3 /* Message */, "Set_the_newline_character_for_emitting_files_6659", "Set the newline character for emitting files."), 6742 Disable_emitting_files_from_a_compilation: diag(6660, 3 /* Message */, "Disable_emitting_files_from_a_compilation_6660", "Disable emitting files from a compilation."), 6743 Disable_generating_custom_helper_functions_like_extends_in_compiled_output: diag(6661, 3 /* Message */, "Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661", "Disable generating custom helper functions like '__extends' in compiled output."), 6744 Disable_emitting_files_if_any_type_checking_errors_are_reported: diag(6662, 3 /* Message */, "Disable_emitting_files_if_any_type_checking_errors_are_reported_6662", "Disable emitting files if any type checking errors are reported."), 6745 Disable_truncating_types_in_error_messages: diag(6663, 3 /* Message */, "Disable_truncating_types_in_error_messages_6663", "Disable truncating types in error messages."), 6746 Enable_error_reporting_for_fallthrough_cases_in_switch_statements: diag(6664, 3 /* Message */, "Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664", "Enable error reporting for fallthrough cases in switch statements."), 6747 Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type: diag(6665, 3 /* Message */, "Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665", "Enable error reporting for expressions and declarations with an implied 'any' type."), 6748 Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier: diag(6666, 3 /* Message */, "Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666", "Ensure overriding members in derived classes are marked with an override modifier."), 6749 Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function: diag(6667, 3 /* Message */, "Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667", "Enable error reporting for codepaths that do not explicitly return in a function."), 6750 Enable_error_reporting_when_this_is_given_the_type_any: diag(6668, 3 /* Message */, "Enable_error_reporting_when_this_is_given_the_type_any_6668", "Enable error reporting when 'this' is given the type 'any'."), 6751 Disable_adding_use_strict_directives_in_emitted_JavaScript_files: diag(6669, 3 /* Message */, "Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669", "Disable adding 'use strict' directives in emitted JavaScript files."), 6752 Disable_including_any_library_files_including_the_default_lib_d_ts: diag(6670, 3 /* Message */, "Disable_including_any_library_files_including_the_default_lib_d_ts_6670", "Disable including any library files, including the default lib.d.ts."), 6753 Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type: diag(6671, 3 /* Message */, "Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671", "Enforces using indexed accessors for keys declared using an indexed type."), 6754 Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project: diag(6672, 3 /* Message */, "Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672", "Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project."), 6755 Disable_strict_checking_of_generic_signatures_in_function_types: diag(6673, 3 /* Message */, "Disable_strict_checking_of_generic_signatures_in_function_types_6673", "Disable strict checking of generic signatures in function types."), 6756 Add_undefined_to_a_type_when_accessed_using_an_index: diag(6674, 3 /* Message */, "Add_undefined_to_a_type_when_accessed_using_an_index_6674", "Add 'undefined' to a type when accessed using an index."), 6757 Enable_error_reporting_when_local_variables_aren_t_read: diag(6675, 3 /* Message */, "Enable_error_reporting_when_local_variables_aren_t_read_6675", "Enable error reporting when local variables aren't read."), 6758 Raise_an_error_when_a_function_parameter_isn_t_read: diag(6676, 3 /* Message */, "Raise_an_error_when_a_function_parameter_isn_t_read_6676", "Raise an error when a function parameter isn't read."), 6759 Deprecated_setting_Use_outFile_instead: diag(6677, 3 /* Message */, "Deprecated_setting_Use_outFile_instead_6677", "Deprecated setting. Use 'outFile' instead."), 6760 Specify_an_output_folder_for_all_emitted_files: diag(6678, 3 /* Message */, "Specify_an_output_folder_for_all_emitted_files_6678", "Specify an output folder for all emitted files."), 6761 Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output: diag(6679, 3 /* Message */, "Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679", "Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output."), 6762 Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations: diag(6680, 3 /* Message */, "Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680", "Specify a set of entries that re-map imports to additional lookup locations."), 6763 Specify_a_list_of_language_service_plugins_to_include: diag(6681, 3 /* Message */, "Specify_a_list_of_language_service_plugins_to_include_6681", "Specify a list of language service plugins to include."), 6764 Disable_erasing_const_enum_declarations_in_generated_code: diag(6682, 3 /* Message */, "Disable_erasing_const_enum_declarations_in_generated_code_6682", "Disable erasing 'const enum' declarations in generated code."), 6765 Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node: diag(6683, 3 /* Message */, "Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683", "Disable resolving symlinks to their realpath. This correlates to the same flag in node."), 6766 Disable_wiping_the_console_in_watch_mode: diag(6684, 3 /* Message */, "Disable_wiping_the_console_in_watch_mode_6684", "Disable wiping the console in watch mode."), 6767 Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read: diag(6685, 3 /* Message */, "Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685", "Enable color and formatting in TypeScript's output to make compiler errors easier to read."), 6768 Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit: diag(6686, 3 /* Message */, "Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686", "Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit."), 6769 Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references: diag(6687, 3 /* Message */, "Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687", "Specify an array of objects that specify paths for projects. Used in project references."), 6770 Disable_emitting_comments: diag(6688, 3 /* Message */, "Disable_emitting_comments_6688", "Disable emitting comments."), 6771 Enable_importing_json_files: diag(6689, 3 /* Message */, "Enable_importing_json_files_6689", "Enable importing .json files."), 6772 Specify_the_root_folder_within_your_source_files: diag(6690, 3 /* Message */, "Specify_the_root_folder_within_your_source_files_6690", "Specify the root folder within your source files."), 6773 Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules: diag(6691, 3 /* Message */, "Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691", "Allow multiple folders to be treated as one when resolving modules."), 6774 Skip_type_checking_d_ts_files_that_are_included_with_TypeScript: diag(6692, 3 /* Message */, "Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692", "Skip type checking .d.ts files that are included with TypeScript."), 6775 Skip_type_checking_all_d_ts_files: diag(6693, 3 /* Message */, "Skip_type_checking_all_d_ts_files_6693", "Skip type checking all .d.ts files."), 6776 Create_source_map_files_for_emitted_JavaScript_files: diag(6694, 3 /* Message */, "Create_source_map_files_for_emitted_JavaScript_files_6694", "Create source map files for emitted JavaScript files."), 6777 Specify_the_root_path_for_debuggers_to_find_the_reference_source_code: diag(6695, 3 /* Message */, "Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695", "Specify the root path for debuggers to find the reference source code."), 6778 Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function: diag(6697, 3 /* Message */, "Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697", "Check that the arguments for 'bind', 'call', and 'apply' methods match the original function."), 6779 When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible: diag(6698, 3 /* Message */, "When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698", "When assigning functions, check to ensure parameters and the return values are subtype-compatible."), 6780 When_type_checking_take_into_account_null_and_undefined: diag(6699, 3 /* Message */, "When_type_checking_take_into_account_null_and_undefined_6699", "When type checking, take into account 'null' and 'undefined'."), 6781 Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor: diag(6700, 3 /* Message */, "Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700", "Check for class properties that are declared but not set in the constructor."), 6782 Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments: diag(6701, 3 /* Message */, "Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701", "Disable emitting declarations that have '@internal' in their JSDoc comments."), 6783 Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals: diag(6702, 3 /* Message */, "Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702", "Disable reporting of excess property errors during the creation of object literals."), 6784 Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures: diag(6703, 3 /* Message */, "Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703", "Suppress 'noImplicitAny' errors when indexing objects that lack index signatures."), 6785 Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively: diag(6704, 3 /* Message */, "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704", "Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."), 6786 Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations: diag(6705, 3 /* Message */, "Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705", "Set the JavaScript language version for emitted JavaScript and include compatible library declarations."), 6787 Log_paths_used_during_the_moduleResolution_process: diag(6706, 3 /* Message */, "Log_paths_used_during_the_moduleResolution_process_6706", "Log paths used during the 'moduleResolution' process."), 6788 Specify_the_path_to_tsbuildinfo_incremental_compilation_file: diag(6707, 3 /* Message */, "Specify_the_path_to_tsbuildinfo_incremental_compilation_file_6707", "Specify the path to .tsbuildinfo incremental compilation file."), 6789 Specify_options_for_automatic_acquisition_of_declaration_files: diag(6709, 3 /* Message */, "Specify_options_for_automatic_acquisition_of_declaration_files_6709", "Specify options for automatic acquisition of declaration files."), 6790 Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types: diag(6710, 3 /* Message */, "Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710", "Specify multiple folders that act like './node_modules/@types'."), 6791 Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file: diag(6711, 3 /* Message */, "Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711", "Specify type package names to be included without being referenced in a source file."), 6792 Emit_ECMAScript_standard_compliant_class_fields: diag(6712, 3 /* Message */, "Emit_ECMAScript_standard_compliant_class_fields_6712", "Emit ECMAScript-standard-compliant class fields."), 6793 Enable_verbose_logging: diag(6713, 3 /* Message */, "Enable_verbose_logging_6713", "Enable verbose logging."), 6794 Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality: diag(6714, 3 /* Message */, "Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714", "Specify how directories are watched on systems that lack recursive file-watching functionality."), 6795 Specify_how_the_TypeScript_watch_mode_works: diag(6715, 3 /* Message */, "Specify_how_the_TypeScript_watch_mode_works_6715", "Specify how the TypeScript watch mode works."), 6796 Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, 3 /* Message */, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."), 6797 Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, 3 /* Message */, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."), 6798 Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files: diag(6719, 3 /* Message */, "Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719", "Require sufficient annotation on exports so other tools can trivially generate declaration files."), 6799 Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."), 6800 one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"), 6801 one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"), 6802 type_Colon: diag(6902, 3 /* Message */, "type_Colon_6902", "type:"), 6803 default_Colon: diag(6903, 3 /* Message */, "default_Colon_6903", "default:"), 6804 module_system_or_esModuleInterop: diag(6904, 3 /* Message */, "module_system_or_esModuleInterop_6904", 'module === "system" or esModuleInterop'), 6805 false_unless_strict_is_set: diag(6905, 3 /* Message */, "false_unless_strict_is_set_6905", "`false`, unless `strict` is set"), 6806 false_unless_composite_is_set: diag(6906, 3 /* Message */, "false_unless_composite_is_set_6906", "`false`, unless `composite` is set"), 6807 node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified: diag(6907, 3 /* Message */, "node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907", '`["node_modules", "bower_components", "jspm_packages"]`, plus the value of `outDir` if one is specified.'), 6808 if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk: diag(6908, 3 /* Message */, "if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk_6908", '`[]` if `files` is specified, otherwise `["**/*"]`'), 6809 true_if_composite_false_otherwise: diag(6909, 3 /* Message */, "true_if_composite_false_otherwise_6909", "`true` if `composite`, `false` otherwise"), 6810 module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node: diag(69010, 3 /* Message */, "module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010", "module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`"), 6811 Computed_from_the_list_of_input_files: diag(6911, 3 /* Message */, "Computed_from_the_list_of_input_files_6911", "Computed from the list of input files"), 6812 Platform_specific: diag(6912, 3 /* Message */, "Platform_specific_6912", "Platform specific"), 6813 You_can_learn_about_all_of_the_compiler_options_at_0: diag(6913, 3 /* Message */, "You_can_learn_about_all_of_the_compiler_options_at_0_6913", "You can learn about all of the compiler options at {0}"), 6814 Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon: diag(6914, 3 /* Message */, "Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_conf_6914", "Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:"), 6815 Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0: diag(6915, 3 /* Message */, "Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_tr_6915", "Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}"), 6816 COMMON_COMMANDS: diag(6916, 3 /* Message */, "COMMON_COMMANDS_6916", "COMMON COMMANDS"), 6817 ALL_COMPILER_OPTIONS: diag(6917, 3 /* Message */, "ALL_COMPILER_OPTIONS_6917", "ALL COMPILER OPTIONS"), 6818 WATCH_OPTIONS: diag(6918, 3 /* Message */, "WATCH_OPTIONS_6918", "WATCH OPTIONS"), 6819 BUILD_OPTIONS: diag(6919, 3 /* Message */, "BUILD_OPTIONS_6919", "BUILD OPTIONS"), 6820 COMMON_COMPILER_OPTIONS: diag(6920, 3 /* Message */, "COMMON_COMPILER_OPTIONS_6920", "COMMON COMPILER OPTIONS"), 6821 COMMAND_LINE_FLAGS: diag(6921, 3 /* Message */, "COMMAND_LINE_FLAGS_6921", "COMMAND LINE FLAGS"), 6822 tsc_Colon_The_TypeScript_Compiler: diag(6922, 3 /* Message */, "tsc_Colon_The_TypeScript_Compiler_6922", "tsc: The TypeScript Compiler"), 6823 Compiles_the_current_project_tsconfig_json_in_the_working_directory: diag(6923, 3 /* Message */, "Compiles_the_current_project_tsconfig_json_in_the_working_directory_6923", "Compiles the current project (tsconfig.json in the working directory.)"), 6824 Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options: diag(6924, 3 /* Message */, "Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options_6924", "Ignoring tsconfig.json, compiles the specified files with default compiler options."), 6825 Build_a_composite_project_in_the_working_directory: diag(6925, 3 /* Message */, "Build_a_composite_project_in_the_working_directory_6925", "Build a composite project in the working directory."), 6826 Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory: diag(6926, 3 /* Message */, "Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory_6926", "Creates a tsconfig.json with the recommended settings in the working directory."), 6827 Compiles_the_TypeScript_project_located_at_the_specified_path: diag(6927, 3 /* Message */, "Compiles_the_TypeScript_project_located_at_the_specified_path_6927", "Compiles the TypeScript project located at the specified path."), 6828 An_expanded_version_of_this_information_showing_all_possible_compiler_options: diag(6928, 3 /* Message */, "An_expanded_version_of_this_information_showing_all_possible_compiler_options_6928", "An expanded version of this information, showing all possible compiler options"), 6829 Compiles_the_current_project_with_additional_settings: diag(6929, 3 /* Message */, "Compiles_the_current_project_with_additional_settings_6929", "Compiles the current project, with additional settings."), 6830 true_for_ES2022_and_above_including_ESNext: diag(6930, 3 /* Message */, "true_for_ES2022_and_above_including_ESNext_6930", "`true` for ES2022 and above, including ESNext."), 6831 List_of_file_name_suffixes_to_search_when_resolving_a_module: diag(6931, 1 /* Error */, "List_of_file_name_suffixes_to_search_when_resolving_a_module_6931", "List of file name suffixes to search when resolving a module."), 6832 Variable_0_implicitly_has_an_1_type: diag(7005, 1 /* Error */, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), 6833 Parameter_0_implicitly_has_an_1_type: diag(7006, 1 /* Error */, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), 6834 Member_0_implicitly_has_an_1_type: diag(7008, 1 /* Error */, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), 6835 new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: diag(7009, 1 /* Error */, "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009", "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type."), 6836 _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: diag(7010, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type_7010", "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type."), 6837 Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7011, 1 /* Error */, "Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7011", "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type."), 6838 Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7013, 1 /* Error */, "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013", "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type."), 6839 Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: diag(7014, 1 /* Error */, "Function_type_which_lacks_return_type_annotation_implicitly_has_an_0_return_type_7014", "Function type, which lacks return-type annotation, implicitly has an '{0}' return type."), 6840 Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: diag(7015, 1 /* Error */, "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015", "Element implicitly has an 'any' type because index expression is not of type 'number'."), 6841 Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type: diag(7016, 1 /* Error */, "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016", "Could not find a declaration file for module '{0}'. '{1}' implicitly has an 'any' type."), 6842 Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature: diag(7017, 1 /* Error */, "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017", "Element implicitly has an 'any' type because type '{0}' has no index signature."), 6843 Object_literal_s_property_0_implicitly_has_an_1_type: diag(7018, 1 /* Error */, "Object_literal_s_property_0_implicitly_has_an_1_type_7018", "Object literal's property '{0}' implicitly has an '{1}' type."), 6844 Rest_parameter_0_implicitly_has_an_any_type: diag(7019, 1 /* Error */, "Rest_parameter_0_implicitly_has_an_any_type_7019", "Rest parameter '{0}' implicitly has an 'any[]' type."), 6845 Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: diag(7020, 1 /* Error */, "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020", "Call signature, which lacks return-type annotation, implicitly has an 'any' return type."), 6846 _0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: diag(7022, 1 /* Error */, "_0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or__7022", "'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."), 6847 _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: diag(7023, 1 /* Error */, "_0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_reference_7023", "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."), 6848 Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: diag(7024, 1 /* Error */, "Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024", "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions."), 6849 Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type_annotation: diag(7025, 1 /* Error */, "Generator_implicitly_has_yield_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_retu_7025", "Generator implicitly has yield type '{0}' because it does not yield any values. Consider supplying a return type annotation."), 6850 JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: diag(7026, 1 /* Error */, "JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists_7026", "JSX element implicitly has type 'any' because no interface 'JSX.{0}' exists."), 6851 Unreachable_code_detected: diag(7027, 1 /* Error */, "Unreachable_code_detected_7027", "Unreachable code detected.", true), 6852 Unused_label: diag(7028, 1 /* Error */, "Unused_label_7028", "Unused label.", true), 6853 Fallthrough_case_in_switch: diag(7029, 1 /* Error */, "Fallthrough_case_in_switch_7029", "Fallthrough case in switch."), 6854 Not_all_code_paths_return_a_value: diag(7030, 1 /* Error */, "Not_all_code_paths_return_a_value_7030", "Not all code paths return a value."), 6855 Binding_element_0_implicitly_has_an_1_type: diag(7031, 1 /* Error */, "Binding_element_0_implicitly_has_an_1_type_7031", "Binding element '{0}' implicitly has an '{1}' type."), 6856 Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: diag(7032, 1 /* Error */, "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032", "Property '{0}' implicitly has type 'any', because its set accessor lacks a parameter type annotation."), 6857 Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: diag(7033, 1 /* Error */, "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033", "Property '{0}' implicitly has type 'any', because its get accessor lacks a return type annotation."), 6858 Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, 1 /* Error */, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."), 6859 Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, 1 /* Error */, "Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare__7035", "Try `npm i --save-dev @types/{1}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), 6860 Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, 1 /* Error */, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."), 6861 Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, 3 /* Message */, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."), 6862 Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead: diag(7038, 3 /* Message */, "Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cau_7038", "Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead."), 6863 Mapped_object_type_implicitly_has_an_any_template_type: diag(7039, 1 /* Error */, "Mapped_object_type_implicitly_has_an_any_template_type_7039", "Mapped object type implicitly has an 'any' template type."), 6864 If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1: diag(7040, 1 /* Error */, "If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040", "If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}'"), 6865 The_containing_arrow_function_captures_the_global_value_of_this: diag(7041, 1 /* Error */, "The_containing_arrow_function_captures_the_global_value_of_this_7041", "The containing arrow function captures the global value of 'this'."), 6866 Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used: diag(7042, 1 /* Error */, "Module_0_was_resolved_to_1_but_resolveJsonModule_is_not_used_7042", "Module '{0}' was resolved to '{1}', but '--resolveJsonModule' is not used."), 6867 Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7043, 2 /* Suggestion */, "Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7043", "Variable '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."), 6868 Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7044, 2 /* Suggestion */, "Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7044", "Parameter '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."), 6869 Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage: diag(7045, 2 /* Suggestion */, "Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage_7045", "Member '{0}' implicitly has an '{1}' type, but a better type may be inferred from usage."), 6870 Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage: diag(7046, 2 /* Suggestion */, "Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage_7046", "Variable '{0}' implicitly has type '{1}' in some locations, but a better type may be inferred from usage."), 6871 Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage: diag(7047, 2 /* Suggestion */, "Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage_7047", "Rest parameter '{0}' implicitly has an 'any[]' type, but a better type may be inferred from usage."), 6872 Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage: diag(7048, 2 /* Suggestion */, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage_7048", "Property '{0}' implicitly has type 'any', but a better type for its get accessor may be inferred from usage."), 6873 Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage: diag(7049, 2 /* Suggestion */, "Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage_7049", "Property '{0}' implicitly has type 'any', but a better type for its set accessor may be inferred from usage."), 6874 _0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage: diag(7050, 2 /* Suggestion */, "_0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage_7050", "'{0}' implicitly has an '{1}' return type, but a better type may be inferred from usage."), 6875 Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1: diag(7051, 1 /* Error */, "Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1_7051", "Parameter has a name but no type. Did you mean '{0}: {1}'?"), 6876 Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1: diag(7052, 1 /* Error */, "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_Did_you_mean_to_call_1_7052", "Element implicitly has an 'any' type because type '{0}' has no index signature. Did you mean to call '{1}'?"), 6877 Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1: diag(7053, 1 /* Error */, "Element_implicitly_has_an_any_type_because_expression_of_type_0_can_t_be_used_to_index_type_1_7053", "Element implicitly has an 'any' type because expression of type '{0}' can't be used to index type '{1}'."), 6878 No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1: diag(7054, 1 /* Error */, "No_index_signature_with_a_parameter_of_type_0_was_found_on_type_1_7054", "No index signature with a parameter of type '{0}' was found on type '{1}'."), 6879 _0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type: diag(7055, 1 /* Error */, "_0_which_lacks_return_type_annotation_implicitly_has_an_1_yield_type_7055", "'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type."), 6880 The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_type_annotation_is_needed: diag(7056, 1 /* Error */, "The_inferred_type_of_this_node_exceeds_the_maximum_length_the_compiler_will_serialize_An_explicit_ty_7056", "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed."), 6881 yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_type_annotation: diag(7057, 1 /* Error */, "yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057", "'yield' expression implicitly results in an 'any' type because its containing generator lacks a return-type annotation."), 6882 If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1: diag(7058, 1 /* Error */, "If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_decl_7058", "If the '{0}' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module '{1}';`"), 6883 This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead: diag(7059, 1 /* Error */, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059", "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."), 6884 This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint: diag(7060, 1 /* Error */, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060", "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."), 6885 A_mapped_type_may_not_declare_properties_or_methods: diag(7061, 1 /* Error */, "A_mapped_type_may_not_declare_properties_or_methods_7061", "A mapped type may not declare properties or methods."), 6886 You_cannot_rename_this_element: diag(8e3, 1 /* Error */, "You_cannot_rename_this_element_8000", "You cannot rename this element."), 6887 You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), 6888 import_can_only_be_used_in_TypeScript_files: diag(8002, 1 /* Error */, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."), 6889 export_can_only_be_used_in_TypeScript_files: diag(8003, 1 /* Error */, "export_can_only_be_used_in_TypeScript_files_8003", "'export =' can only be used in TypeScript files."), 6890 Type_parameter_declarations_can_only_be_used_in_TypeScript_files: diag(8004, 1 /* Error */, "Type_parameter_declarations_can_only_be_used_in_TypeScript_files_8004", "Type parameter declarations can only be used in TypeScript files."), 6891 implements_clauses_can_only_be_used_in_TypeScript_files: diag(8005, 1 /* Error */, "implements_clauses_can_only_be_used_in_TypeScript_files_8005", "'implements' clauses can only be used in TypeScript files."), 6892 _0_declarations_can_only_be_used_in_TypeScript_files: diag(8006, 1 /* Error */, "_0_declarations_can_only_be_used_in_TypeScript_files_8006", "'{0}' declarations can only be used in TypeScript files."), 6893 Type_aliases_can_only_be_used_in_TypeScript_files: diag(8008, 1 /* Error */, "Type_aliases_can_only_be_used_in_TypeScript_files_8008", "Type aliases can only be used in TypeScript files."), 6894 The_0_modifier_can_only_be_used_in_TypeScript_files: diag(8009, 1 /* Error */, "The_0_modifier_can_only_be_used_in_TypeScript_files_8009", "The '{0}' modifier can only be used in TypeScript files."), 6895 Type_annotations_can_only_be_used_in_TypeScript_files: diag(8010, 1 /* Error */, "Type_annotations_can_only_be_used_in_TypeScript_files_8010", "Type annotations can only be used in TypeScript files."), 6896 Type_arguments_can_only_be_used_in_TypeScript_files: diag(8011, 1 /* Error */, "Type_arguments_can_only_be_used_in_TypeScript_files_8011", "Type arguments can only be used in TypeScript files."), 6897 Parameter_modifiers_can_only_be_used_in_TypeScript_files: diag(8012, 1 /* Error */, "Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012", "Parameter modifiers can only be used in TypeScript files."), 6898 Non_null_assertions_can_only_be_used_in_TypeScript_files: diag(8013, 1 /* Error */, "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013", "Non-null assertions can only be used in TypeScript files."), 6899 Type_assertion_expressions_can_only_be_used_in_TypeScript_files: diag(8016, 1 /* Error */, "Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016", "Type assertion expressions can only be used in TypeScript files."), 6900 Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0: diag(8017, 1 /* Error */, "Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017", "Octal literal types must use ES2015 syntax. Use the syntax '{0}'."), 6901 Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0: diag(8018, 1 /* Error */, "Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018", "Octal literals are not allowed in enums members initializer. Use the syntax '{0}'."), 6902 Report_errors_in_js_files: diag(8019, 3 /* Message */, "Report_errors_in_js_files_8019", "Report errors in .js files."), 6903 JSDoc_types_can_only_be_used_inside_documentation_comments: diag(8020, 1 /* Error */, "JSDoc_types_can_only_be_used_inside_documentation_comments_8020", "JSDoc types can only be used inside documentation comments."), 6904 JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags: diag(8021, 1 /* Error */, "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021", "JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."), 6905 JSDoc_0_is_not_attached_to_a_class: diag(8022, 1 /* Error */, "JSDoc_0_is_not_attached_to_a_class_8022", "JSDoc '@{0}' is not attached to a class."), 6906 JSDoc_0_1_does_not_match_the_extends_2_clause: diag(8023, 1 /* Error */, "JSDoc_0_1_does_not_match_the_extends_2_clause_8023", "JSDoc '@{0} {1}' does not match the 'extends {2}' clause."), 6907 JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name: diag(8024, 1 /* Error */, "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024", "JSDoc '@param' tag has name '{0}', but there is no parameter with that name."), 6908 Class_declarations_cannot_have_more_than_one_augments_or_extends_tag: diag(8025, 1 /* Error */, "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025", "Class declarations cannot have more than one '@augments' or '@extends' tag."), 6909 Expected_0_type_arguments_provide_these_with_an_extends_tag: diag(8026, 1 /* Error */, "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026", "Expected {0} type arguments; provide these with an '@extends' tag."), 6910 Expected_0_1_type_arguments_provide_these_with_an_extends_tag: diag(8027, 1 /* Error */, "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027", "Expected {0}-{1} type arguments; provide these with an '@extends' tag."), 6911 JSDoc_may_only_appear_in_the_last_parameter_of_a_signature: diag(8028, 1 /* Error */, "JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028", "JSDoc '...' may only appear in the last parameter of a signature."), 6912 JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type: diag(8029, 1 /* Error */, "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029", "JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."), 6913 The_type_of_a_function_declaration_must_match_the_function_s_signature: diag(8030, 1 /* Error */, "The_type_of_a_function_declaration_must_match_the_function_s_signature_8030", "The type of a function declaration must match the function's signature."), 6914 You_cannot_rename_a_module_via_a_global_import: diag(8031, 1 /* Error */, "You_cannot_rename_a_module_via_a_global_import_8031", "You cannot rename a module via a global import."), 6915 Qualified_name_0_is_not_allowed_without_a_leading_param_object_1: diag(8032, 1 /* Error */, "Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032", "Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."), 6916 A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags: diag(8033, 1 /* Error */, "A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033", "A JSDoc '@typedef' comment may not contain multiple '@type' tags."), 6917 The_tag_was_first_specified_here: diag(8034, 1 /* Error */, "The_tag_was_first_specified_here_8034", "The tag was first specified here."), 6918 You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."), 6919 You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."), 6920 Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."), 6921 Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."), 6922 Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."), 6923 Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations: diag(9007, 1 /* Error */, "Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9007", "Function must have an explicit return type annotation with --isolatedDeclarations."), 6924 Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations: diag(9008, 1 /* Error */, "Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9008", "Method must have an explicit return type annotation with --isolatedDeclarations."), 6925 At_least_one_accessor_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations: diag(9009, 1 /* Error */, "At_least_one_accessor_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations_9009", "At least one accessor must have an explicit return type annotation with --isolatedDeclarations."), 6926 Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations: diag(9010, 1 /* Error */, "Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9010", "Variable must have an explicit type annotation with --isolatedDeclarations."), 6927 Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations: diag(9011, 1 /* Error */, "Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9011", "Parameter must have an explicit type annotation with --isolatedDeclarations."), 6928 Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations: diag(9012, 1 /* Error */, "Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations_9012", "Property must have an explicit type annotation with --isolatedDeclarations."), 6929 Expression_type_can_t_be_inferred_with_isolatedDeclarations: diag(9013, 1 /* Error */, "Expression_type_can_t_be_inferred_with_isolatedDeclarations_9013", "Expression type can't be inferred with --isolatedDeclarations."), 6930 Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations: diag(9014, 1 /* Error */, "Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedD_9014", "Computed properties must be number or string literals, variables or dotted expressions with --isolatedDeclarations."), 6931 Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations: diag(9015, 1 /* Error */, "Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations_9015", "Objects that contain spread assignments can't be inferred with --isolatedDeclarations."), 6932 Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations: diag(9016, 1 /* Error */, "Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations_9016", "Objects that contain shorthand properties can't be inferred with --isolatedDeclarations."), 6933 Only_const_arrays_can_be_inferred_with_isolatedDeclarations: diag(9017, 1 /* Error */, "Only_const_arrays_can_be_inferred_with_isolatedDeclarations_9017", "Only const arrays can be inferred with --isolatedDeclarations."), 6934 Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations: diag(9018, 1 /* Error */, "Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations_9018", "Arrays with spread elements can't inferred with --isolatedDeclarations."), 6935 Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations: diag(9019, 1 /* Error */, "Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations_9019", "Binding elements can't be exported directly with --isolatedDeclarations."), 6936 Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations: diag(9020, 1 /* Error */, "Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDecl_9020", "Enum member initializers must be computable without references to external symbols with --isolatedDeclarations."), 6937 Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations: diag(9021, 1 /* Error */, "Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations_9021", "Extends clause can't contain an expression with --isolatedDeclarations."), 6938 Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations: diag(9022, 1 /* Error */, "Inference_from_class_expressions_is_not_supported_with_isolatedDeclarations_9022", "Inference from class expressions is not supported with --isolatedDeclarations."), 6939 Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function: diag(9023, 1 /* Error */, "Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations__9023", "Assigning properties to functions without declaring them is not supported with --isolatedDeclarations. Add an explicit declaration for the properties assigned to this function."), 6940 Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_it_s_type_This_is_not_supported_with_isolatedDeclarations: diag(9025, 1 /* Error */, "Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_it_s_type_This_is_not_su_9025", "Declaration emit for this parameter requires implicitly adding undefined to it's type. This is not supported with --isolatedDeclarations."), 6941 Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_supported_with_isolatedDeclarations: diag(9026, 1 /* Error */, "Declaration_emit_for_this_file_requires_preserving_this_import_for_augmentations_This_is_not_support_9026", "Declaration emit for this file requires preserving this import for augmentations. This is not supported with --isolatedDeclarations."), 6942 Add_a_type_annotation_to_the_variable_0: diag(9027, 1 /* Error */, "Add_a_type_annotation_to_the_variable_0_9027", "Add a type annotation to the variable {0}."), 6943 Add_a_type_annotation_to_the_parameter_0: diag(9028, 1 /* Error */, "Add_a_type_annotation_to_the_parameter_0_9028", "Add a type annotation to the parameter {0}."), 6944 Add_a_type_annotation_to_the_property_0: diag(9029, 1 /* Error */, "Add_a_type_annotation_to_the_property_0_9029", "Add a type annotation to the property {0}."), 6945 Add_a_return_type_to_the_function_expression: diag(9030, 1 /* Error */, "Add_a_return_type_to_the_function_expression_9030", "Add a return type to the function expression."), 6946 Add_a_return_type_to_the_function_declaration: diag(9031, 1 /* Error */, "Add_a_return_type_to_the_function_declaration_9031", "Add a return type to the function declaration."), 6947 Add_a_return_type_to_the_get_accessor_declaration: diag(9032, 1 /* Error */, "Add_a_return_type_to_the_get_accessor_declaration_9032", "Add a return type to the get accessor declaration."), 6948 Add_a_type_to_parameter_of_the_set_accessor_declaration: diag(9033, 1 /* Error */, "Add_a_type_to_parameter_of_the_set_accessor_declaration_9033", "Add a type to parameter of the set accessor declaration."), 6949 Add_a_return_type_to_the_method: diag(9034, 1 /* Error */, "Add_a_return_type_to_the_method_9034", "Add a return type to the method"), 6950 Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit: diag(9035, 1 /* Error */, "Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit_9035", "Add satisfies and a type assertion to this expression (satisfies T as T) to make the type explicit."), 6951 Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it: diag(9036, 1 /* Error */, "Move_the_expression_in_default_export_to_a_variable_and_add_a_type_annotation_to_it_9036", "Move the expression in default export to a variable and add a type annotation to it."), 6952 Default_exports_can_t_be_inferred_with_isolatedDeclarations: diag(9037, 1 /* Error */, "Default_exports_can_t_be_inferred_with_isolatedDeclarations_9037", "Default exports can't be inferred with --isolatedDeclarations."), 6953 JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."), 6954 JSX_elements_cannot_have_multiple_attributes_with_the_same_name: diag(17001, 1 /* Error */, "JSX_elements_cannot_have_multiple_attributes_with_the_same_name_17001", "JSX elements cannot have multiple attributes with the same name."), 6955 Expected_corresponding_JSX_closing_tag_for_0: diag(17002, 1 /* Error */, "Expected_corresponding_JSX_closing_tag_for_0_17002", "Expected corresponding JSX closing tag for '{0}'."), 6956 Cannot_use_JSX_unless_the_jsx_flag_is_provided: diag(17004, 1 /* Error */, "Cannot_use_JSX_unless_the_jsx_flag_is_provided_17004", "Cannot use JSX unless the '--jsx' flag is provided."), 6957 A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: diag(17005, 1 /* Error */, "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005", "A constructor cannot contain a 'super' call when its class extends 'null'."), 6958 An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: diag(17006, 1 /* Error */, "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006", "An unary expression with the '{0}' operator is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."), 6959 A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: diag(17007, 1 /* Error */, "A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007", "A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses."), 6960 JSX_element_0_has_no_corresponding_closing_tag: diag(17008, 1 /* Error */, "JSX_element_0_has_no_corresponding_closing_tag_17008", "JSX element '{0}' has no corresponding closing tag."), 6961 super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: diag(17009, 1 /* Error */, "super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class_17009", "'super' must be called before accessing 'this' in the constructor of a derived class."), 6962 Unknown_type_acquisition_option_0: diag(17010, 1 /* Error */, "Unknown_type_acquisition_option_0_17010", "Unknown type acquisition option '{0}'."), 6963 super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class: diag(17011, 1 /* Error */, "super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class_17011", "'super' must be called before accessing a property of 'super' in the constructor of a derived class."), 6964 _0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2: diag(17012, 1 /* Error */, "_0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2_17012", "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?"), 6965 Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor: diag(17013, 1 /* Error */, "Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013", "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor."), 6966 JSX_fragment_has_no_corresponding_closing_tag: diag(17014, 1 /* Error */, "JSX_fragment_has_no_corresponding_closing_tag_17014", "JSX fragment has no corresponding closing tag."), 6967 Expected_corresponding_closing_tag_for_JSX_fragment: diag(17015, 1 /* Error */, "Expected_corresponding_closing_tag_for_JSX_fragment_17015", "Expected corresponding closing tag for JSX fragment."), 6968 The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_compiler_option: diag(17016, 1 /* Error */, "The_jsxFragmentFactory_compiler_option_must_be_provided_to_use_JSX_fragments_with_the_jsxFactory_com_17016", "The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option."), 6969 An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments: diag(17017, 1 /* Error */, "An_jsxFrag_pragma_is_required_when_using_an_jsx_pragma_with_JSX_fragments_17017", "An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments."), 6970 Unknown_type_acquisition_option_0_Did_you_mean_1: diag(17018, 1 /* Error */, "Unknown_type_acquisition_option_0_Did_you_mean_1_17018", "Unknown type acquisition option '{0}'. Did you mean '{1}'?"), 6971 Circularity_detected_while_resolving_configuration_Colon_0: diag(18e3, 1 /* Error */, "Circularity_detected_while_resolving_configuration_Colon_0_18000", "Circularity detected while resolving configuration: {0}"), 6972 The_files_list_in_config_file_0_is_empty: diag(18002, 1 /* Error */, "The_files_list_in_config_file_0_is_empty_18002", "The 'files' list in config file '{0}' is empty."), 6973 No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: diag(18003, 1 /* Error */, "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003", "No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."), 6974 File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module: diag(80001, 2 /* Suggestion */, "File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001", "File is a CommonJS module; it may be converted to an ES module."), 6975 This_constructor_function_may_be_converted_to_a_class_declaration: diag(80002, 2 /* Suggestion */, "This_constructor_function_may_be_converted_to_a_class_declaration_80002", "This constructor function may be converted to a class declaration."), 6976 Import_may_be_converted_to_a_default_import: diag(80003, 2 /* Suggestion */, "Import_may_be_converted_to_a_default_import_80003", "Import may be converted to a default import."), 6977 JSDoc_types_may_be_moved_to_TypeScript_types: diag(80004, 2 /* Suggestion */, "JSDoc_types_may_be_moved_to_TypeScript_types_80004", "JSDoc types may be moved to TypeScript types."), 6978 require_call_may_be_converted_to_an_import: diag(80005, 2 /* Suggestion */, "require_call_may_be_converted_to_an_import_80005", "'require' call may be converted to an import."), 6979 This_may_be_converted_to_an_async_function: diag(80006, 2 /* Suggestion */, "This_may_be_converted_to_an_async_function_80006", "This may be converted to an async function."), 6980 await_has_no_effect_on_the_type_of_this_expression: diag(80007, 2 /* Suggestion */, "await_has_no_effect_on_the_type_of_this_expression_80007", "'await' has no effect on the type of this expression."), 6981 Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers: diag(80008, 2 /* Suggestion */, "Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accur_80008", "Numeric literals with absolute values equal to 2^53 or greater are too large to be represented accurately as integers."), 6982 Add_missing_super_call: diag(90001, 3 /* Message */, "Add_missing_super_call_90001", "Add missing 'super()' call"), 6983 Make_super_call_the_first_statement_in_the_constructor: diag(90002, 3 /* Message */, "Make_super_call_the_first_statement_in_the_constructor_90002", "Make 'super()' call the first statement in the constructor"), 6984 Change_extends_to_implements: diag(90003, 3 /* Message */, "Change_extends_to_implements_90003", "Change 'extends' to 'implements'"), 6985 Remove_unused_declaration_for_Colon_0: diag(90004, 3 /* Message */, "Remove_unused_declaration_for_Colon_0_90004", "Remove unused declaration for: '{0}'"), 6986 Remove_import_from_0: diag(90005, 3 /* Message */, "Remove_import_from_0_90005", "Remove import from '{0}'"), 6987 Implement_interface_0: diag(90006, 3 /* Message */, "Implement_interface_0_90006", "Implement interface '{0}'"), 6988 Implement_inherited_abstract_class: diag(90007, 3 /* Message */, "Implement_inherited_abstract_class_90007", "Implement inherited abstract class"), 6989 Add_0_to_unresolved_variable: diag(90008, 3 /* Message */, "Add_0_to_unresolved_variable_90008", "Add '{0}.' to unresolved variable"), 6990 Remove_variable_statement: diag(90010, 3 /* Message */, "Remove_variable_statement_90010", "Remove variable statement"), 6991 Remove_template_tag: diag(90011, 3 /* Message */, "Remove_template_tag_90011", "Remove template tag"), 6992 Remove_type_parameters: diag(90012, 3 /* Message */, "Remove_type_parameters_90012", "Remove type parameters"), 6993 Import_0_from_1: diag(90013, 3 /* Message */, "Import_0_from_1_90013", `Import '{0}' from "{1}"`), 6994 Change_0_to_1: diag(90014, 3 /* Message */, "Change_0_to_1_90014", "Change '{0}' to '{1}'"), 6995 Declare_property_0: diag(90016, 3 /* Message */, "Declare_property_0_90016", "Declare property '{0}'"), 6996 Add_index_signature_for_property_0: diag(90017, 3 /* Message */, "Add_index_signature_for_property_0_90017", "Add index signature for property '{0}'"), 6997 Disable_checking_for_this_file: diag(90018, 3 /* Message */, "Disable_checking_for_this_file_90018", "Disable checking for this file"), 6998 Ignore_this_error_message: diag(90019, 3 /* Message */, "Ignore_this_error_message_90019", "Ignore this error message"), 6999 Initialize_property_0_in_the_constructor: diag(90020, 3 /* Message */, "Initialize_property_0_in_the_constructor_90020", "Initialize property '{0}' in the constructor"), 7000 Initialize_static_property_0: diag(90021, 3 /* Message */, "Initialize_static_property_0_90021", "Initialize static property '{0}'"), 7001 Change_spelling_to_0: diag(90022, 3 /* Message */, "Change_spelling_to_0_90022", "Change spelling to '{0}'"), 7002 Declare_method_0: diag(90023, 3 /* Message */, "Declare_method_0_90023", "Declare method '{0}'"), 7003 Declare_static_method_0: diag(90024, 3 /* Message */, "Declare_static_method_0_90024", "Declare static method '{0}'"), 7004 Prefix_0_with_an_underscore: diag(90025, 3 /* Message */, "Prefix_0_with_an_underscore_90025", "Prefix '{0}' with an underscore"), 7005 Rewrite_as_the_indexed_access_type_0: diag(90026, 3 /* Message */, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'"), 7006 Declare_static_property_0: diag(90027, 3 /* Message */, "Declare_static_property_0_90027", "Declare static property '{0}'"), 7007 Call_decorator_expression: diag(90028, 3 /* Message */, "Call_decorator_expression_90028", "Call decorator expression"), 7008 Add_async_modifier_to_containing_function: diag(90029, 3 /* Message */, "Add_async_modifier_to_containing_function_90029", "Add async modifier to containing function"), 7009 Replace_infer_0_with_unknown: diag(90030, 3 /* Message */, "Replace_infer_0_with_unknown_90030", "Replace 'infer {0}' with 'unknown'"), 7010 Replace_all_unused_infer_with_unknown: diag(90031, 3 /* Message */, "Replace_all_unused_infer_with_unknown_90031", "Replace all unused 'infer' with 'unknown'"), 7011 Add_parameter_name: diag(90034, 3 /* Message */, "Add_parameter_name_90034", "Add parameter name"), 7012 Declare_private_property_0: diag(90035, 3 /* Message */, "Declare_private_property_0_90035", "Declare private property '{0}'"), 7013 Replace_0_with_Promise_1: diag(90036, 3 /* Message */, "Replace_0_with_Promise_1_90036", "Replace '{0}' with 'Promise<{1}>'"), 7014 Fix_all_incorrect_return_type_of_an_async_functions: diag(90037, 3 /* Message */, "Fix_all_incorrect_return_type_of_an_async_functions_90037", "Fix all incorrect return type of an async functions"), 7015 Declare_private_method_0: diag(90038, 3 /* Message */, "Declare_private_method_0_90038", "Declare private method '{0}'"), 7016 Remove_unused_destructuring_declaration: diag(90039, 3 /* Message */, "Remove_unused_destructuring_declaration_90039", "Remove unused destructuring declaration"), 7017 Remove_unused_declarations_for_Colon_0: diag(90041, 3 /* Message */, "Remove_unused_declarations_for_Colon_0_90041", "Remove unused declarations for: '{0}'"), 7018 Declare_a_private_field_named_0: diag(90053, 3 /* Message */, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."), 7019 Includes_imports_of_types_referenced_by_0: diag(90054, 3 /* Message */, "Includes_imports_of_types_referenced_by_0_90054", "Includes imports of types referenced by '{0}'"), 7020 Remove_type_from_import_declaration_from_0: diag(90055, 3 /* Message */, "Remove_type_from_import_declaration_from_0_90055", `Remove 'type' from import declaration from "{0}"`), 7021 Remove_type_from_import_of_0_from_1: diag(90056, 3 /* Message */, "Remove_type_from_import_of_0_from_1_90056", `Remove 'type' from import of '{0}' from "{1}"`), 7022 Add_import_from_0: diag(90057, 3 /* Message */, "Add_import_from_0_90057", 'Add import from "{0}"'), 7023 Update_import_from_0: diag(90058, 3 /* Message */, "Update_import_from_0_90058", 'Update import from "{0}"'), 7024 Export_0_from_module_1: diag(90059, 3 /* Message */, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"), 7025 Export_all_referenced_locals: diag(90060, 3 /* Message */, "Export_all_referenced_locals_90060", "Export all referenced locals"), 7026 Convert_function_to_an_ES2015_class: diag(95001, 3 /* Message */, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), 7027 Convert_0_to_1_in_0: diag(95003, 3 /* Message */, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"), 7028 Extract_to_0_in_1: diag(95004, 3 /* Message */, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), 7029 Extract_function: diag(95005, 3 /* Message */, "Extract_function_95005", "Extract function"), 7030 Extract_constant: diag(95006, 3 /* Message */, "Extract_constant_95006", "Extract constant"), 7031 Extract_to_0_in_enclosing_scope: diag(95007, 3 /* Message */, "Extract_to_0_in_enclosing_scope_95007", "Extract to {0} in enclosing scope"), 7032 Extract_to_0_in_1_scope: diag(95008, 3 /* Message */, "Extract_to_0_in_1_scope_95008", "Extract to {0} in {1} scope"), 7033 Annotate_with_type_from_JSDoc: diag(95009, 3 /* Message */, "Annotate_with_type_from_JSDoc_95009", "Annotate with type from JSDoc"), 7034 Infer_type_of_0_from_usage: diag(95011, 3 /* Message */, "Infer_type_of_0_from_usage_95011", "Infer type of '{0}' from usage"), 7035 Infer_parameter_types_from_usage: diag(95012, 3 /* Message */, "Infer_parameter_types_from_usage_95012", "Infer parameter types from usage"), 7036 Convert_to_default_import: diag(95013, 3 /* Message */, "Convert_to_default_import_95013", "Convert to default import"), 7037 Install_0: diag(95014, 3 /* Message */, "Install_0_95014", "Install '{0}'"), 7038 Replace_import_with_0: diag(95015, 3 /* Message */, "Replace_import_with_0_95015", "Replace import with '{0}'."), 7039 Use_synthetic_default_member: diag(95016, 3 /* Message */, "Use_synthetic_default_member_95016", "Use synthetic 'default' member."), 7040 Convert_to_ES_module: diag(95017, 3 /* Message */, "Convert_to_ES_module_95017", "Convert to ES module"), 7041 Add_undefined_type_to_property_0: diag(95018, 3 /* Message */, "Add_undefined_type_to_property_0_95018", "Add 'undefined' type to property '{0}'"), 7042 Add_initializer_to_property_0: diag(95019, 3 /* Message */, "Add_initializer_to_property_0_95019", "Add initializer to property '{0}'"), 7043 Add_definite_assignment_assertion_to_property_0: diag(95020, 3 /* Message */, "Add_definite_assignment_assertion_to_property_0_95020", "Add definite assignment assertion to property '{0}'"), 7044 Convert_all_type_literals_to_mapped_type: diag(95021, 3 /* Message */, "Convert_all_type_literals_to_mapped_type_95021", "Convert all type literals to mapped type"), 7045 Add_all_missing_members: diag(95022, 3 /* Message */, "Add_all_missing_members_95022", "Add all missing members"), 7046 Infer_all_types_from_usage: diag(95023, 3 /* Message */, "Infer_all_types_from_usage_95023", "Infer all types from usage"), 7047 Delete_all_unused_declarations: diag(95024, 3 /* Message */, "Delete_all_unused_declarations_95024", "Delete all unused declarations"), 7048 Prefix_all_unused_declarations_with_where_possible: diag(95025, 3 /* Message */, "Prefix_all_unused_declarations_with_where_possible_95025", "Prefix all unused declarations with '_' where possible"), 7049 Fix_all_detected_spelling_errors: diag(95026, 3 /* Message */, "Fix_all_detected_spelling_errors_95026", "Fix all detected spelling errors"), 7050 Add_initializers_to_all_uninitialized_properties: diag(95027, 3 /* Message */, "Add_initializers_to_all_uninitialized_properties_95027", "Add initializers to all uninitialized properties"), 7051 Add_definite_assignment_assertions_to_all_uninitialized_properties: diag(95028, 3 /* Message */, "Add_definite_assignment_assertions_to_all_uninitialized_properties_95028", "Add definite assignment assertions to all uninitialized properties"), 7052 Add_undefined_type_to_all_uninitialized_properties: diag(95029, 3 /* Message */, "Add_undefined_type_to_all_uninitialized_properties_95029", "Add undefined type to all uninitialized properties"), 7053 Change_all_jsdoc_style_types_to_TypeScript: diag(95030, 3 /* Message */, "Change_all_jsdoc_style_types_to_TypeScript_95030", "Change all jsdoc-style types to TypeScript"), 7054 Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types: diag(95031, 3 /* Message */, "Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types_95031", "Change all jsdoc-style types to TypeScript (and add '| undefined' to nullable types)"), 7055 Implement_all_unimplemented_interfaces: diag(95032, 3 /* Message */, "Implement_all_unimplemented_interfaces_95032", "Implement all unimplemented interfaces"), 7056 Install_all_missing_types_packages: diag(95033, 3 /* Message */, "Install_all_missing_types_packages_95033", "Install all missing types packages"), 7057 Rewrite_all_as_indexed_access_types: diag(95034, 3 /* Message */, "Rewrite_all_as_indexed_access_types_95034", "Rewrite all as indexed access types"), 7058 Convert_all_to_default_imports: diag(95035, 3 /* Message */, "Convert_all_to_default_imports_95035", "Convert all to default imports"), 7059 Make_all_super_calls_the_first_statement_in_their_constructor: diag(95036, 3 /* Message */, "Make_all_super_calls_the_first_statement_in_their_constructor_95036", "Make all 'super()' calls the first statement in their constructor"), 7060 Add_qualifier_to_all_unresolved_variables_matching_a_member_name: diag(95037, 3 /* Message */, "Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037", "Add qualifier to all unresolved variables matching a member name"), 7061 Change_all_extended_interfaces_to_implements: diag(95038, 3 /* Message */, "Change_all_extended_interfaces_to_implements_95038", "Change all extended interfaces to 'implements'"), 7062 Add_all_missing_super_calls: diag(95039, 3 /* Message */, "Add_all_missing_super_calls_95039", "Add all missing super calls"), 7063 Implement_all_inherited_abstract_classes: diag(95040, 3 /* Message */, "Implement_all_inherited_abstract_classes_95040", "Implement all inherited abstract classes"), 7064 Add_all_missing_async_modifiers: diag(95041, 3 /* Message */, "Add_all_missing_async_modifiers_95041", "Add all missing 'async' modifiers"), 7065 Add_ts_ignore_to_all_error_messages: diag(95042, 3 /* Message */, "Add_ts_ignore_to_all_error_messages_95042", "Add '@ts-ignore' to all error messages"), 7066 Annotate_everything_with_types_from_JSDoc: diag(95043, 3 /* Message */, "Annotate_everything_with_types_from_JSDoc_95043", "Annotate everything with types from JSDoc"), 7067 Add_to_all_uncalled_decorators: diag(95044, 3 /* Message */, "Add_to_all_uncalled_decorators_95044", "Add '()' to all uncalled decorators"), 7068 Convert_all_constructor_functions_to_classes: diag(95045, 3 /* Message */, "Convert_all_constructor_functions_to_classes_95045", "Convert all constructor functions to classes"), 7069 Generate_get_and_set_accessors: diag(95046, 3 /* Message */, "Generate_get_and_set_accessors_95046", "Generate 'get' and 'set' accessors"), 7070 Convert_require_to_import: diag(95047, 3 /* Message */, "Convert_require_to_import_95047", "Convert 'require' to 'import'"), 7071 Convert_all_require_to_import: diag(95048, 3 /* Message */, "Convert_all_require_to_import_95048", "Convert all 'require' to 'import'"), 7072 Move_to_a_new_file: diag(95049, 3 /* Message */, "Move_to_a_new_file_95049", "Move to a new file"), 7073 Remove_unreachable_code: diag(95050, 3 /* Message */, "Remove_unreachable_code_95050", "Remove unreachable code"), 7074 Remove_all_unreachable_code: diag(95051, 3 /* Message */, "Remove_all_unreachable_code_95051", "Remove all unreachable code"), 7075 Add_missing_typeof: diag(95052, 3 /* Message */, "Add_missing_typeof_95052", "Add missing 'typeof'"), 7076 Remove_unused_label: diag(95053, 3 /* Message */, "Remove_unused_label_95053", "Remove unused label"), 7077 Remove_all_unused_labels: diag(95054, 3 /* Message */, "Remove_all_unused_labels_95054", "Remove all unused labels"), 7078 Convert_0_to_mapped_object_type: diag(95055, 3 /* Message */, "Convert_0_to_mapped_object_type_95055", "Convert '{0}' to mapped object type"), 7079 Convert_namespace_import_to_named_imports: diag(95056, 3 /* Message */, "Convert_namespace_import_to_named_imports_95056", "Convert namespace import to named imports"), 7080 Convert_named_imports_to_namespace_import: diag(95057, 3 /* Message */, "Convert_named_imports_to_namespace_import_95057", "Convert named imports to namespace import"), 7081 Add_or_remove_braces_in_an_arrow_function: diag(95058, 3 /* Message */, "Add_or_remove_braces_in_an_arrow_function_95058", "Add or remove braces in an arrow function"), 7082 Add_braces_to_arrow_function: diag(95059, 3 /* Message */, "Add_braces_to_arrow_function_95059", "Add braces to arrow function"), 7083 Remove_braces_from_arrow_function: diag(95060, 3 /* Message */, "Remove_braces_from_arrow_function_95060", "Remove braces from arrow function"), 7084 Convert_default_export_to_named_export: diag(95061, 3 /* Message */, "Convert_default_export_to_named_export_95061", "Convert default export to named export"), 7085 Convert_named_export_to_default_export: diag(95062, 3 /* Message */, "Convert_named_export_to_default_export_95062", "Convert named export to default export"), 7086 Add_missing_enum_member_0: diag(95063, 3 /* Message */, "Add_missing_enum_member_0_95063", "Add missing enum member '{0}'"), 7087 Add_all_missing_imports: diag(95064, 3 /* Message */, "Add_all_missing_imports_95064", "Add all missing imports"), 7088 Convert_to_async_function: diag(95065, 3 /* Message */, "Convert_to_async_function_95065", "Convert to async function"), 7089 Convert_all_to_async_functions: diag(95066, 3 /* Message */, "Convert_all_to_async_functions_95066", "Convert all to async functions"), 7090 Add_missing_call_parentheses: diag(95067, 3 /* Message */, "Add_missing_call_parentheses_95067", "Add missing call parentheses"), 7091 Add_all_missing_call_parentheses: diag(95068, 3 /* Message */, "Add_all_missing_call_parentheses_95068", "Add all missing call parentheses"), 7092 Add_unknown_conversion_for_non_overlapping_types: diag(95069, 3 /* Message */, "Add_unknown_conversion_for_non_overlapping_types_95069", "Add 'unknown' conversion for non-overlapping types"), 7093 Add_unknown_to_all_conversions_of_non_overlapping_types: diag(95070, 3 /* Message */, "Add_unknown_to_all_conversions_of_non_overlapping_types_95070", "Add 'unknown' to all conversions of non-overlapping types"), 7094 Add_missing_new_operator_to_call: diag(95071, 3 /* Message */, "Add_missing_new_operator_to_call_95071", "Add missing 'new' operator to call"), 7095 Add_missing_new_operator_to_all_calls: diag(95072, 3 /* Message */, "Add_missing_new_operator_to_all_calls_95072", "Add missing 'new' operator to all calls"), 7096 Add_names_to_all_parameters_without_names: diag(95073, 3 /* Message */, "Add_names_to_all_parameters_without_names_95073", "Add names to all parameters without names"), 7097 Enable_the_experimentalDecorators_option_in_your_configuration_file: diag(95074, 3 /* Message */, "Enable_the_experimentalDecorators_option_in_your_configuration_file_95074", "Enable the 'experimentalDecorators' option in your configuration file"), 7098 Convert_parameters_to_destructured_object: diag(95075, 3 /* Message */, "Convert_parameters_to_destructured_object_95075", "Convert parameters to destructured object"), 7099 Extract_type: diag(95077, 3 /* Message */, "Extract_type_95077", "Extract type"), 7100 Extract_to_type_alias: diag(95078, 3 /* Message */, "Extract_to_type_alias_95078", "Extract to type alias"), 7101 Extract_to_typedef: diag(95079, 3 /* Message */, "Extract_to_typedef_95079", "Extract to typedef"), 7102 Infer_this_type_of_0_from_usage: diag(95080, 3 /* Message */, "Infer_this_type_of_0_from_usage_95080", "Infer 'this' type of '{0}' from usage"), 7103 Add_const_to_unresolved_variable: diag(95081, 3 /* Message */, "Add_const_to_unresolved_variable_95081", "Add 'const' to unresolved variable"), 7104 Add_const_to_all_unresolved_variables: diag(95082, 3 /* Message */, "Add_const_to_all_unresolved_variables_95082", "Add 'const' to all unresolved variables"), 7105 Add_await: diag(95083, 3 /* Message */, "Add_await_95083", "Add 'await'"), 7106 Add_await_to_initializer_for_0: diag(95084, 3 /* Message */, "Add_await_to_initializer_for_0_95084", "Add 'await' to initializer for '{0}'"), 7107 Fix_all_expressions_possibly_missing_await: diag(95085, 3 /* Message */, "Fix_all_expressions_possibly_missing_await_95085", "Fix all expressions possibly missing 'await'"), 7108 Remove_unnecessary_await: diag(95086, 3 /* Message */, "Remove_unnecessary_await_95086", "Remove unnecessary 'await'"), 7109 Remove_all_unnecessary_uses_of_await: diag(95087, 3 /* Message */, "Remove_all_unnecessary_uses_of_await_95087", "Remove all unnecessary uses of 'await'"), 7110 Enable_the_jsx_flag_in_your_configuration_file: diag(95088, 3 /* Message */, "Enable_the_jsx_flag_in_your_configuration_file_95088", "Enable the '--jsx' flag in your configuration file"), 7111 Add_await_to_initializers: diag(95089, 3 /* Message */, "Add_await_to_initializers_95089", "Add 'await' to initializers"), 7112 Extract_to_interface: diag(95090, 3 /* Message */, "Extract_to_interface_95090", "Extract to interface"), 7113 Convert_to_a_bigint_numeric_literal: diag(95091, 3 /* Message */, "Convert_to_a_bigint_numeric_literal_95091", "Convert to a bigint numeric literal"), 7114 Convert_all_to_bigint_numeric_literals: diag(95092, 3 /* Message */, "Convert_all_to_bigint_numeric_literals_95092", "Convert all to bigint numeric literals"), 7115 Convert_const_to_let: diag(95093, 3 /* Message */, "Convert_const_to_let_95093", "Convert 'const' to 'let'"), 7116 Prefix_with_declare: diag(95094, 3 /* Message */, "Prefix_with_declare_95094", "Prefix with 'declare'"), 7117 Prefix_all_incorrect_property_declarations_with_declare: diag(95095, 3 /* Message */, "Prefix_all_incorrect_property_declarations_with_declare_95095", "Prefix all incorrect property declarations with 'declare'"), 7118 Convert_to_template_string: diag(95096, 3 /* Message */, "Convert_to_template_string_95096", "Convert to template string"), 7119 Add_export_to_make_this_file_into_a_module: diag(95097, 3 /* Message */, "Add_export_to_make_this_file_into_a_module_95097", "Add 'export {}' to make this file into a module"), 7120 Set_the_target_option_in_your_configuration_file_to_0: diag(95098, 3 /* Message */, "Set_the_target_option_in_your_configuration_file_to_0_95098", "Set the 'target' option in your configuration file to '{0}'"), 7121 Set_the_module_option_in_your_configuration_file_to_0: diag(95099, 3 /* Message */, "Set_the_module_option_in_your_configuration_file_to_0_95099", "Set the 'module' option in your configuration file to '{0}'"), 7122 Convert_invalid_character_to_its_html_entity_code: diag(95100, 3 /* Message */, "Convert_invalid_character_to_its_html_entity_code_95100", "Convert invalid character to its html entity code"), 7123 Convert_all_invalid_characters_to_HTML_entity_code: diag(95101, 3 /* Message */, "Convert_all_invalid_characters_to_HTML_entity_code_95101", "Convert all invalid characters to HTML entity code"), 7124 Convert_all_const_to_let: diag(95102, 3 /* Message */, "Convert_all_const_to_let_95102", "Convert all 'const' to 'let'"), 7125 Convert_function_expression_0_to_arrow_function: diag(95105, 3 /* Message */, "Convert_function_expression_0_to_arrow_function_95105", "Convert function expression '{0}' to arrow function"), 7126 Convert_function_declaration_0_to_arrow_function: diag(95106, 3 /* Message */, "Convert_function_declaration_0_to_arrow_function_95106", "Convert function declaration '{0}' to arrow function"), 7127 Fix_all_implicit_this_errors: diag(95107, 3 /* Message */, "Fix_all_implicit_this_errors_95107", "Fix all implicit-'this' errors"), 7128 Wrap_invalid_character_in_an_expression_container: diag(95108, 3 /* Message */, "Wrap_invalid_character_in_an_expression_container_95108", "Wrap invalid character in an expression container"), 7129 Wrap_all_invalid_characters_in_an_expression_container: diag(95109, 3 /* Message */, "Wrap_all_invalid_characters_in_an_expression_container_95109", "Wrap all invalid characters in an expression container"), 7130 Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file: diag(95110, 3 /* Message */, "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110", "Visit https://aka.ms/tsconfig to read more about this file"), 7131 Add_a_return_statement: diag(95111, 3 /* Message */, "Add_a_return_statement_95111", "Add a return statement"), 7132 Remove_braces_from_arrow_function_body: diag(95112, 3 /* Message */, "Remove_braces_from_arrow_function_body_95112", "Remove braces from arrow function body"), 7133 Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal: diag(95113, 3 /* Message */, "Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113", "Wrap the following body with parentheses which should be an object literal"), 7134 Add_all_missing_return_statement: diag(95114, 3 /* Message */, "Add_all_missing_return_statement_95114", "Add all missing return statement"), 7135 Remove_braces_from_all_arrow_function_bodies_with_relevant_issues: diag(95115, 3 /* Message */, "Remove_braces_from_all_arrow_function_bodies_with_relevant_issues_95115", "Remove braces from all arrow function bodies with relevant issues"), 7136 Wrap_all_object_literal_with_parentheses: diag(95116, 3 /* Message */, "Wrap_all_object_literal_with_parentheses_95116", "Wrap all object literal with parentheses"), 7137 Move_labeled_tuple_element_modifiers_to_labels: diag(95117, 3 /* Message */, "Move_labeled_tuple_element_modifiers_to_labels_95117", "Move labeled tuple element modifiers to labels"), 7138 Convert_overload_list_to_single_signature: diag(95118, 3 /* Message */, "Convert_overload_list_to_single_signature_95118", "Convert overload list to single signature"), 7139 Generate_get_and_set_accessors_for_all_overriding_properties: diag(95119, 3 /* Message */, "Generate_get_and_set_accessors_for_all_overriding_properties_95119", "Generate 'get' and 'set' accessors for all overriding properties"), 7140 Wrap_in_JSX_fragment: diag(95120, 3 /* Message */, "Wrap_in_JSX_fragment_95120", "Wrap in JSX fragment"), 7141 Wrap_all_unparented_JSX_in_JSX_fragment: diag(95121, 3 /* Message */, "Wrap_all_unparented_JSX_in_JSX_fragment_95121", "Wrap all unparented JSX in JSX fragment"), 7142 Convert_arrow_function_or_function_expression: diag(95122, 3 /* Message */, "Convert_arrow_function_or_function_expression_95122", "Convert arrow function or function expression"), 7143 Convert_to_anonymous_function: diag(95123, 3 /* Message */, "Convert_to_anonymous_function_95123", "Convert to anonymous function"), 7144 Convert_to_named_function: diag(95124, 3 /* Message */, "Convert_to_named_function_95124", "Convert to named function"), 7145 Convert_to_arrow_function: diag(95125, 3 /* Message */, "Convert_to_arrow_function_95125", "Convert to arrow function"), 7146 Remove_parentheses: diag(95126, 3 /* Message */, "Remove_parentheses_95126", "Remove parentheses"), 7147 Could_not_find_a_containing_arrow_function: diag(95127, 3 /* Message */, "Could_not_find_a_containing_arrow_function_95127", "Could not find a containing arrow function"), 7148 Containing_function_is_not_an_arrow_function: diag(95128, 3 /* Message */, "Containing_function_is_not_an_arrow_function_95128", "Containing function is not an arrow function"), 7149 Could_not_find_export_statement: diag(95129, 3 /* Message */, "Could_not_find_export_statement_95129", "Could not find export statement"), 7150 This_file_already_has_a_default_export: diag(95130, 3 /* Message */, "This_file_already_has_a_default_export_95130", "This file already has a default export"), 7151 Could_not_find_import_clause: diag(95131, 3 /* Message */, "Could_not_find_import_clause_95131", "Could not find import clause"), 7152 Could_not_find_namespace_import_or_named_imports: diag(95132, 3 /* Message */, "Could_not_find_namespace_import_or_named_imports_95132", "Could not find namespace import or named imports"), 7153 Selection_is_not_a_valid_type_node: diag(95133, 3 /* Message */, "Selection_is_not_a_valid_type_node_95133", "Selection is not a valid type node"), 7154 No_type_could_be_extracted_from_this_type_node: diag(95134, 3 /* Message */, "No_type_could_be_extracted_from_this_type_node_95134", "No type could be extracted from this type node"), 7155 Could_not_find_property_for_which_to_generate_accessor: diag(95135, 3 /* Message */, "Could_not_find_property_for_which_to_generate_accessor_95135", "Could not find property for which to generate accessor"), 7156 Name_is_not_valid: diag(95136, 3 /* Message */, "Name_is_not_valid_95136", "Name is not valid"), 7157 Can_only_convert_property_with_modifier: diag(95137, 3 /* Message */, "Can_only_convert_property_with_modifier_95137", "Can only convert property with modifier"), 7158 Switch_each_misused_0_to_1: diag(95138, 3 /* Message */, "Switch_each_misused_0_to_1_95138", "Switch each misused '{0}' to '{1}'"), 7159 Convert_to_optional_chain_expression: diag(95139, 3 /* Message */, "Convert_to_optional_chain_expression_95139", "Convert to optional chain expression"), 7160 Could_not_find_convertible_access_expression: diag(95140, 3 /* Message */, "Could_not_find_convertible_access_expression_95140", "Could not find convertible access expression"), 7161 Could_not_find_matching_access_expressions: diag(95141, 3 /* Message */, "Could_not_find_matching_access_expressions_95141", "Could not find matching access expressions"), 7162 Can_only_convert_logical_AND_access_chains: diag(95142, 3 /* Message */, "Can_only_convert_logical_AND_access_chains_95142", "Can only convert logical AND access chains"), 7163 Add_void_to_Promise_resolved_without_a_value: diag(95143, 3 /* Message */, "Add_void_to_Promise_resolved_without_a_value_95143", "Add 'void' to Promise resolved without a value"), 7164 Add_void_to_all_Promises_resolved_without_a_value: diag(95144, 3 /* Message */, "Add_void_to_all_Promises_resolved_without_a_value_95144", "Add 'void' to all Promises resolved without a value"), 7165 Use_element_access_for_0: diag(95145, 3 /* Message */, "Use_element_access_for_0_95145", "Use element access for '{0}'"), 7166 Use_element_access_for_all_undeclared_properties: diag(95146, 3 /* Message */, "Use_element_access_for_all_undeclared_properties_95146", "Use element access for all undeclared properties."), 7167 Delete_all_unused_imports: diag(95147, 3 /* Message */, "Delete_all_unused_imports_95147", "Delete all unused imports"), 7168 Infer_function_return_type: diag(95148, 3 /* Message */, "Infer_function_return_type_95148", "Infer function return type"), 7169 Return_type_must_be_inferred_from_a_function: diag(95149, 3 /* Message */, "Return_type_must_be_inferred_from_a_function_95149", "Return type must be inferred from a function"), 7170 Could_not_determine_function_return_type: diag(95150, 3 /* Message */, "Could_not_determine_function_return_type_95150", "Could not determine function return type"), 7171 Could_not_convert_to_arrow_function: diag(95151, 3 /* Message */, "Could_not_convert_to_arrow_function_95151", "Could not convert to arrow function"), 7172 Could_not_convert_to_named_function: diag(95152, 3 /* Message */, "Could_not_convert_to_named_function_95152", "Could not convert to named function"), 7173 Could_not_convert_to_anonymous_function: diag(95153, 3 /* Message */, "Could_not_convert_to_anonymous_function_95153", "Could not convert to anonymous function"), 7174 Can_only_convert_string_concatenation: diag(95154, 3 /* Message */, "Can_only_convert_string_concatenation_95154", "Can only convert string concatenation"), 7175 Selection_is_not_a_valid_statement_or_statements: diag(95155, 3 /* Message */, "Selection_is_not_a_valid_statement_or_statements_95155", "Selection is not a valid statement or statements"), 7176 Add_missing_function_declaration_0: diag(95156, 3 /* Message */, "Add_missing_function_declaration_0_95156", "Add missing function declaration '{0}'"), 7177 Add_all_missing_function_declarations: diag(95157, 3 /* Message */, "Add_all_missing_function_declarations_95157", "Add all missing function declarations"), 7178 Method_not_implemented: diag(95158, 3 /* Message */, "Method_not_implemented_95158", "Method not implemented."), 7179 Function_not_implemented: diag(95159, 3 /* Message */, "Function_not_implemented_95159", "Function not implemented."), 7180 Add_override_modifier: diag(95160, 3 /* Message */, "Add_override_modifier_95160", "Add 'override' modifier"), 7181 Remove_override_modifier: diag(95161, 3 /* Message */, "Remove_override_modifier_95161", "Remove 'override' modifier"), 7182 Add_all_missing_override_modifiers: diag(95162, 3 /* Message */, "Add_all_missing_override_modifiers_95162", "Add all missing 'override' modifiers"), 7183 Remove_all_unnecessary_override_modifiers: diag(95163, 3 /* Message */, "Remove_all_unnecessary_override_modifiers_95163", "Remove all unnecessary 'override' modifiers"), 7184 Can_only_convert_named_export: diag(95164, 3 /* Message */, "Can_only_convert_named_export_95164", "Can only convert named export"), 7185 Add_missing_properties: diag(95165, 3 /* Message */, "Add_missing_properties_95165", "Add missing properties"), 7186 Add_all_missing_properties: diag(95166, 3 /* Message */, "Add_all_missing_properties_95166", "Add all missing properties"), 7187 Add_missing_attributes: diag(95167, 3 /* Message */, "Add_missing_attributes_95167", "Add missing attributes"), 7188 Add_all_missing_attributes: diag(95168, 3 /* Message */, "Add_all_missing_attributes_95168", "Add all missing attributes"), 7189 Add_undefined_to_optional_property_type: diag(95169, 3 /* Message */, "Add_undefined_to_optional_property_type_95169", "Add 'undefined' to optional property type"), 7190 Convert_named_imports_to_default_import: diag(95170, 3 /* Message */, "Convert_named_imports_to_default_import_95170", "Convert named imports to default import"), 7191 Delete_unused_param_tag_0: diag(95171, 3 /* Message */, "Delete_unused_param_tag_0_95171", "Delete unused '@param' tag '{0}'"), 7192 Delete_all_unused_param_tags: diag(95172, 3 /* Message */, "Delete_all_unused_param_tags_95172", "Delete all unused '@param' tags"), 7193 Rename_param_tag_name_0_to_1: diag(95173, 3 /* Message */, "Rename_param_tag_name_0_to_1_95173", "Rename '@param' tag name '{0}' to '{1}'"), 7194 Use_0: diag(95174, 3 /* Message */, "Use_0_95174", "Use `{0}`."), 7195 Use_Number_isNaN_in_all_conditions: diag(95175, 3 /* Message */, "Use_Number_isNaN_in_all_conditions_95175", "Use `Number.isNaN` in all conditions."), 7196 No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* Error */, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."), 7197 Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."), 7198 JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* Error */, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"), 7199 Private_identifiers_cannot_be_used_as_parameters: diag(18009, 1 /* Error */, "Private_identifiers_cannot_be_used_as_parameters_18009", "Private identifiers cannot be used as parameters."), 7200 An_accessibility_modifier_cannot_be_used_with_a_private_identifier: diag(18010, 1 /* Error */, "An_accessibility_modifier_cannot_be_used_with_a_private_identifier_18010", "An accessibility modifier cannot be used with a private identifier."), 7201 The_operand_of_a_delete_operator_cannot_be_a_private_identifier: diag(18011, 1 /* Error */, "The_operand_of_a_delete_operator_cannot_be_a_private_identifier_18011", "The operand of a 'delete' operator cannot be a private identifier."), 7202 constructor_is_a_reserved_word: diag(18012, 1 /* Error */, "constructor_is_a_reserved_word_18012", "'#constructor' is a reserved word."), 7203 Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier: diag(18013, 1 /* Error */, "Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier_18013", "Property '{0}' is not accessible outside class '{1}' because it has a private identifier."), 7204 The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_private_identifier_with_the_same_spelling: diag(18014, 1 /* Error */, "The_property_0_cannot_be_accessed_on_type_1_within_this_class_because_it_is_shadowed_by_another_priv_18014", "The property '{0}' cannot be accessed on type '{1}' within this class because it is shadowed by another private identifier with the same spelling."), 7205 Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2: diag(18015, 1 /* Error */, "Property_0_in_type_1_refers_to_a_different_member_that_cannot_be_accessed_from_within_type_2_18015", "Property '{0}' in type '{1}' refers to a different member that cannot be accessed from within type '{2}'."), 7206 Private_identifiers_are_not_allowed_outside_class_bodies: diag(18016, 1 /* Error */, "Private_identifiers_are_not_allowed_outside_class_bodies_18016", "Private identifiers are not allowed outside class bodies."), 7207 The_shadowing_declaration_of_0_is_defined_here: diag(18017, 1 /* Error */, "The_shadowing_declaration_of_0_is_defined_here_18017", "The shadowing declaration of '{0}' is defined here"), 7208 The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here: diag(18018, 1 /* Error */, "The_declaration_of_0_that_you_probably_intended_to_use_is_defined_here_18018", "The declaration of '{0}' that you probably intended to use is defined here"), 7209 _0_modifier_cannot_be_used_with_a_private_identifier: diag(18019, 1 /* Error */, "_0_modifier_cannot_be_used_with_a_private_identifier_18019", "'{0}' modifier cannot be used with a private identifier."), 7210 An_enum_member_cannot_be_named_with_a_private_identifier: diag(18024, 1 /* Error */, "An_enum_member_cannot_be_named_with_a_private_identifier_18024", "An enum member cannot be named with a private identifier."), 7211 can_only_be_used_at_the_start_of_a_file: diag(18026, 1 /* Error */, "can_only_be_used_at_the_start_of_a_file_18026", "'#!' can only be used at the start of a file."), 7212 Compiler_reserves_name_0_when_emitting_private_identifier_downlevel: diag(18027, 1 /* Error */, "Compiler_reserves_name_0_when_emitting_private_identifier_downlevel_18027", "Compiler reserves name '{0}' when emitting private identifier downlevel."), 7213 Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher: diag(18028, 1 /* Error */, "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028", "Private identifiers are only available when targeting ECMAScript 2015 and higher."), 7214 Private_identifiers_are_not_allowed_in_variable_declarations: diag(18029, 1 /* Error */, "Private_identifiers_are_not_allowed_in_variable_declarations_18029", "Private identifiers are not allowed in variable declarations."), 7215 An_optional_chain_cannot_contain_private_identifiers: diag(18030, 1 /* Error */, "An_optional_chain_cannot_contain_private_identifiers_18030", "An optional chain cannot contain private identifiers."), 7216 The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents: diag(18031, 1 /* Error */, "The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituent_18031", "The intersection '{0}' was reduced to 'never' because property '{1}' has conflicting types in some constituents."), 7217 The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_private_in_some: diag(18032, 1 /* Error */, "The_intersection_0_was_reduced_to_never_because_property_1_exists_in_multiple_constituents_and_is_pr_18032", "The intersection '{0}' was reduced to 'never' because property '{1}' exists in multiple constituents and is private in some."), 7218 Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhaustiveness_checks_consider_using_an_object_literal_instead: diag(18033, 1 /* Error */, "Only_numeric_enums_can_have_computed_members_but_this_expression_has_type_0_If_you_do_not_need_exhau_18033", "Only numeric enums can have computed members, but this expression has type '{0}'. If you do not need exhaustiveness checks, consider using an object literal instead."), 7219 Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compiler_option_is_specified_e_g_Fragment: diag(18034, 3 /* Message */, "Specify_the_JSX_fragment_factory_function_to_use_when_targeting_react_JSX_emit_with_jsxFactory_compi_18034", "Specify the JSX fragment factory function to use when targeting 'react' JSX emit with 'jsxFactory' compiler option is specified, e.g. 'Fragment'."), 7220 Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name: diag(18035, 1 /* Error */, "Invalid_value_for_jsxFragmentFactory_0_is_not_a_valid_identifier_or_qualified_name_18035", "Invalid value for 'jsxFragmentFactory'. '{0}' is not a valid identifier or qualified-name."), 7221 Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator: diag(18036, 1 /* Error */, "Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_dec_18036", "Class decorators can't be used with static private identifier. Consider removing the experimental decorator."), 7222 Await_expression_cannot_be_used_inside_a_class_static_block: diag(18037, 1 /* Error */, "Await_expression_cannot_be_used_inside_a_class_static_block_18037", "Await expression cannot be used inside a class static block."), 7223 For_await_loops_cannot_be_used_inside_a_class_static_block: diag(18038, 1 /* Error */, "For_await_loops_cannot_be_used_inside_a_class_static_block_18038", "'For await' loops cannot be used inside a class static block."), 7224 Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block: diag(18039, 1 /* Error */, "Invalid_use_of_0_It_cannot_be_used_inside_a_class_static_block_18039", "Invalid use of '{0}'. It cannot be used inside a class static block."), 7225 A_return_statement_cannot_be_used_inside_a_class_static_block: diag(18041, 1 /* Error */, "A_return_statement_cannot_be_used_inside_a_class_static_block_18041", "A 'return' statement cannot be used inside a class static block."), 7226 _0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation: diag(18042, 1 /* Error */, "_0_is_a_type_and_cannot_be_imported_in_JavaScript_files_Use_1_in_a_JSDoc_type_annotation_18042", "'{0}' is a type and cannot be imported in JavaScript files. Use '{1}' in a JSDoc type annotation."), 7227 Types_cannot_appear_in_export_declarations_in_JavaScript_files: diag(18043, 1 /* Error */, "Types_cannot_appear_in_export_declarations_in_JavaScript_files_18043", "Types cannot appear in export declarations in JavaScript files."), 7228 _0_is_automatically_exported_here: diag(18044, 3 /* Message */, "_0_is_automatically_exported_here_18044", "'{0}' is automatically exported here."), 7229 Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher: diag(18045, 1 /* Error */, "Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher_18045", "Properties with the 'accessor' modifier are only available when targeting ECMAScript 2015 and higher."), 7230 _0_is_of_type_unknown: diag(18046, 1 /* Error */, "_0_is_of_type_unknown_18046", "'{0}' is of type 'unknown'."), 7231 _0_is_possibly_null: diag(18047, 1 /* Error */, "_0_is_possibly_null_18047", "'{0}' is possibly 'null'."), 7232 _0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."), 7233 _0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."), 7234 The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."), 7235 Should_not_add_return_type_to_the_function_that_is_annotated_by_Extend: diag(28e3, 1 /* Error */, "Should_not_add_return_type_to_the_function_that_is_annotated_by_Extend_28000", "Should not add return type to the function that is annotated by Extend."), 7236 Decorator_name_must_be_one_of_ETS_Components: diag(28001, 1 /* Error */, "Decorator_name_must_be_one_of_ETS_Components_28001", "Decorator name must be one of ETS Components"), 7237 A_struct_declaration_without_the_default_modifier_must_have_a_name: diag(28002, 1 /* Error */, "A_struct_declaration_without_the_default_modifier_must_have_a_name_28002", "A struct declaration without the 'default' modifier must have a name."), 7238 Should_not_add_return_type_to_the_function_that_is_annotated_by_Styles: diag(28003, 1 /* Error */, "Should_not_add_return_type_to_the_function_that_is_annotated_by_Styles_28003", "Should not add return type to the function that is annotated by Styles."), 7239 Unable_to_resolve_signature_of_function_decorator_when_decorators_are_not_valid: diag(28004, 1 /* Error */, "Unable_to_resolve_signature_of_function_decorator_when_decorators_are_not_valid_28004", "Unable to resolve signature of function decorator when decorators are not valid."), 7240 The_statement_must_be_written_use_the_function_0_under_the_if_condition: diag(28005, 0 /* Warning */, "The_statement_must_be_written_use_the_function_0_under_the_if_condition_28005", "The statement must be written use the function '{0}' under the if condition."), 7241 The_struct_name_cannot_contain_reserved_tag_name_Colon_0: diag(28006, 1 /* Error */, "The_struct_name_cannot_contain_reserved_tag_name_Colon_0_28006", "The struct name cannot contain reserved tag name: '{0}'."), 7242 This_API_has_been_Special_Markings_exercise_caution_when_using_this_API: diag(28007, 0 /* Warning */, "This_API_has_been_Special_Markings_exercise_caution_when_using_this_API_28007", "This API has been Special Markings. exercise caution when using this API."), 7243 Looking_up_in_oh_modules_folder_initial_location_0: diag(28008, 3 /* Message */, "Looking_up_in_oh_modules_folder_initial_location_0_28008", "Looking up in 'oh_modules' folder, initial location '{0}'."), 7244 Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_oh_modules_folder: diag(28009, 3 /* Message */, "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_oh_modul_28009", "Containing file is not specified and root directory cannot be determined, skipping lookup in 'oh_modules' folder."), 7245 Loading_module_0_from_oh_modules_folder_target_file_type_1: diag(28010, 3 /* Message */, "Loading_module_0_from_oh_modules_folder_target_file_type_1_28010", "Loading module '{0}' from 'oh_modules' folder, target file type '{1}'."), 7246 Found_oh_package_json5_at_0: diag(28011, 3 /* Message */, "Found_oh_package_json5_at_0_28011", "Found 'oh-package.json5' at '{0}'."), 7247 oh_package_json5_does_not_have_a_0_field: diag(28012, 3 /* Message */, "oh_package_json5_does_not_have_a_0_field_28012", "'oh-package.json5' does not have a '{0}' field."), 7248 oh_package_json5_has_0_field_1_that_references_2: diag(28013, 3 /* Message */, "oh_package_json5_has_0_field_1_that_references_2_28013", "'oh-package.json5' has '{0}' field '{1}' that references '{2}'."), 7249 Currently_module_for_0_is_not_verified_If_you_re_importing_napi_its_verification_will_be_enabled_in_later_SDK_version_Please_make_sure_the_corresponding_d_ts_file_is_provided_and_the_napis_are_correctly_declared: diag(28014, 0 /* Warning */, "Currently_module_for_0_is_not_verified_If_you_re_importing_napi_its_verification_will_be_enabled_in__28014", "Currently module for '{0}' is not verified. If you're importing napi, its verification will be enabled in later SDK version. Please make sure the corresponding .d.ts file is provided and the napis are correctly declared."), 7250 UI_component_0_cannot_be_used_in_this_place: diag(28015, 1 /* Error */, "UI_component_0_cannot_be_used_in_this_place_28015", "UI component '{0}' cannot be used in this place."), 7251 Importing_ArkTS_files_in_JS_and_TS_files_is_about_to_be_forbidden: diag(28016, 0 /* Warning */, "Importing_ArkTS_files_in_JS_and_TS_files_is_about_to_be_forbidden_28016", "Importing ArkTS files in JS and TS files is about to be forbidden."), 7252 Importing_ArkTS_files_in_JS_and_TS_files_is_forbidden: diag(28017, 1 /* Error */, "Importing_ArkTS_files_in_JS_and_TS_files_is_forbidden_28017", "Importing ArkTS files in JS and TS files is forbidden."), 7253 Unexpected_token_An_annotation_property_was_expected: diag(28018, 1 /* Error */, "Unexpected_token_An_annotation_property_was_expected_28018", "Unexpected token. An annotation property was expected."), 7254 When_annotation_0_is_applied_all_fields_without_default_values_must_be_provided: diag(28019, 1 /* Error */, "When_annotation_0_is_applied_all_fields_without_default_values_must_be_provided_28019", "When annotation '{0}' is applied, all fields without default values must be provided."), 7255 Only_an_object_literal_have_to_be_provided_as_annotation_parameters_list_got_Colon_0: diag(28020, 1 /* Error */, "Only_an_object_literal_have_to_be_provided_as_annotation_parameters_list_got_Colon_0_28020", "Only an object literal have to be provided as annotation parameters list, got: '{0}'."), 7256 Annotation_have_to_be_applied_only_for_non_abstract_class_declarations_and_method_declarations_in_non_abstract_classes_got_Colon_0: diag(28021, 1 /* Error */, "Annotation_have_to_be_applied_only_for_non_abstract_class_declarations_and_method_declarations_in_no_28021", "Annotation have to be applied only for non-abstract class declarations and method declarations in non-abstract classes, got: '{0}'."), 7257 Annotation_have_to_be_applied_for_classes_or_methods_only_got_Colon_0: diag(28022, 1 /* Error */, "Annotation_have_to_be_applied_for_classes_or_methods_only_got_Colon_0_28022", "Annotation have to be applied for classes or methods only, got: '{0}'."), 7258 Repeatable_annotation_are_not_supported_got_Colon_0: diag(28023, 1 /* Error */, "Repeatable_annotation_are_not_supported_got_Colon_0_28023", "Repeatable annotation are not supported, got: '{0}'."), 7259 Annotation_must_be_defined_at_top_level_only: diag(28024, 1 /* Error */, "Annotation_must_be_defined_at_top_level_only_28024", "Annotation must be defined at top-level only."), 7260 Annotation_name_cannot_be_0: diag(28025, 1 /* Error */, "Annotation_name_cannot_be_0_28025", "Annotation name cannot be '{0}'."), 7261 Annotation_cannot_be_applied_for_annotation_declaration: diag(28026, 1 /* Error */, "Annotation_cannot_be_applied_for_annotation_declaration_28026", "Annotation cannot be applied for annotation declaration."), 7262 Annotation_cannot_be_used_as_type_or_variable_or_function_or_method: diag(28027, 1 /* Error */, "Annotation_cannot_be_used_as_type_or_variable_or_function_or_method_28027", "Annotation cannot be used as type or variable or function or method."), 7263 Annotation_cannot_be_used_as_a_type: diag(28028, 1 /* Error */, "Annotation_cannot_be_used_as_a_type_28028", "Annotation cannot be used as a type."), 7264 Annotation_cannot_be_used_as_a_value: diag(28029, 1 /* Error */, "Annotation_cannot_be_used_as_a_value_28029", "Annotation cannot be used as a value."), 7265 Annotation_cannot_be_renamed_in_import_or_export: diag(28030, 1 /* Error */, "Annotation_cannot_be_renamed_in_import_or_export_28030", "Annotation cannot be renamed in import or export."), 7266 Annotation_cannot_be_exported_as_default: diag(28031, 1 /* Error */, "Annotation_cannot_be_exported_as_default_28031", "Annotation cannot be exported as default."), 7267 An_annotation_property_must_have_a_type_or_Slashand_an_initializer: diag(28032, 1 /* Error */, "An_annotation_property_must_have_a_type_or_Slashand_an_initializer_28032", "An annotation property must have a type or/and an initializer."), 7268 A_type_of_annotation_property_have_to_be_number_boolean_string_const_enumeration_types_or_array_of_above_types_got_Colon_0: diag(28033, 1 /* Error */, "A_type_of_annotation_property_have_to_be_number_boolean_string_const_enumeration_types_or_array_of_a_28033", "A type of annotation property have to be number, boolean, string, const enumeration types or array of above types, got: '{0}'."), 7269 Default_value_of_annotation_property_can_be_a_constant_expression_got_Colon_0: diag(28034, 1 /* Error */, "Default_value_of_annotation_property_can_be_a_constant_expression_got_Colon_0_28034", "Default value of annotation property can be a constant expression, got: '{0}'."), 7270 All_members_of_object_literal_which_is_provided_as_annotation_parameters_list_have_to_be_constant_expressions_got_Colon_0: diag(28035, 1 /* Error */, "All_members_of_object_literal_which_is_provided_as_annotation_parameters_list_have_to_be_constant_ex_28035", "All members of object literal which is provided as annotation parameters list, have to be constant expressions, got: '{0}'."), 7271 Annotation_0_used_before_its_declaration: diag(28036, 1 /* Error */, "Annotation_0_used_before_its_declaration_28036", "Annotation '{0}' used before its declaration."), 7272 In_annotation_declaration_any_symbols_between_and_interface_are_forbidden: diag(28037, 1 /* Error */, "In_annotation_declaration_any_symbols_between_and_interface_are_forbidden_28037", "In annotation declaration any symbols between '@' and 'interface' are forbidden."), 7273 Enable_support_of_ETS_annotations: diag(28038, 3 /* Message */, "Enable_support_of_ETS_annotations_28038", "Enable support of ETS annotations"), 7274 Annotation_can_only_be_exported_in_declaration_statement: diag(28039, 1 /* Error */, "Annotation_can_only_be_exported_in_declaration_statement_28039", "Annotation can only be exported in declaration statement."), 7275 Function_may_throw_exceptions_Special_handling_is_required: diag(28040, 0 /* Warning */, "Function_may_throw_exceptions_Special_handling_is_required_28040", "Function may throw exceptions. Special handling is required.") 7276}; 7277 7278// src/compiler/memorydotting/memoryDotting.ts 7279var MemoryDotting; 7280((MemoryDotting2) => { 7281 MemoryDotting2.BINDE_SOURCE_FILE = "binder(bindSourceFile: Bind)"; 7282 MemoryDotting2.CHECK_SOURCE_FILE = "checker(checkSourceFile: Check)"; 7283 MemoryDotting2.EMIT_FILES = "emitter(emitFiles: EmitEachOutputFile)"; 7284 MemoryDotting2.CREATE_SORUCE_FILE_PARSE = "parser(createSourceFile: Parse)"; 7285 MemoryDotting2.BEFORE_PROGRAM = "program(createProgram: beforeProgram)"; 7286 MemoryDotting2.TRANSFORM = "transformer(transformNodes: Transform)"; 7287 let memoryDottingCallback; 7288 let memoryDottingStopCallback; 7289 function recordStage(stage) { 7290 if (memoryDottingCallback !== void 0) { 7291 return memoryDottingCallback(stage); 7292 } 7293 return null; 7294 } 7295 MemoryDotting2.recordStage = recordStage; 7296 function stopRecordStage(recordInfo) { 7297 if (memoryDottingStopCallback !== void 0 && recordInfo !== null) { 7298 memoryDottingStopCallback(recordInfo); 7299 } 7300 } 7301 MemoryDotting2.stopRecordStage = stopRecordStage; 7302 function setMemoryDottingCallBack(recordCallback, stopCallback) { 7303 if (recordCallback) { 7304 memoryDottingCallback = recordCallback; 7305 } 7306 if (stopCallback) { 7307 memoryDottingStopCallback = stopCallback; 7308 } 7309 } 7310 MemoryDotting2.setMemoryDottingCallBack = setMemoryDottingCallBack; 7311 function clearCallBack() { 7312 if (memoryDottingCallback !== void 0) { 7313 memoryDottingCallback = void 0; 7314 } 7315 if (memoryDottingStopCallback !== void 0) { 7316 memoryDottingStopCallback = void 0; 7317 } 7318 } 7319 MemoryDotting2.clearCallBack = clearCallBack; 7320})(MemoryDotting || (MemoryDotting = {})); 7321 7322// src/compiler/scanner.ts 7323function tokenIsIdentifierOrKeyword(token) { 7324 return token >= 79 /* Identifier */; 7325} 7326function tokenIsIdentifierOrKeywordOrGreaterThan(token) { 7327 return token === 31 /* GreaterThanToken */ || tokenIsIdentifierOrKeyword(token); 7328} 7329var textToKeywordObj = { 7330 abstract: 127 /* AbstractKeyword */, 7331 accessor: 128 /* AccessorKeyword */, 7332 any: 132 /* AnyKeyword */, 7333 as: 129 /* AsKeyword */, 7334 asserts: 130 /* AssertsKeyword */, 7335 assert: 131 /* AssertKeyword */, 7336 bigint: 162 /* BigIntKeyword */, 7337 boolean: 135 /* BooleanKeyword */, 7338 break: 81 /* BreakKeyword */, 7339 case: 82 /* CaseKeyword */, 7340 catch: 83 /* CatchKeyword */, 7341 class: 84 /* ClassKeyword */, 7342 continue: 87 /* ContinueKeyword */, 7343 const: 86 /* ConstKeyword */, 7344 ["constructor"]: 136 /* ConstructorKeyword */, 7345 debugger: 88 /* DebuggerKeyword */, 7346 declare: 137 /* DeclareKeyword */, 7347 default: 89 /* DefaultKeyword */, 7348 delete: 90 /* DeleteKeyword */, 7349 do: 91 /* DoKeyword */, 7350 else: 92 /* ElseKeyword */, 7351 enum: 93 /* EnumKeyword */, 7352 export: 94 /* ExportKeyword */, 7353 extends: 95 /* ExtendsKeyword */, 7354 false: 96 /* FalseKeyword */, 7355 finally: 97 /* FinallyKeyword */, 7356 for: 98 /* ForKeyword */, 7357 from: 160 /* FromKeyword */, 7358 function: 99 /* FunctionKeyword */, 7359 get: 138 /* GetKeyword */, 7360 if: 100 /* IfKeyword */, 7361 implements: 118 /* ImplementsKeyword */, 7362 import: 101 /* ImportKeyword */, 7363 in: 102 /* InKeyword */, 7364 infer: 139 /* InferKeyword */, 7365 instanceof: 103 /* InstanceOfKeyword */, 7366 interface: 119 /* InterfaceKeyword */, 7367 intrinsic: 140 /* IntrinsicKeyword */, 7368 is: 141 /* IsKeyword */, 7369 keyof: 142 /* KeyOfKeyword */, 7370 let: 120 /* LetKeyword */, 7371 module: 143 /* ModuleKeyword */, 7372 namespace: 144 /* NamespaceKeyword */, 7373 never: 145 /* NeverKeyword */, 7374 new: 104 /* NewKeyword */, 7375 null: 105 /* NullKeyword */, 7376 number: 149 /* NumberKeyword */, 7377 object: 150 /* ObjectKeyword */, 7378 package: 121 /* PackageKeyword */, 7379 private: 122 /* PrivateKeyword */, 7380 protected: 123 /* ProtectedKeyword */, 7381 public: 124 /* PublicKeyword */, 7382 override: 163 /* OverrideKeyword */, 7383 out: 146 /* OutKeyword */, 7384 readonly: 147 /* ReadonlyKeyword */, 7385 require: 148 /* RequireKeyword */, 7386 global: 161 /* GlobalKeyword */, 7387 return: 106 /* ReturnKeyword */, 7388 satisfies: 151 /* SatisfiesKeyword */, 7389 set: 152 /* SetKeyword */, 7390 static: 125 /* StaticKeyword */, 7391 string: 153 /* StringKeyword */, 7392 struct: 85 /* StructKeyword */, 7393 super: 107 /* SuperKeyword */, 7394 switch: 108 /* SwitchKeyword */, 7395 symbol: 154 /* SymbolKeyword */, 7396 this: 109 /* ThisKeyword */, 7397 throw: 110 /* ThrowKeyword */, 7398 true: 111 /* TrueKeyword */, 7399 try: 112 /* TryKeyword */, 7400 type: 155 /* TypeKeyword */, 7401 lazy: 156 /* LazyKeyword */, 7402 typeof: 113 /* TypeOfKeyword */, 7403 undefined: 157 /* UndefinedKeyword */, 7404 unique: 158 /* UniqueKeyword */, 7405 unknown: 159 /* UnknownKeyword */, 7406 var: 114 /* VarKeyword */, 7407 void: 115 /* VoidKeyword */, 7408 while: 116 /* WhileKeyword */, 7409 with: 117 /* WithKeyword */, 7410 yield: 126 /* YieldKeyword */, 7411 async: 133 /* AsyncKeyword */, 7412 await: 134 /* AwaitKeyword */, 7413 of: 164 /* OfKeyword */ 7414}; 7415var textToKeyword = new Map2(getEntries(textToKeywordObj)); 7416var textToToken = new Map2(getEntries({ 7417 ...textToKeywordObj, 7418 "{": 18 /* OpenBraceToken */, 7419 "}": 19 /* CloseBraceToken */, 7420 "(": 20 /* OpenParenToken */, 7421 ")": 21 /* CloseParenToken */, 7422 "[": 22 /* OpenBracketToken */, 7423 "]": 23 /* CloseBracketToken */, 7424 ".": 24 /* DotToken */, 7425 "...": 25 /* DotDotDotToken */, 7426 ";": 26 /* SemicolonToken */, 7427 ",": 27 /* CommaToken */, 7428 "<": 29 /* LessThanToken */, 7429 ">": 31 /* GreaterThanToken */, 7430 "<=": 32 /* LessThanEqualsToken */, 7431 ">=": 33 /* GreaterThanEqualsToken */, 7432 "==": 34 /* EqualsEqualsToken */, 7433 "!=": 35 /* ExclamationEqualsToken */, 7434 "===": 36 /* EqualsEqualsEqualsToken */, 7435 "!==": 37 /* ExclamationEqualsEqualsToken */, 7436 "=>": 38 /* EqualsGreaterThanToken */, 7437 "+": 39 /* PlusToken */, 7438 "-": 40 /* MinusToken */, 7439 "**": 42 /* AsteriskAsteriskToken */, 7440 "*": 41 /* AsteriskToken */, 7441 "/": 43 /* SlashToken */, 7442 "%": 44 /* PercentToken */, 7443 "++": 45 /* PlusPlusToken */, 7444 "--": 46 /* MinusMinusToken */, 7445 "<<": 47 /* LessThanLessThanToken */, 7446 "</": 30 /* LessThanSlashToken */, 7447 ">>": 48 /* GreaterThanGreaterThanToken */, 7448 ">>>": 49 /* GreaterThanGreaterThanGreaterThanToken */, 7449 "&": 50 /* AmpersandToken */, 7450 "|": 51 /* BarToken */, 7451 "^": 52 /* CaretToken */, 7452 "!": 53 /* ExclamationToken */, 7453 "~": 54 /* TildeToken */, 7454 "&&": 55 /* AmpersandAmpersandToken */, 7455 "||": 56 /* BarBarToken */, 7456 "?": 57 /* QuestionToken */, 7457 "??": 60 /* QuestionQuestionToken */, 7458 "?.": 28 /* QuestionDotToken */, 7459 ":": 58 /* ColonToken */, 7460 "=": 63 /* EqualsToken */, 7461 "+=": 64 /* PlusEqualsToken */, 7462 "-=": 65 /* MinusEqualsToken */, 7463 "*=": 66 /* AsteriskEqualsToken */, 7464 "**=": 67 /* AsteriskAsteriskEqualsToken */, 7465 "/=": 68 /* SlashEqualsToken */, 7466 "%=": 69 /* PercentEqualsToken */, 7467 "<<=": 70 /* LessThanLessThanEqualsToken */, 7468 ">>=": 71 /* GreaterThanGreaterThanEqualsToken */, 7469 ">>>=": 72 /* GreaterThanGreaterThanGreaterThanEqualsToken */, 7470 "&=": 73 /* AmpersandEqualsToken */, 7471 "|=": 74 /* BarEqualsToken */, 7472 "^=": 78 /* CaretEqualsToken */, 7473 "||=": 75 /* BarBarEqualsToken */, 7474 "&&=": 76 /* AmpersandAmpersandEqualsToken */, 7475 "??=": 77 /* QuestionQuestionEqualsToken */, 7476 "@": 59 /* AtToken */, 7477 "#": 62 /* HashToken */, 7478 "`": 61 /* BacktickToken */ 7479})); 7480var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; 7481var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; 7482var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; 7483var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; 7484var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 895, 895, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1488, 1514, 1519, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2144, 2154, 2208, 2228, 2230, 2237, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2432, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2556, 2556, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2809, 2809, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3133, 3160, 3162, 3168, 3169, 3200, 3200, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3412, 3414, 3423, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6264, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6430, 6480, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7401, 7404, 7406, 7411, 7413, 7414, 7418, 7418, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12443, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42653, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43261, 43262, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43488, 43492, 43494, 43503, 43514, 43518, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43646, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66176, 66204, 66208, 66256, 66304, 66335, 66349, 66378, 66384, 66421, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68096, 68112, 68115, 68117, 68119, 68121, 68149, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68324, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68899, 69376, 69404, 69415, 69415, 69424, 69445, 69600, 69622, 69635, 69687, 69763, 69807, 69840, 69864, 69891, 69926, 69956, 69956, 69968, 70002, 70006, 70006, 70019, 70066, 70081, 70084, 70106, 70106, 70108, 70108, 70144, 70161, 70163, 70187, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70366, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70461, 70461, 70480, 70480, 70493, 70497, 70656, 70708, 70727, 70730, 70751, 70751, 70784, 70831, 70852, 70853, 70855, 70855, 71040, 71086, 71128, 71131, 71168, 71215, 71236, 71236, 71296, 71338, 71352, 71352, 71424, 71450, 71680, 71723, 71840, 71903, 71935, 71935, 72096, 72103, 72106, 72144, 72161, 72161, 72163, 72163, 72192, 72192, 72203, 72242, 72250, 72250, 72272, 72272, 72284, 72329, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72750, 72768, 72768, 72818, 72847, 72960, 72966, 72968, 72969, 72971, 73008, 73030, 73030, 73056, 73061, 73063, 73064, 73066, 73097, 73112, 73112, 73440, 73458, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92880, 92909, 92928, 92975, 92992, 92995, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94032, 94032, 94099, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 123136, 123180, 123191, 123197, 123214, 123214, 123584, 123627, 124928, 125124, 125184, 125251, 125259, 125259, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101]; 7485var unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999]; 7486var commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/; 7487var commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/; 7488function lookupInUnicodeMap(code, map2) { 7489 if (code < map2[0]) { 7490 return false; 7491 } 7492 let lo = 0; 7493 let hi = map2.length; 7494 let mid; 7495 while (lo + 1 < hi) { 7496 mid = lo + (hi - lo) / 2; 7497 mid -= mid % 2; 7498 if (map2[mid] <= code && code <= map2[mid + 1]) { 7499 return true; 7500 } 7501 if (code < map2[mid]) { 7502 hi = mid; 7503 } else { 7504 lo = mid + 2; 7505 } 7506 } 7507 return false; 7508} 7509function isUnicodeIdentifierStart(code, languageVersion) { 7510 return languageVersion >= 2 /* ES2015 */ ? lookupInUnicodeMap(code, unicodeESNextIdentifierStart) : languageVersion === 1 /* ES5 */ ? lookupInUnicodeMap(code, unicodeES5IdentifierStart) : lookupInUnicodeMap(code, unicodeES3IdentifierStart); 7511} 7512function isUnicodeIdentifierPart(code, languageVersion) { 7513 return languageVersion >= 2 /* ES2015 */ ? lookupInUnicodeMap(code, unicodeESNextIdentifierPart) : languageVersion === 1 /* ES5 */ ? lookupInUnicodeMap(code, unicodeES5IdentifierPart) : lookupInUnicodeMap(code, unicodeES3IdentifierPart); 7514} 7515function makeReverseMap(source) { 7516 const result = []; 7517 source.forEach((value, name) => { 7518 result[value] = name; 7519 }); 7520 return result; 7521} 7522var tokenStrings = makeReverseMap(textToToken); 7523function tokenToString(t) { 7524 return tokenStrings[t]; 7525} 7526function stringToToken(s) { 7527 return textToToken.get(s); 7528} 7529function computeLineStarts(text) { 7530 const result = []; 7531 let pos = 0; 7532 let lineStart = 0; 7533 while (pos < text.length) { 7534 const ch = text.charCodeAt(pos); 7535 pos++; 7536 switch (ch) { 7537 case 13 /* carriageReturn */: 7538 if (text.charCodeAt(pos) === 10 /* lineFeed */) { 7539 pos++; 7540 } 7541 case 10 /* lineFeed */: 7542 result.push(lineStart); 7543 lineStart = pos; 7544 break; 7545 default: 7546 if (ch > 127 /* maxAsciiCharacter */ && isLineBreak(ch)) { 7547 result.push(lineStart); 7548 lineStart = pos; 7549 } 7550 break; 7551 } 7552 } 7553 result.push(lineStart); 7554 return result; 7555} 7556function getLineStarts(sourceFile) { 7557 return sourceFile.lineMap || (sourceFile.lineMap = computeLineStarts(sourceFile.text)); 7558} 7559function computeLineAndCharacterOfPosition(lineStarts, position) { 7560 const lineNumber = computeLineOfPosition(lineStarts, position); 7561 return { 7562 line: lineNumber, 7563 character: position - lineStarts[lineNumber] 7564 }; 7565} 7566function computeLineOfPosition(lineStarts, position, lowerBound) { 7567 let lineNumber = binarySearch(lineStarts, position, identity, compareValues, lowerBound); 7568 if (lineNumber < 0) { 7569 lineNumber = ~lineNumber - 1; 7570 Debug.assert(lineNumber !== -1, "position cannot precede the beginning of the file"); 7571 } 7572 return lineNumber; 7573} 7574function getLinesBetweenPositions(sourceFile, pos1, pos2) { 7575 if (pos1 === pos2) 7576 return 0; 7577 const lineStarts = getLineStarts(sourceFile); 7578 const lower = Math.min(pos1, pos2); 7579 const isNegative = lower === pos2; 7580 const upper = isNegative ? pos1 : pos2; 7581 const lowerLine = computeLineOfPosition(lineStarts, lower); 7582 const upperLine = computeLineOfPosition(lineStarts, upper, lowerLine); 7583 return isNegative ? lowerLine - upperLine : upperLine - lowerLine; 7584} 7585function getLineAndCharacterOfPosition(sourceFile, position) { 7586 return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position); 7587} 7588function isWhiteSpaceLike(ch) { 7589 return isWhiteSpaceSingleLine(ch) || isLineBreak(ch); 7590} 7591function isWhiteSpaceSingleLine(ch) { 7592 return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ || ch === 160 /* nonBreakingSpace */ || ch === 133 /* nextLine */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */; 7593} 7594function isLineBreak(ch) { 7595 return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */; 7596} 7597function isDigit(ch) { 7598 return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; 7599} 7600function isHexDigit(ch) { 7601 return isDigit(ch) || ch >= 65 /* A */ && ch <= 70 /* F */ || ch >= 97 /* a */ && ch <= 102 /* f */; 7602} 7603function isCodePoint(code) { 7604 return code <= 1114111; 7605} 7606function isOctalDigit(ch) { 7607 return ch >= 48 /* _0 */ && ch <= 55 /* _7 */; 7608} 7609function skipTrivia(text, pos, stopAfterLineBreak, stopAtComments, inJSDoc) { 7610 if (positionIsSynthesized(pos)) { 7611 return pos; 7612 } 7613 let canConsumeStar = false; 7614 while (true) { 7615 const ch = text.charCodeAt(pos); 7616 switch (ch) { 7617 case 13 /* carriageReturn */: 7618 if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) { 7619 pos++; 7620 } 7621 case 10 /* lineFeed */: 7622 pos++; 7623 if (stopAfterLineBreak) { 7624 return pos; 7625 } 7626 canConsumeStar = !!inJSDoc; 7627 continue; 7628 case 9 /* tab */: 7629 case 11 /* verticalTab */: 7630 case 12 /* formFeed */: 7631 case 32 /* space */: 7632 pos++; 7633 continue; 7634 case 47 /* slash */: 7635 if (stopAtComments) { 7636 break; 7637 } 7638 if (text.charCodeAt(pos + 1) === 47 /* slash */) { 7639 pos += 2; 7640 while (pos < text.length) { 7641 if (isLineBreak(text.charCodeAt(pos))) { 7642 break; 7643 } 7644 pos++; 7645 } 7646 canConsumeStar = false; 7647 continue; 7648 } 7649 if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { 7650 pos += 2; 7651 while (pos < text.length) { 7652 if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { 7653 pos += 2; 7654 break; 7655 } 7656 pos++; 7657 } 7658 canConsumeStar = false; 7659 continue; 7660 } 7661 break; 7662 case 60 /* lessThan */: 7663 case 124 /* bar */: 7664 case 61 /* equals */: 7665 case 62 /* greaterThan */: 7666 if (isConflictMarkerTrivia(text, pos)) { 7667 pos = scanConflictMarkerTrivia(text, pos); 7668 canConsumeStar = false; 7669 continue; 7670 } 7671 break; 7672 case 35 /* hash */: 7673 if (pos === 0 && isShebangTrivia(text, pos)) { 7674 pos = scanShebangTrivia(text, pos); 7675 canConsumeStar = false; 7676 continue; 7677 } 7678 break; 7679 case 42 /* asterisk */: 7680 if (canConsumeStar) { 7681 pos++; 7682 canConsumeStar = false; 7683 continue; 7684 } 7685 break; 7686 default: 7687 if (ch > 127 /* maxAsciiCharacter */ && isWhiteSpaceLike(ch)) { 7688 pos++; 7689 continue; 7690 } 7691 break; 7692 } 7693 return pos; 7694 } 7695} 7696var mergeConflictMarkerLength = "<<<<<<<".length; 7697function isConflictMarkerTrivia(text, pos) { 7698 Debug.assert(pos >= 0); 7699 if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) { 7700 const ch = text.charCodeAt(pos); 7701 if (pos + mergeConflictMarkerLength < text.length) { 7702 for (let i = 0; i < mergeConflictMarkerLength; i++) { 7703 if (text.charCodeAt(pos + i) !== ch) { 7704 return false; 7705 } 7706 } 7707 return ch === 61 /* equals */ || text.charCodeAt(pos + mergeConflictMarkerLength) === 32 /* space */; 7708 } 7709 } 7710 return false; 7711} 7712function scanConflictMarkerTrivia(text, pos, error) { 7713 if (error) { 7714 error(Diagnostics.Merge_conflict_marker_encountered, pos, mergeConflictMarkerLength); 7715 } 7716 const ch = text.charCodeAt(pos); 7717 const len = text.length; 7718 if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { 7719 while (pos < len && !isLineBreak(text.charCodeAt(pos))) { 7720 pos++; 7721 } 7722 } else { 7723 Debug.assert(ch === 124 /* bar */ || ch === 61 /* equals */); 7724 while (pos < len) { 7725 const currentChar = text.charCodeAt(pos); 7726 if ((currentChar === 61 /* equals */ || currentChar === 62 /* greaterThan */) && currentChar !== ch && isConflictMarkerTrivia(text, pos)) { 7727 break; 7728 } 7729 pos++; 7730 } 7731 } 7732 return pos; 7733} 7734var shebangTriviaRegex = /^#!.*/; 7735function isShebangTrivia(text, pos) { 7736 Debug.assert(pos === 0); 7737 return shebangTriviaRegex.test(text); 7738} 7739function scanShebangTrivia(text, pos) { 7740 const shebang = shebangTriviaRegex.exec(text)[0]; 7741 pos = pos + shebang.length; 7742 return pos; 7743} 7744function iterateCommentRanges(reduce, text, pos, trailing, cb, state, initial) { 7745 let pendingPos; 7746 let pendingEnd; 7747 let pendingKind; 7748 let pendingHasTrailingNewLine; 7749 let hasPendingCommentRange = false; 7750 let collecting = trailing; 7751 let accumulator = initial; 7752 if (pos === 0) { 7753 collecting = true; 7754 const shebang = getShebang(text); 7755 if (shebang) { 7756 pos = shebang.length; 7757 } 7758 } 7759 scan: 7760 while (pos >= 0 && pos < text.length) { 7761 const ch = text.charCodeAt(pos); 7762 switch (ch) { 7763 case 13 /* carriageReturn */: 7764 if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) { 7765 pos++; 7766 } 7767 case 10 /* lineFeed */: 7768 pos++; 7769 if (trailing) { 7770 break scan; 7771 } 7772 collecting = true; 7773 if (hasPendingCommentRange) { 7774 pendingHasTrailingNewLine = true; 7775 } 7776 continue; 7777 case 9 /* tab */: 7778 case 11 /* verticalTab */: 7779 case 12 /* formFeed */: 7780 case 32 /* space */: 7781 pos++; 7782 continue; 7783 case 47 /* slash */: 7784 const nextChar = text.charCodeAt(pos + 1); 7785 let hasTrailingNewLine = false; 7786 if (nextChar === 47 /* slash */ || nextChar === 42 /* asterisk */) { 7787 const kind = nextChar === 47 /* slash */ ? 2 /* SingleLineCommentTrivia */ : 3 /* MultiLineCommentTrivia */; 7788 const startPos = pos; 7789 pos += 2; 7790 if (nextChar === 47 /* slash */) { 7791 while (pos < text.length) { 7792 if (isLineBreak(text.charCodeAt(pos))) { 7793 hasTrailingNewLine = true; 7794 break; 7795 } 7796 pos++; 7797 } 7798 } else { 7799 while (pos < text.length) { 7800 if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { 7801 pos += 2; 7802 break; 7803 } 7804 pos++; 7805 } 7806 } 7807 if (collecting) { 7808 if (hasPendingCommentRange) { 7809 accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator); 7810 if (!reduce && accumulator) { 7811 return accumulator; 7812 } 7813 } 7814 pendingPos = startPos; 7815 pendingEnd = pos; 7816 pendingKind = kind; 7817 pendingHasTrailingNewLine = hasTrailingNewLine; 7818 hasPendingCommentRange = true; 7819 } 7820 continue; 7821 } 7822 break scan; 7823 default: 7824 if (ch > 127 /* maxAsciiCharacter */ && isWhiteSpaceLike(ch)) { 7825 if (hasPendingCommentRange && isLineBreak(ch)) { 7826 pendingHasTrailingNewLine = true; 7827 } 7828 pos++; 7829 continue; 7830 } 7831 break scan; 7832 } 7833 } 7834 if (hasPendingCommentRange) { 7835 accumulator = cb(pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator); 7836 } 7837 return accumulator; 7838} 7839function forEachLeadingCommentRange(text, pos, cb, state) { 7840 return iterateCommentRanges(false, text, pos, false, cb, state); 7841} 7842function forEachTrailingCommentRange(text, pos, cb, state) { 7843 return iterateCommentRanges(false, text, pos, true, cb, state); 7844} 7845function reduceEachLeadingCommentRange(text, pos, cb, state, initial) { 7846 return iterateCommentRanges(true, text, pos, false, cb, state, initial); 7847} 7848function reduceEachTrailingCommentRange(text, pos, cb, state, initial) { 7849 return iterateCommentRanges(true, text, pos, true, cb, state, initial); 7850} 7851function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments) { 7852 if (!comments) { 7853 comments = []; 7854 } 7855 comments.push({ kind, pos, end, hasTrailingNewLine }); 7856 return comments; 7857} 7858function getLeadingCommentRanges(text, pos) { 7859 return reduceEachLeadingCommentRange(text, pos, appendCommentRange, void 0, void 0); 7860} 7861function getTrailingCommentRanges(text, pos) { 7862 return reduceEachTrailingCommentRange(text, pos, appendCommentRange, void 0, void 0); 7863} 7864function getShebang(text) { 7865 const match = shebangTriviaRegex.exec(text); 7866 if (match) { 7867 return match[0]; 7868 } 7869} 7870function isIdentifierStart(ch, languageVersion) { 7871 return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); 7872} 7873function isIdentifierPart(ch, languageVersion, identifierVariant) { 7874 return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || (identifierVariant === 1 /* JSX */ ? ch === 45 /* minus */ || ch === 58 /* colon */ : false) || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); 7875} 7876function isIdentifierText(name, languageVersion, identifierVariant) { 7877 let ch = codePointAt(name, 0); 7878 if (!isIdentifierStart(ch, languageVersion)) { 7879 return false; 7880 } 7881 for (let i = charSize(ch); i < name.length; i += charSize(ch)) { 7882 if (!isIdentifierPart(ch = codePointAt(name, i), languageVersion, identifierVariant)) { 7883 return false; 7884 } 7885 } 7886 return true; 7887} 7888function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Standard */, textInitial, onError, start, length2) { 7889 var text = textInitial; 7890 var pos; 7891 var end; 7892 var startPos; 7893 var tokenPos; 7894 var token; 7895 var tokenValue; 7896 var tokenFlags; 7897 var commentDirectives; 7898 var inJSDocType = 0; 7899 var inEtsContext = false; 7900 setText(text, start, length2); 7901 var scanner = { 7902 getStartPos: () => startPos, 7903 getTextPos: () => pos, 7904 getToken: () => token, 7905 getTokenPos: () => tokenPos, 7906 getTokenText: () => text.substring(tokenPos, pos), 7907 getTokenValue: () => tokenValue, 7908 hasUnicodeEscape: () => (tokenFlags & 1024 /* UnicodeEscape */) !== 0, 7909 hasExtendedUnicodeEscape: () => (tokenFlags & 8 /* ExtendedUnicodeEscape */) !== 0, 7910 hasPrecedingLineBreak: () => (tokenFlags & 1 /* PrecedingLineBreak */) !== 0, 7911 hasPrecedingJSDocComment: () => (tokenFlags & 2 /* PrecedingJSDocComment */) !== 0, 7912 isIdentifier: () => token === 79 /* Identifier */ || token > 117 /* LastReservedWord */, 7913 isReservedWord: () => token >= 81 /* FirstReservedWord */ && token <= 117 /* LastReservedWord */, 7914 isUnterminated: () => (tokenFlags & 4 /* Unterminated */) !== 0, 7915 getCommentDirectives: () => commentDirectives, 7916 getNumericLiteralFlags: () => tokenFlags & 1008 /* NumericLiteralFlags */, 7917 getTokenFlags: () => tokenFlags, 7918 reScanGreaterToken, 7919 reScanAsteriskEqualsToken, 7920 reScanSlashToken, 7921 reScanTemplateToken, 7922 reScanTemplateHeadOrNoSubstitutionTemplate, 7923 scanJsxIdentifier, 7924 scanJsxAttributeValue, 7925 reScanJsxAttributeValue, 7926 reScanJsxToken, 7927 reScanLessThanToken, 7928 reScanHashToken, 7929 reScanQuestionToken, 7930 reScanInvalidIdentifier, 7931 scanJsxToken, 7932 scanJsDocToken, 7933 scan, 7934 getText, 7935 clearCommentDirectives, 7936 setText, 7937 setScriptTarget, 7938 setLanguageVariant, 7939 setOnError, 7940 setTextPos, 7941 setInJSDocType, 7942 tryScan, 7943 lookAhead, 7944 scanRange, 7945 setEtsContext 7946 }; 7947 if (Debug.isDebugging) { 7948 Object.defineProperty(scanner, "__debugShowCurrentPositionInText", { 7949 get: () => { 7950 const text2 = scanner.getText(); 7951 return text2.slice(0, scanner.getStartPos()) + "\u2551" + text2.slice(scanner.getStartPos()); 7952 } 7953 }); 7954 } 7955 return scanner; 7956 function setEtsContext(isEtsContext) { 7957 inEtsContext = isEtsContext; 7958 } 7959 function error(message, errPos = pos, length3) { 7960 if (onError) { 7961 const oldPos = pos; 7962 pos = errPos; 7963 onError(message, length3 || 0); 7964 pos = oldPos; 7965 } 7966 } 7967 function scanNumberFragment() { 7968 let start2 = pos; 7969 let allowSeparator = false; 7970 let isPreviousTokenSeparator = false; 7971 let result = ""; 7972 while (true) { 7973 const ch = text.charCodeAt(pos); 7974 if (ch === 95 /* _ */) { 7975 tokenFlags |= 512 /* ContainsSeparator */; 7976 if (allowSeparator) { 7977 allowSeparator = false; 7978 isPreviousTokenSeparator = true; 7979 result += text.substring(start2, pos); 7980 } else if (isPreviousTokenSeparator) { 7981 error(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); 7982 } else { 7983 error(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); 7984 } 7985 pos++; 7986 start2 = pos; 7987 continue; 7988 } 7989 if (isDigit(ch)) { 7990 allowSeparator = true; 7991 isPreviousTokenSeparator = false; 7992 pos++; 7993 continue; 7994 } 7995 break; 7996 } 7997 if (text.charCodeAt(pos - 1) === 95 /* _ */) { 7998 error(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); 7999 } 8000 return result + text.substring(start2, pos); 8001 } 8002 function scanNumber() { 8003 const start2 = pos; 8004 const mainFragment = scanNumberFragment(); 8005 let decimalFragment; 8006 let scientificFragment; 8007 if (text.charCodeAt(pos) === 46 /* dot */) { 8008 pos++; 8009 decimalFragment = scanNumberFragment(); 8010 } 8011 let end2 = pos; 8012 if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { 8013 pos++; 8014 tokenFlags |= 16 /* Scientific */; 8015 if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) 8016 pos++; 8017 const preNumericPart = pos; 8018 const finalFragment = scanNumberFragment(); 8019 if (!finalFragment) { 8020 error(Diagnostics.Digit_expected); 8021 } else { 8022 scientificFragment = text.substring(end2, preNumericPart) + finalFragment; 8023 end2 = pos; 8024 } 8025 } 8026 let result; 8027 if (tokenFlags & 512 /* ContainsSeparator */) { 8028 result = mainFragment; 8029 if (decimalFragment) { 8030 result += "." + decimalFragment; 8031 } 8032 if (scientificFragment) { 8033 result += scientificFragment; 8034 } 8035 } else { 8036 result = text.substring(start2, end2); 8037 } 8038 if (decimalFragment !== void 0 || tokenFlags & 16 /* Scientific */) { 8039 checkForIdentifierStartAfterNumericLiteral(start2, decimalFragment === void 0 && !!(tokenFlags & 16 /* Scientific */)); 8040 return { 8041 type: 8 /* NumericLiteral */, 8042 value: "" + +result 8043 }; 8044 } else { 8045 tokenValue = result; 8046 const type = checkBigIntSuffix(); 8047 checkForIdentifierStartAfterNumericLiteral(start2); 8048 return { type, value: tokenValue }; 8049 } 8050 } 8051 function checkForIdentifierStartAfterNumericLiteral(numericStart, isScientific) { 8052 if (!isIdentifierStart(codePointAt(text, pos), languageVersion)) { 8053 return; 8054 } 8055 const identifierStart = pos; 8056 const { length: length3 } = scanIdentifierParts(); 8057 if (length3 === 1 && text[identifierStart] === "n") { 8058 if (isScientific) { 8059 error(Diagnostics.A_bigint_literal_cannot_use_exponential_notation, numericStart, identifierStart - numericStart + 1); 8060 } else { 8061 error(Diagnostics.A_bigint_literal_must_be_an_integer, numericStart, identifierStart - numericStart + 1); 8062 } 8063 } else { 8064 error(Diagnostics.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal, identifierStart, length3); 8065 pos = identifierStart; 8066 } 8067 } 8068 function scanOctalDigits() { 8069 const start2 = pos; 8070 while (isOctalDigit(text.charCodeAt(pos))) { 8071 pos++; 8072 } 8073 return +text.substring(start2, pos); 8074 } 8075 function scanExactNumberOfHexDigits(count, canHaveSeparators) { 8076 const valueString = scanHexDigits(count, false, canHaveSeparators); 8077 return valueString ? parseInt(valueString, 16) : -1; 8078 } 8079 function scanMinimumNumberOfHexDigits(count, canHaveSeparators) { 8080 return scanHexDigits(count, true, canHaveSeparators); 8081 } 8082 function scanHexDigits(minCount, scanAsManyAsPossible, canHaveSeparators) { 8083 let valueChars = []; 8084 let allowSeparator = false; 8085 let isPreviousTokenSeparator = false; 8086 while (valueChars.length < minCount || scanAsManyAsPossible) { 8087 let ch = text.charCodeAt(pos); 8088 if (canHaveSeparators && ch === 95 /* _ */) { 8089 tokenFlags |= 512 /* ContainsSeparator */; 8090 if (allowSeparator) { 8091 allowSeparator = false; 8092 isPreviousTokenSeparator = true; 8093 } else if (isPreviousTokenSeparator) { 8094 error(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); 8095 } else { 8096 error(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); 8097 } 8098 pos++; 8099 continue; 8100 } 8101 allowSeparator = canHaveSeparators; 8102 if (ch >= 65 /* A */ && ch <= 70 /* F */) { 8103 ch += 97 /* a */ - 65 /* A */; 8104 } else if (!(ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch >= 97 /* a */ && ch <= 102 /* f */)) { 8105 break; 8106 } 8107 valueChars.push(ch); 8108 pos++; 8109 isPreviousTokenSeparator = false; 8110 } 8111 if (valueChars.length < minCount) { 8112 valueChars = []; 8113 } 8114 if (text.charCodeAt(pos - 1) === 95 /* _ */) { 8115 error(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); 8116 } 8117 return String.fromCharCode(...valueChars); 8118 } 8119 function scanString(jsxAttributeString = false) { 8120 const quote = text.charCodeAt(pos); 8121 pos++; 8122 let result = ""; 8123 let start2 = pos; 8124 while (true) { 8125 if (pos >= end) { 8126 result += text.substring(start2, pos); 8127 tokenFlags |= 4 /* Unterminated */; 8128 error(Diagnostics.Unterminated_string_literal); 8129 break; 8130 } 8131 const ch = text.charCodeAt(pos); 8132 if (ch === quote) { 8133 result += text.substring(start2, pos); 8134 pos++; 8135 break; 8136 } 8137 if (ch === 92 /* backslash */ && !jsxAttributeString) { 8138 result += text.substring(start2, pos); 8139 result += scanEscapeSequence(); 8140 start2 = pos; 8141 continue; 8142 } 8143 if (isLineBreak(ch) && !jsxAttributeString) { 8144 result += text.substring(start2, pos); 8145 tokenFlags |= 4 /* Unterminated */; 8146 error(Diagnostics.Unterminated_string_literal); 8147 break; 8148 } 8149 pos++; 8150 } 8151 return result; 8152 } 8153 function scanTemplateAndSetTokenValue(isTaggedTemplate) { 8154 const startedWithBacktick = text.charCodeAt(pos) === 96 /* backtick */; 8155 pos++; 8156 let start2 = pos; 8157 let contents = ""; 8158 let resultingToken; 8159 while (true) { 8160 if (pos >= end) { 8161 contents += text.substring(start2, pos); 8162 tokenFlags |= 4 /* Unterminated */; 8163 error(Diagnostics.Unterminated_template_literal); 8164 resultingToken = startedWithBacktick ? 14 /* NoSubstitutionTemplateLiteral */ : 17 /* TemplateTail */; 8165 break; 8166 } 8167 const currChar = text.charCodeAt(pos); 8168 if (currChar === 96 /* backtick */) { 8169 contents += text.substring(start2, pos); 8170 pos++; 8171 resultingToken = startedWithBacktick ? 14 /* NoSubstitutionTemplateLiteral */ : 17 /* TemplateTail */; 8172 break; 8173 } 8174 if (currChar === 36 /* $ */ && pos + 1 < end && text.charCodeAt(pos + 1) === 123 /* openBrace */) { 8175 contents += text.substring(start2, pos); 8176 pos += 2; 8177 resultingToken = startedWithBacktick ? 15 /* TemplateHead */ : 16 /* TemplateMiddle */; 8178 break; 8179 } 8180 if (currChar === 92 /* backslash */) { 8181 contents += text.substring(start2, pos); 8182 contents += scanEscapeSequence(isTaggedTemplate); 8183 start2 = pos; 8184 continue; 8185 } 8186 if (currChar === 13 /* carriageReturn */) { 8187 contents += text.substring(start2, pos); 8188 pos++; 8189 if (pos < end && text.charCodeAt(pos) === 10 /* lineFeed */) { 8190 pos++; 8191 } 8192 contents += "\n"; 8193 start2 = pos; 8194 continue; 8195 } 8196 pos++; 8197 } 8198 Debug.assert(resultingToken !== void 0); 8199 tokenValue = contents; 8200 return resultingToken; 8201 } 8202 function scanEscapeSequence(isTaggedTemplate) { 8203 const start2 = pos; 8204 pos++; 8205 if (pos >= end) { 8206 error(Diagnostics.Unexpected_end_of_text); 8207 return ""; 8208 } 8209 const ch = text.charCodeAt(pos); 8210 pos++; 8211 switch (ch) { 8212 case 48 /* _0 */: 8213 if (isTaggedTemplate && pos < end && isDigit(text.charCodeAt(pos))) { 8214 pos++; 8215 tokenFlags |= 2048 /* ContainsInvalidEscape */; 8216 return text.substring(start2, pos); 8217 } 8218 return "\0"; 8219 case 98 /* b */: 8220 return "\b"; 8221 case 116 /* t */: 8222 return " "; 8223 case 110 /* n */: 8224 return "\n"; 8225 case 118 /* v */: 8226 return "\v"; 8227 case 102 /* f */: 8228 return "\f"; 8229 case 114 /* r */: 8230 return "\r"; 8231 case 39 /* singleQuote */: 8232 return "'"; 8233 case 34 /* doubleQuote */: 8234 return '"'; 8235 case 117 /* u */: 8236 if (isTaggedTemplate) { 8237 for (let escapePos = pos; escapePos < pos + 4; escapePos++) { 8238 if (escapePos < end && !isHexDigit(text.charCodeAt(escapePos)) && text.charCodeAt(escapePos) !== 123 /* openBrace */) { 8239 pos = escapePos; 8240 tokenFlags |= 2048 /* ContainsInvalidEscape */; 8241 return text.substring(start2, pos); 8242 } 8243 } 8244 } 8245 if (pos < end && text.charCodeAt(pos) === 123 /* openBrace */) { 8246 pos++; 8247 if (isTaggedTemplate && !isHexDigit(text.charCodeAt(pos))) { 8248 tokenFlags |= 2048 /* ContainsInvalidEscape */; 8249 return text.substring(start2, pos); 8250 } 8251 if (isTaggedTemplate) { 8252 const savePos = pos; 8253 const escapedValueString = scanMinimumNumberOfHexDigits(1, false); 8254 const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1; 8255 if (!isCodePoint(escapedValue) || text.charCodeAt(pos) !== 125 /* closeBrace */) { 8256 tokenFlags |= 2048 /* ContainsInvalidEscape */; 8257 return text.substring(start2, pos); 8258 } else { 8259 pos = savePos; 8260 } 8261 } 8262 tokenFlags |= 8 /* ExtendedUnicodeEscape */; 8263 return scanExtendedUnicodeEscape(); 8264 } 8265 tokenFlags |= 1024 /* UnicodeEscape */; 8266 return scanHexadecimalEscape(4); 8267 case 120 /* x */: 8268 if (isTaggedTemplate) { 8269 if (!isHexDigit(text.charCodeAt(pos))) { 8270 tokenFlags |= 2048 /* ContainsInvalidEscape */; 8271 return text.substring(start2, pos); 8272 } else if (!isHexDigit(text.charCodeAt(pos + 1))) { 8273 pos++; 8274 tokenFlags |= 2048 /* ContainsInvalidEscape */; 8275 return text.substring(start2, pos); 8276 } 8277 } 8278 return scanHexadecimalEscape(2); 8279 case 13 /* carriageReturn */: 8280 if (pos < end && text.charCodeAt(pos) === 10 /* lineFeed */) { 8281 pos++; 8282 } 8283 case 10 /* lineFeed */: 8284 case 8232 /* lineSeparator */: 8285 case 8233 /* paragraphSeparator */: 8286 return ""; 8287 default: 8288 return String.fromCharCode(ch); 8289 } 8290 } 8291 function scanHexadecimalEscape(numDigits) { 8292 const escapedValue = scanExactNumberOfHexDigits(numDigits, false); 8293 if (escapedValue >= 0) { 8294 return String.fromCharCode(escapedValue); 8295 } else { 8296 error(Diagnostics.Hexadecimal_digit_expected); 8297 return ""; 8298 } 8299 } 8300 function scanExtendedUnicodeEscape() { 8301 const escapedValueString = scanMinimumNumberOfHexDigits(1, false); 8302 const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1; 8303 let isInvalidExtendedEscape = false; 8304 if (escapedValue < 0) { 8305 error(Diagnostics.Hexadecimal_digit_expected); 8306 isInvalidExtendedEscape = true; 8307 } else if (escapedValue > 1114111) { 8308 error(Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive); 8309 isInvalidExtendedEscape = true; 8310 } 8311 if (pos >= end) { 8312 error(Diagnostics.Unexpected_end_of_text); 8313 isInvalidExtendedEscape = true; 8314 } else if (text.charCodeAt(pos) === 125 /* closeBrace */) { 8315 pos++; 8316 } else { 8317 error(Diagnostics.Unterminated_Unicode_escape_sequence); 8318 isInvalidExtendedEscape = true; 8319 } 8320 if (isInvalidExtendedEscape) { 8321 return ""; 8322 } 8323 return utf16EncodeAsString(escapedValue); 8324 } 8325 function peekUnicodeEscape() { 8326 if (pos + 5 < end && text.charCodeAt(pos + 1) === 117 /* u */) { 8327 const start2 = pos; 8328 pos += 2; 8329 const value = scanExactNumberOfHexDigits(4, false); 8330 pos = start2; 8331 return value; 8332 } 8333 return -1; 8334 } 8335 function peekExtendedUnicodeEscape() { 8336 if (codePointAt(text, pos + 1) === 117 /* u */ && codePointAt(text, pos + 2) === 123 /* openBrace */) { 8337 const start2 = pos; 8338 pos += 3; 8339 const escapedValueString = scanMinimumNumberOfHexDigits(1, false); 8340 const escapedValue = escapedValueString ? parseInt(escapedValueString, 16) : -1; 8341 pos = start2; 8342 return escapedValue; 8343 } 8344 return -1; 8345 } 8346 function scanIdentifierParts() { 8347 let result = ""; 8348 let start2 = pos; 8349 while (pos < end) { 8350 let ch = codePointAt(text, pos); 8351 if (isIdentifierPart(ch, languageVersion)) { 8352 pos += charSize(ch); 8353 } else if (ch === 92 /* backslash */) { 8354 ch = peekExtendedUnicodeEscape(); 8355 if (ch >= 0 && isIdentifierPart(ch, languageVersion)) { 8356 pos += 3; 8357 tokenFlags |= 8 /* ExtendedUnicodeEscape */; 8358 result += scanExtendedUnicodeEscape(); 8359 start2 = pos; 8360 continue; 8361 } 8362 ch = peekUnicodeEscape(); 8363 if (!(ch >= 0 && isIdentifierPart(ch, languageVersion))) { 8364 break; 8365 } 8366 tokenFlags |= 1024 /* UnicodeEscape */; 8367 result += text.substring(start2, pos); 8368 result += utf16EncodeAsString(ch); 8369 pos += 6; 8370 start2 = pos; 8371 } else { 8372 break; 8373 } 8374 } 8375 result += text.substring(start2, pos); 8376 return result; 8377 } 8378 function getIdentifierToken() { 8379 const len = tokenValue.length; 8380 if (len >= 2 && len <= 12) { 8381 const ch = tokenValue.charCodeAt(0); 8382 if (ch >= 97 /* a */ && ch <= 122 /* z */) { 8383 const keyword = textToKeyword.get(tokenValue); 8384 if (keyword !== void 0) { 8385 token = keyword; 8386 if (keyword === 85 /* StructKeyword */ && !inEtsContext) { 8387 token = 79 /* Identifier */; 8388 } 8389 return token; 8390 } 8391 } 8392 } 8393 return token = 79 /* Identifier */; 8394 } 8395 function scanBinaryOrOctalDigits(base) { 8396 let value = ""; 8397 let separatorAllowed = false; 8398 let isPreviousTokenSeparator = false; 8399 while (true) { 8400 const ch = text.charCodeAt(pos); 8401 if (ch === 95 /* _ */) { 8402 tokenFlags |= 512 /* ContainsSeparator */; 8403 if (separatorAllowed) { 8404 separatorAllowed = false; 8405 isPreviousTokenSeparator = true; 8406 } else if (isPreviousTokenSeparator) { 8407 error(Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); 8408 } else { 8409 error(Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); 8410 } 8411 pos++; 8412 continue; 8413 } 8414 separatorAllowed = true; 8415 if (!isDigit(ch) || ch - 48 /* _0 */ >= base) { 8416 break; 8417 } 8418 value += text[pos]; 8419 pos++; 8420 isPreviousTokenSeparator = false; 8421 } 8422 if (text.charCodeAt(pos - 1) === 95 /* _ */) { 8423 error(Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); 8424 } 8425 return value; 8426 } 8427 function checkBigIntSuffix() { 8428 if (text.charCodeAt(pos) === 110 /* n */) { 8429 tokenValue += "n"; 8430 if (tokenFlags & 384 /* BinaryOrOctalSpecifier */) { 8431 tokenValue = parsePseudoBigInt(tokenValue) + "n"; 8432 } 8433 pos++; 8434 return 9 /* BigIntLiteral */; 8435 } else { 8436 const numericValue = tokenFlags & 128 /* BinarySpecifier */ ? parseInt(tokenValue.slice(2), 2) : tokenFlags & 256 /* OctalSpecifier */ ? parseInt(tokenValue.slice(2), 8) : +tokenValue; 8437 tokenValue = "" + numericValue; 8438 return 8 /* NumericLiteral */; 8439 } 8440 } 8441 function scan() { 8442 startPos = pos; 8443 tokenFlags = 0 /* None */; 8444 let asteriskSeen = false; 8445 while (true) { 8446 tokenPos = pos; 8447 if (pos >= end) { 8448 return token = 1 /* EndOfFileToken */; 8449 } 8450 const ch = codePointAt(text, pos); 8451 if (ch === 35 /* hash */ && pos === 0 && isShebangTrivia(text, pos)) { 8452 pos = scanShebangTrivia(text, pos); 8453 if (skipTrivia2) { 8454 continue; 8455 } else { 8456 return token = 6 /* ShebangTrivia */; 8457 } 8458 } 8459 switch (ch) { 8460 case 10 /* lineFeed */: 8461 case 13 /* carriageReturn */: 8462 tokenFlags |= 1 /* PrecedingLineBreak */; 8463 if (skipTrivia2) { 8464 pos++; 8465 continue; 8466 } else { 8467 if (ch === 13 /* carriageReturn */ && pos + 1 < end && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { 8468 pos += 2; 8469 } else { 8470 pos++; 8471 } 8472 return token = 4 /* NewLineTrivia */; 8473 } 8474 case 9 /* tab */: 8475 case 11 /* verticalTab */: 8476 case 12 /* formFeed */: 8477 case 32 /* space */: 8478 case 160 /* nonBreakingSpace */: 8479 case 5760 /* ogham */: 8480 case 8192 /* enQuad */: 8481 case 8193 /* emQuad */: 8482 case 8194 /* enSpace */: 8483 case 8195 /* emSpace */: 8484 case 8196 /* threePerEmSpace */: 8485 case 8197 /* fourPerEmSpace */: 8486 case 8198 /* sixPerEmSpace */: 8487 case 8199 /* figureSpace */: 8488 case 8200 /* punctuationSpace */: 8489 case 8201 /* thinSpace */: 8490 case 8202 /* hairSpace */: 8491 case 8203 /* zeroWidthSpace */: 8492 case 8239 /* narrowNoBreakSpace */: 8493 case 8287 /* mathematicalSpace */: 8494 case 12288 /* ideographicSpace */: 8495 case 65279 /* byteOrderMark */: 8496 if (skipTrivia2) { 8497 pos++; 8498 continue; 8499 } else { 8500 while (pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos))) { 8501 pos++; 8502 } 8503 return token = 5 /* WhitespaceTrivia */; 8504 } 8505 case 33 /* exclamation */: 8506 if (text.charCodeAt(pos + 1) === 61 /* equals */) { 8507 if (text.charCodeAt(pos + 2) === 61 /* equals */) { 8508 return pos += 3, token = 37 /* ExclamationEqualsEqualsToken */; 8509 } 8510 return pos += 2, token = 35 /* ExclamationEqualsToken */; 8511 } 8512 pos++; 8513 return token = 53 /* ExclamationToken */; 8514 case 34 /* doubleQuote */: 8515 case 39 /* singleQuote */: 8516 tokenValue = scanString(); 8517 return token = 10 /* StringLiteral */; 8518 case 96 /* backtick */: 8519 return token = scanTemplateAndSetTokenValue(false); 8520 case 37 /* percent */: 8521 if (text.charCodeAt(pos + 1) === 61 /* equals */) { 8522 return pos += 2, token = 69 /* PercentEqualsToken */; 8523 } 8524 pos++; 8525 return token = 44 /* PercentToken */; 8526 case 38 /* ampersand */: 8527 if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { 8528 if (text.charCodeAt(pos + 2) === 61 /* equals */) { 8529 return pos += 3, token = 76 /* AmpersandAmpersandEqualsToken */; 8530 } 8531 return pos += 2, token = 55 /* AmpersandAmpersandToken */; 8532 } 8533 if (text.charCodeAt(pos + 1) === 61 /* equals */) { 8534 return pos += 2, token = 73 /* AmpersandEqualsToken */; 8535 } 8536 pos++; 8537 return token = 50 /* AmpersandToken */; 8538 case 40 /* openParen */: 8539 pos++; 8540 return token = 20 /* OpenParenToken */; 8541 case 41 /* closeParen */: 8542 pos++; 8543 return token = 21 /* CloseParenToken */; 8544 case 42 /* asterisk */: 8545 if (text.charCodeAt(pos + 1) === 61 /* equals */) { 8546 return pos += 2, token = 66 /* AsteriskEqualsToken */; 8547 } 8548 if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { 8549 if (text.charCodeAt(pos + 2) === 61 /* equals */) { 8550 return pos += 3, token = 67 /* AsteriskAsteriskEqualsToken */; 8551 } 8552 return pos += 2, token = 42 /* AsteriskAsteriskToken */; 8553 } 8554 pos++; 8555 if (inJSDocType && !asteriskSeen && tokenFlags & 1 /* PrecedingLineBreak */) { 8556 asteriskSeen = true; 8557 continue; 8558 } 8559 return token = 41 /* AsteriskToken */; 8560 case 43 /* plus */: 8561 if (text.charCodeAt(pos + 1) === 43 /* plus */) { 8562 return pos += 2, token = 45 /* PlusPlusToken */; 8563 } 8564 if (text.charCodeAt(pos + 1) === 61 /* equals */) { 8565 return pos += 2, token = 64 /* PlusEqualsToken */; 8566 } 8567 pos++; 8568 return token = 39 /* PlusToken */; 8569 case 44 /* comma */: 8570 pos++; 8571 return token = 27 /* CommaToken */; 8572 case 45 /* minus */: 8573 if (text.charCodeAt(pos + 1) === 45 /* minus */) { 8574 return pos += 2, token = 46 /* MinusMinusToken */; 8575 } 8576 if (text.charCodeAt(pos + 1) === 61 /* equals */) { 8577 return pos += 2, token = 65 /* MinusEqualsToken */; 8578 } 8579 pos++; 8580 return token = 40 /* MinusToken */; 8581 case 46 /* dot */: 8582 if (isDigit(text.charCodeAt(pos + 1))) { 8583 tokenValue = scanNumber().value; 8584 return token = 8 /* NumericLiteral */; 8585 } 8586 if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { 8587 return pos += 3, token = 25 /* DotDotDotToken */; 8588 } 8589 pos++; 8590 return token = 24 /* DotToken */; 8591 case 47 /* slash */: 8592 if (text.charCodeAt(pos + 1) === 47 /* slash */) { 8593 pos += 2; 8594 while (pos < end) { 8595 if (isLineBreak(text.charCodeAt(pos))) { 8596 break; 8597 } 8598 pos++; 8599 } 8600 commentDirectives = appendIfCommentDirective( 8601 commentDirectives, 8602 text.slice(tokenPos, pos), 8603 commentDirectiveRegExSingleLine, 8604 tokenPos 8605 ); 8606 if (skipTrivia2) { 8607 continue; 8608 } else { 8609 return token = 2 /* SingleLineCommentTrivia */; 8610 } 8611 } 8612 if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { 8613 pos += 2; 8614 if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) !== 47 /* slash */) { 8615 tokenFlags |= 2 /* PrecedingJSDocComment */; 8616 } 8617 let commentClosed = false; 8618 let lastLineStart = tokenPos; 8619 while (pos < end) { 8620 const ch2 = text.charCodeAt(pos); 8621 if (ch2 === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { 8622 pos += 2; 8623 commentClosed = true; 8624 break; 8625 } 8626 pos++; 8627 if (isLineBreak(ch2)) { 8628 lastLineStart = pos; 8629 tokenFlags |= 1 /* PrecedingLineBreak */; 8630 } 8631 } 8632 commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart); 8633 if (!commentClosed) { 8634 error(Diagnostics.Asterisk_Slash_expected); 8635 } 8636 if (skipTrivia2) { 8637 continue; 8638 } else { 8639 if (!commentClosed) { 8640 tokenFlags |= 4 /* Unterminated */; 8641 } 8642 return token = 3 /* MultiLineCommentTrivia */; 8643 } 8644 } 8645 if (text.charCodeAt(pos + 1) === 61 /* equals */) { 8646 return pos += 2, token = 68 /* SlashEqualsToken */; 8647 } 8648 pos++; 8649 return token = 43 /* SlashToken */; 8650 case 48 /* _0 */: 8651 if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { 8652 pos += 2; 8653 tokenValue = scanMinimumNumberOfHexDigits(1, true); 8654 if (!tokenValue) { 8655 error(Diagnostics.Hexadecimal_digit_expected); 8656 tokenValue = "0"; 8657 } 8658 tokenValue = "0x" + tokenValue; 8659 tokenFlags |= 64 /* HexSpecifier */; 8660 return token = checkBigIntSuffix(); 8661 } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 /* B */ || text.charCodeAt(pos + 1) === 98 /* b */)) { 8662 pos += 2; 8663 tokenValue = scanBinaryOrOctalDigits(2); 8664 if (!tokenValue) { 8665 error(Diagnostics.Binary_digit_expected); 8666 tokenValue = "0"; 8667 } 8668 tokenValue = "0b" + tokenValue; 8669 tokenFlags |= 128 /* BinarySpecifier */; 8670 return token = checkBigIntSuffix(); 8671 } else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 /* O */ || text.charCodeAt(pos + 1) === 111 /* o */)) { 8672 pos += 2; 8673 tokenValue = scanBinaryOrOctalDigits(8); 8674 if (!tokenValue) { 8675 error(Diagnostics.Octal_digit_expected); 8676 tokenValue = "0"; 8677 } 8678 tokenValue = "0o" + tokenValue; 8679 tokenFlags |= 256 /* OctalSpecifier */; 8680 return token = checkBigIntSuffix(); 8681 } 8682 if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) { 8683 tokenValue = "" + scanOctalDigits(); 8684 tokenFlags |= 32 /* Octal */; 8685 return token = 8 /* NumericLiteral */; 8686 } 8687 case 49 /* _1 */: 8688 case 50 /* _2 */: 8689 case 51 /* _3 */: 8690 case 52 /* _4 */: 8691 case 53 /* _5 */: 8692 case 54 /* _6 */: 8693 case 55 /* _7 */: 8694 case 56 /* _8 */: 8695 case 57 /* _9 */: 8696 ({ type: token, value: tokenValue } = scanNumber()); 8697 return token; 8698 case 58 /* colon */: 8699 pos++; 8700 return token = 58 /* ColonToken */; 8701 case 59 /* semicolon */: 8702 pos++; 8703 return token = 26 /* SemicolonToken */; 8704 case 60 /* lessThan */: 8705 if (isConflictMarkerTrivia(text, pos)) { 8706 pos = scanConflictMarkerTrivia(text, pos, error); 8707 if (skipTrivia2) { 8708 continue; 8709 } else { 8710 return token = 7 /* ConflictMarkerTrivia */; 8711 } 8712 } 8713 if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { 8714 if (text.charCodeAt(pos + 2) === 61 /* equals */) { 8715 return pos += 3, token = 70 /* LessThanLessThanEqualsToken */; 8716 } 8717 return pos += 2, token = 47 /* LessThanLessThanToken */; 8718 } 8719 if (text.charCodeAt(pos + 1) === 61 /* equals */) { 8720 return pos += 2, token = 32 /* LessThanEqualsToken */; 8721 } 8722 if (languageVariant === 1 /* JSX */ && text.charCodeAt(pos + 1) === 47 /* slash */ && text.charCodeAt(pos + 2) !== 42 /* asterisk */) { 8723 return pos += 2, token = 30 /* LessThanSlashToken */; 8724 } 8725 pos++; 8726 return token = 29 /* LessThanToken */; 8727 case 61 /* equals */: 8728 if (isConflictMarkerTrivia(text, pos)) { 8729 pos = scanConflictMarkerTrivia(text, pos, error); 8730 if (skipTrivia2) { 8731 continue; 8732 } else { 8733 return token = 7 /* ConflictMarkerTrivia */; 8734 } 8735 } 8736 if (text.charCodeAt(pos + 1) === 61 /* equals */) { 8737 if (text.charCodeAt(pos + 2) === 61 /* equals */) { 8738 return pos += 3, token = 36 /* EqualsEqualsEqualsToken */; 8739 } 8740 return pos += 2, token = 34 /* EqualsEqualsToken */; 8741 } 8742 if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { 8743 return pos += 2, token = 38 /* EqualsGreaterThanToken */; 8744 } 8745 pos++; 8746 return token = 63 /* EqualsToken */; 8747 case 62 /* greaterThan */: 8748 if (isConflictMarkerTrivia(text, pos)) { 8749 pos = scanConflictMarkerTrivia(text, pos, error); 8750 if (skipTrivia2) { 8751 continue; 8752 } else { 8753 return token = 7 /* ConflictMarkerTrivia */; 8754 } 8755 } 8756 pos++; 8757 return token = 31 /* GreaterThanToken */; 8758 case 63 /* question */: 8759 if (text.charCodeAt(pos + 1) === 46 /* dot */ && !isDigit(text.charCodeAt(pos + 2))) { 8760 return pos += 2, token = 28 /* QuestionDotToken */; 8761 } 8762 if (text.charCodeAt(pos + 1) === 63 /* question */) { 8763 if (text.charCodeAt(pos + 2) === 61 /* equals */) { 8764 return pos += 3, token = 77 /* QuestionQuestionEqualsToken */; 8765 } 8766 return pos += 2, token = 60 /* QuestionQuestionToken */; 8767 } 8768 pos++; 8769 return token = 57 /* QuestionToken */; 8770 case 91 /* openBracket */: 8771 pos++; 8772 return token = 22 /* OpenBracketToken */; 8773 case 93 /* closeBracket */: 8774 pos++; 8775 return token = 23 /* CloseBracketToken */; 8776 case 94 /* caret */: 8777 if (text.charCodeAt(pos + 1) === 61 /* equals */) { 8778 return pos += 2, token = 78 /* CaretEqualsToken */; 8779 } 8780 pos++; 8781 return token = 52 /* CaretToken */; 8782 case 123 /* openBrace */: 8783 pos++; 8784 return token = 18 /* OpenBraceToken */; 8785 case 124 /* bar */: 8786 if (isConflictMarkerTrivia(text, pos)) { 8787 pos = scanConflictMarkerTrivia(text, pos, error); 8788 if (skipTrivia2) { 8789 continue; 8790 } else { 8791 return token = 7 /* ConflictMarkerTrivia */; 8792 } 8793 } 8794 if (text.charCodeAt(pos + 1) === 124 /* bar */) { 8795 if (text.charCodeAt(pos + 2) === 61 /* equals */) { 8796 return pos += 3, token = 75 /* BarBarEqualsToken */; 8797 } 8798 return pos += 2, token = 56 /* BarBarToken */; 8799 } 8800 if (text.charCodeAt(pos + 1) === 61 /* equals */) { 8801 return pos += 2, token = 74 /* BarEqualsToken */; 8802 } 8803 pos++; 8804 return token = 51 /* BarToken */; 8805 case 125 /* closeBrace */: 8806 pos++; 8807 return token = 19 /* CloseBraceToken */; 8808 case 126 /* tilde */: 8809 pos++; 8810 return token = 54 /* TildeToken */; 8811 case 64 /* at */: 8812 pos++; 8813 return token = 59 /* AtToken */; 8814 case 92 /* backslash */: 8815 const extendedCookedChar = peekExtendedUnicodeEscape(); 8816 if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) { 8817 pos += 3; 8818 tokenFlags |= 8 /* ExtendedUnicodeEscape */; 8819 tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts(); 8820 return token = getIdentifierToken(); 8821 } 8822 const cookedChar = peekUnicodeEscape(); 8823 if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) { 8824 pos += 6; 8825 tokenFlags |= 1024 /* UnicodeEscape */; 8826 tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts(); 8827 return token = getIdentifierToken(); 8828 } 8829 error(Diagnostics.Invalid_character); 8830 pos++; 8831 return token = 0 /* Unknown */; 8832 case 35 /* hash */: 8833 if (pos !== 0 && text[pos + 1] === "!") { 8834 error(Diagnostics.can_only_be_used_at_the_start_of_a_file); 8835 pos++; 8836 return token = 0 /* Unknown */; 8837 } 8838 const charAfterHash = codePointAt(text, pos + 1); 8839 if (charAfterHash === 92 /* backslash */) { 8840 pos++; 8841 const extendedCookedChar2 = peekExtendedUnicodeEscape(); 8842 if (extendedCookedChar2 >= 0 && isIdentifierStart(extendedCookedChar2, languageVersion)) { 8843 pos += 3; 8844 tokenFlags |= 8 /* ExtendedUnicodeEscape */; 8845 tokenValue = "#" + scanExtendedUnicodeEscape() + scanIdentifierParts(); 8846 return token = 80 /* PrivateIdentifier */; 8847 } 8848 const cookedChar2 = peekUnicodeEscape(); 8849 if (cookedChar2 >= 0 && isIdentifierStart(cookedChar2, languageVersion)) { 8850 pos += 6; 8851 tokenFlags |= 1024 /* UnicodeEscape */; 8852 tokenValue = "#" + String.fromCharCode(cookedChar2) + scanIdentifierParts(); 8853 return token = 80 /* PrivateIdentifier */; 8854 } 8855 pos--; 8856 } 8857 if (isIdentifierStart(charAfterHash, languageVersion)) { 8858 pos++; 8859 scanIdentifier(charAfterHash, languageVersion); 8860 } else { 8861 tokenValue = "#"; 8862 error(Diagnostics.Invalid_character, pos++, charSize(ch)); 8863 } 8864 return token = 80 /* PrivateIdentifier */; 8865 default: 8866 const identifierKind = scanIdentifier(ch, languageVersion); 8867 if (identifierKind) { 8868 return token = identifierKind; 8869 } else if (isWhiteSpaceSingleLine(ch)) { 8870 pos += charSize(ch); 8871 continue; 8872 } else if (isLineBreak(ch)) { 8873 tokenFlags |= 1 /* PrecedingLineBreak */; 8874 pos += charSize(ch); 8875 continue; 8876 } 8877 const size = charSize(ch); 8878 error(Diagnostics.Invalid_character, pos, size); 8879 pos += size; 8880 return token = 0 /* Unknown */; 8881 } 8882 } 8883 } 8884 function reScanInvalidIdentifier() { 8885 Debug.assert(token === 0 /* Unknown */, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'."); 8886 pos = tokenPos = startPos; 8887 tokenFlags = 0; 8888 const ch = codePointAt(text, pos); 8889 const identifierKind = scanIdentifier(ch, 99 /* ESNext */); 8890 if (identifierKind) { 8891 return token = identifierKind; 8892 } 8893 pos += charSize(ch); 8894 return token; 8895 } 8896 function scanIdentifier(startCharacter, languageVersion2) { 8897 let ch = startCharacter; 8898 if (isIdentifierStart(ch, languageVersion2)) { 8899 pos += charSize(ch); 8900 while (pos < end && isIdentifierPart(ch = codePointAt(text, pos), languageVersion2)) 8901 pos += charSize(ch); 8902 tokenValue = text.substring(tokenPos, pos); 8903 if (ch === 92 /* backslash */) { 8904 tokenValue += scanIdentifierParts(); 8905 } 8906 return getIdentifierToken(); 8907 } 8908 } 8909 function reScanGreaterToken() { 8910 if (token === 31 /* GreaterThanToken */) { 8911 if (text.charCodeAt(pos) === 62 /* greaterThan */) { 8912 if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { 8913 if (text.charCodeAt(pos + 2) === 61 /* equals */) { 8914 return pos += 3, token = 72 /* GreaterThanGreaterThanGreaterThanEqualsToken */; 8915 } 8916 return pos += 2, token = 49 /* GreaterThanGreaterThanGreaterThanToken */; 8917 } 8918 if (text.charCodeAt(pos + 1) === 61 /* equals */) { 8919 return pos += 2, token = 71 /* GreaterThanGreaterThanEqualsToken */; 8920 } 8921 pos++; 8922 return token = 48 /* GreaterThanGreaterThanToken */; 8923 } 8924 if (text.charCodeAt(pos) === 61 /* equals */) { 8925 pos++; 8926 return token = 33 /* GreaterThanEqualsToken */; 8927 } 8928 } 8929 return token; 8930 } 8931 function reScanAsteriskEqualsToken() { 8932 Debug.assert(token === 66 /* AsteriskEqualsToken */, "'reScanAsteriskEqualsToken' should only be called on a '*='"); 8933 pos = tokenPos + 1; 8934 return token = 63 /* EqualsToken */; 8935 } 8936 function reScanSlashToken() { 8937 if (token === 43 /* SlashToken */ || token === 68 /* SlashEqualsToken */) { 8938 let p = tokenPos + 1; 8939 let inEscape = false; 8940 let inCharacterClass = false; 8941 while (true) { 8942 if (p >= end) { 8943 tokenFlags |= 4 /* Unterminated */; 8944 error(Diagnostics.Unterminated_regular_expression_literal); 8945 break; 8946 } 8947 const ch = text.charCodeAt(p); 8948 if (isLineBreak(ch)) { 8949 tokenFlags |= 4 /* Unterminated */; 8950 error(Diagnostics.Unterminated_regular_expression_literal); 8951 break; 8952 } 8953 if (inEscape) { 8954 inEscape = false; 8955 } else if (ch === 47 /* slash */ && !inCharacterClass) { 8956 p++; 8957 break; 8958 } else if (ch === 91 /* openBracket */) { 8959 inCharacterClass = true; 8960 } else if (ch === 92 /* backslash */) { 8961 inEscape = true; 8962 } else if (ch === 93 /* closeBracket */) { 8963 inCharacterClass = false; 8964 } 8965 p++; 8966 } 8967 while (p < end && isIdentifierPart(text.charCodeAt(p), languageVersion)) { 8968 p++; 8969 } 8970 pos = p; 8971 tokenValue = text.substring(tokenPos, pos); 8972 token = 13 /* RegularExpressionLiteral */; 8973 } 8974 return token; 8975 } 8976 function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) { 8977 const type = getDirectiveFromComment(trimStringStart(text2), commentDirectiveRegEx); 8978 if (type === void 0) { 8979 return commentDirectives2; 8980 } 8981 return append( 8982 commentDirectives2, 8983 { 8984 range: { pos: lineStart, end: pos }, 8985 type 8986 } 8987 ); 8988 } 8989 function getDirectiveFromComment(text2, commentDirectiveRegEx) { 8990 const match = commentDirectiveRegEx.exec(text2); 8991 if (!match) { 8992 return void 0; 8993 } 8994 switch (match[1]) { 8995 case "ts-expect-error": 8996 return 0 /* ExpectError */; 8997 case "ts-ignore": 8998 return 1 /* Ignore */; 8999 } 9000 return void 0; 9001 } 9002 function reScanTemplateToken(isTaggedTemplate) { 9003 Debug.assert(token === 19 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'"); 9004 pos = tokenPos; 9005 return token = scanTemplateAndSetTokenValue(isTaggedTemplate); 9006 } 9007 function reScanTemplateHeadOrNoSubstitutionTemplate() { 9008 pos = tokenPos; 9009 return token = scanTemplateAndSetTokenValue(true); 9010 } 9011 function reScanJsxToken(allowMultilineJsxText = true) { 9012 pos = tokenPos = startPos; 9013 return token = scanJsxToken(allowMultilineJsxText); 9014 } 9015 function reScanLessThanToken() { 9016 if (token === 47 /* LessThanLessThanToken */) { 9017 pos = tokenPos + 1; 9018 return token = 29 /* LessThanToken */; 9019 } 9020 return token; 9021 } 9022 function reScanHashToken() { 9023 if (token === 80 /* PrivateIdentifier */) { 9024 pos = tokenPos + 1; 9025 return token = 62 /* HashToken */; 9026 } 9027 return token; 9028 } 9029 function reScanQuestionToken() { 9030 Debug.assert(token === 60 /* QuestionQuestionToken */, "'reScanQuestionToken' should only be called on a '??'"); 9031 pos = tokenPos + 1; 9032 return token = 57 /* QuestionToken */; 9033 } 9034 function scanJsxToken(allowMultilineJsxText = true) { 9035 startPos = tokenPos = pos; 9036 if (pos >= end) { 9037 return token = 1 /* EndOfFileToken */; 9038 } 9039 let char = text.charCodeAt(pos); 9040 if (char === 60 /* lessThan */) { 9041 if (text.charCodeAt(pos + 1) === 47 /* slash */) { 9042 pos += 2; 9043 return token = 30 /* LessThanSlashToken */; 9044 } 9045 pos++; 9046 return token = 29 /* LessThanToken */; 9047 } 9048 if (char === 123 /* openBrace */) { 9049 pos++; 9050 return token = 18 /* OpenBraceToken */; 9051 } 9052 let firstNonWhitespace = 0; 9053 while (pos < end) { 9054 char = text.charCodeAt(pos); 9055 if (char === 123 /* openBrace */) { 9056 break; 9057 } 9058 if (char === 60 /* lessThan */) { 9059 if (isConflictMarkerTrivia(text, pos)) { 9060 pos = scanConflictMarkerTrivia(text, pos, error); 9061 return token = 7 /* ConflictMarkerTrivia */; 9062 } 9063 break; 9064 } 9065 if (char === 62 /* greaterThan */) { 9066 error(Diagnostics.Unexpected_token_Did_you_mean_or_gt, pos, 1); 9067 } 9068 if (char === 125 /* closeBrace */) { 9069 error(Diagnostics.Unexpected_token_Did_you_mean_or_rbrace, pos, 1); 9070 } 9071 if (isLineBreak(char) && firstNonWhitespace === 0) { 9072 firstNonWhitespace = -1; 9073 } else if (!allowMultilineJsxText && isLineBreak(char) && firstNonWhitespace > 0) { 9074 break; 9075 } else if (!isWhiteSpaceLike(char)) { 9076 firstNonWhitespace = pos; 9077 } 9078 pos++; 9079 } 9080 tokenValue = text.substring(startPos, pos); 9081 return firstNonWhitespace === -1 ? 12 /* JsxTextAllWhiteSpaces */ : 11 /* JsxText */; 9082 } 9083 function scanJsxIdentifier() { 9084 if (tokenIsIdentifierOrKeyword(token)) { 9085 let namespaceSeparator = false; 9086 while (pos < end) { 9087 const ch = text.charCodeAt(pos); 9088 if (ch === 45 /* minus */) { 9089 tokenValue += "-"; 9090 pos++; 9091 continue; 9092 } else if (ch === 58 /* colon */ && !namespaceSeparator) { 9093 tokenValue += ":"; 9094 pos++; 9095 namespaceSeparator = true; 9096 token = 79 /* Identifier */; 9097 continue; 9098 } 9099 const oldPos = pos; 9100 tokenValue += scanIdentifierParts(); 9101 if (pos === oldPos) { 9102 break; 9103 } 9104 } 9105 if (tokenValue.slice(-1) === ":") { 9106 tokenValue = tokenValue.slice(0, -1); 9107 pos--; 9108 } 9109 return getIdentifierToken(); 9110 } 9111 return token; 9112 } 9113 function scanJsxAttributeValue() { 9114 startPos = pos; 9115 switch (text.charCodeAt(pos)) { 9116 case 34 /* doubleQuote */: 9117 case 39 /* singleQuote */: 9118 tokenValue = scanString(true); 9119 return token = 10 /* StringLiteral */; 9120 default: 9121 return scan(); 9122 } 9123 } 9124 function reScanJsxAttributeValue() { 9125 pos = tokenPos = startPos; 9126 return scanJsxAttributeValue(); 9127 } 9128 function scanJsDocToken() { 9129 startPos = tokenPos = pos; 9130 tokenFlags = 0 /* None */; 9131 if (pos >= end) { 9132 return token = 1 /* EndOfFileToken */; 9133 } 9134 const ch = codePointAt(text, pos); 9135 pos += charSize(ch); 9136 switch (ch) { 9137 case 9 /* tab */: 9138 case 11 /* verticalTab */: 9139 case 12 /* formFeed */: 9140 case 32 /* space */: 9141 while (pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos))) { 9142 pos++; 9143 } 9144 return token = 5 /* WhitespaceTrivia */; 9145 case 64 /* at */: 9146 return token = 59 /* AtToken */; 9147 case 13 /* carriageReturn */: 9148 if (text.charCodeAt(pos) === 10 /* lineFeed */) { 9149 pos++; 9150 } 9151 case 10 /* lineFeed */: 9152 tokenFlags |= 1 /* PrecedingLineBreak */; 9153 return token = 4 /* NewLineTrivia */; 9154 case 42 /* asterisk */: 9155 return token = 41 /* AsteriskToken */; 9156 case 123 /* openBrace */: 9157 return token = 18 /* OpenBraceToken */; 9158 case 125 /* closeBrace */: 9159 return token = 19 /* CloseBraceToken */; 9160 case 91 /* openBracket */: 9161 return token = 22 /* OpenBracketToken */; 9162 case 93 /* closeBracket */: 9163 return token = 23 /* CloseBracketToken */; 9164 case 60 /* lessThan */: 9165 return token = 29 /* LessThanToken */; 9166 case 62 /* greaterThan */: 9167 return token = 31 /* GreaterThanToken */; 9168 case 61 /* equals */: 9169 return token = 63 /* EqualsToken */; 9170 case 44 /* comma */: 9171 return token = 27 /* CommaToken */; 9172 case 46 /* dot */: 9173 return token = 24 /* DotToken */; 9174 case 96 /* backtick */: 9175 return token = 61 /* BacktickToken */; 9176 case 35 /* hash */: 9177 return token = 62 /* HashToken */; 9178 case 92 /* backslash */: 9179 pos--; 9180 const extendedCookedChar = peekExtendedUnicodeEscape(); 9181 if (extendedCookedChar >= 0 && isIdentifierStart(extendedCookedChar, languageVersion)) { 9182 pos += 3; 9183 tokenFlags |= 8 /* ExtendedUnicodeEscape */; 9184 tokenValue = scanExtendedUnicodeEscape() + scanIdentifierParts(); 9185 return token = getIdentifierToken(); 9186 } 9187 const cookedChar = peekUnicodeEscape(); 9188 if (cookedChar >= 0 && isIdentifierStart(cookedChar, languageVersion)) { 9189 pos += 6; 9190 tokenFlags |= 1024 /* UnicodeEscape */; 9191 tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts(); 9192 return token = getIdentifierToken(); 9193 } 9194 pos++; 9195 return token = 0 /* Unknown */; 9196 } 9197 if (isIdentifierStart(ch, languageVersion)) { 9198 let char = ch; 9199 while (pos < end && isIdentifierPart(char = codePointAt(text, pos), languageVersion) || text.charCodeAt(pos) === 45 /* minus */) 9200 pos += charSize(char); 9201 tokenValue = text.substring(tokenPos, pos); 9202 if (char === 92 /* backslash */) { 9203 tokenValue += scanIdentifierParts(); 9204 } 9205 return token = getIdentifierToken(); 9206 } else { 9207 return token = 0 /* Unknown */; 9208 } 9209 } 9210 function speculationHelper(callback, isLookahead) { 9211 const savePos = pos; 9212 const saveStartPos = startPos; 9213 const saveTokenPos = tokenPos; 9214 const saveToken = token; 9215 const saveTokenValue = tokenValue; 9216 const saveTokenFlags = tokenFlags; 9217 const result = callback(); 9218 if (!result || isLookahead) { 9219 pos = savePos; 9220 startPos = saveStartPos; 9221 tokenPos = saveTokenPos; 9222 token = saveToken; 9223 tokenValue = saveTokenValue; 9224 tokenFlags = saveTokenFlags; 9225 } 9226 return result; 9227 } 9228 function scanRange(start2, length3, callback) { 9229 const saveEnd = end; 9230 const savePos = pos; 9231 const saveStartPos = startPos; 9232 const saveTokenPos = tokenPos; 9233 const saveToken = token; 9234 const saveTokenValue = tokenValue; 9235 const saveTokenFlags = tokenFlags; 9236 const saveErrorExpectations = commentDirectives; 9237 setText(text, start2, length3); 9238 const result = callback(); 9239 end = saveEnd; 9240 pos = savePos; 9241 startPos = saveStartPos; 9242 tokenPos = saveTokenPos; 9243 token = saveToken; 9244 tokenValue = saveTokenValue; 9245 tokenFlags = saveTokenFlags; 9246 commentDirectives = saveErrorExpectations; 9247 return result; 9248 } 9249 function lookAhead(callback) { 9250 return speculationHelper(callback, true); 9251 } 9252 function tryScan(callback) { 9253 return speculationHelper(callback, false); 9254 } 9255 function getText() { 9256 return text; 9257 } 9258 function clearCommentDirectives() { 9259 commentDirectives = void 0; 9260 } 9261 function setText(newText, start2, length3) { 9262 text = newText || ""; 9263 end = length3 === void 0 ? text.length : start2 + length3; 9264 setTextPos(start2 || 0); 9265 } 9266 function setOnError(errorCallback) { 9267 onError = errorCallback; 9268 } 9269 function setScriptTarget(scriptTarget) { 9270 languageVersion = scriptTarget; 9271 } 9272 function setLanguageVariant(variant) { 9273 languageVariant = variant; 9274 } 9275 function setTextPos(textPos) { 9276 Debug.assert(textPos >= 0); 9277 pos = textPos; 9278 startPos = textPos; 9279 tokenPos = textPos; 9280 token = 0 /* Unknown */; 9281 tokenValue = void 0; 9282 tokenFlags = 0 /* None */; 9283 } 9284 function setInJSDocType(inType) { 9285 inJSDocType += inType ? 1 : -1; 9286 } 9287} 9288var codePointAt = String.prototype.codePointAt ? (s, i) => s.codePointAt(i) : function codePointAt2(str, i) { 9289 const size = str.length; 9290 if (i < 0 || i >= size) { 9291 return void 0; 9292 } 9293 const first2 = str.charCodeAt(i); 9294 if (first2 >= 55296 && first2 <= 56319 && size > i + 1) { 9295 const second = str.charCodeAt(i + 1); 9296 if (second >= 56320 && second <= 57343) { 9297 return (first2 - 55296) * 1024 + second - 56320 + 65536; 9298 } 9299 } 9300 return first2; 9301}; 9302function charSize(ch) { 9303 if (ch >= 65536) { 9304 return 2; 9305 } 9306 return 1; 9307} 9308function utf16EncodeAsStringFallback(codePoint) { 9309 Debug.assert(0 <= codePoint && codePoint <= 1114111); 9310 if (codePoint <= 65535) { 9311 return String.fromCharCode(codePoint); 9312 } 9313 const codeUnit1 = Math.floor((codePoint - 65536) / 1024) + 55296; 9314 const codeUnit2 = (codePoint - 65536) % 1024 + 56320; 9315 return String.fromCharCode(codeUnit1, codeUnit2); 9316} 9317var utf16EncodeAsStringWorker = String.fromCodePoint ? (codePoint) => String.fromCodePoint(codePoint) : utf16EncodeAsStringFallback; 9318function utf16EncodeAsString(codePoint) { 9319 return utf16EncodeAsStringWorker(codePoint); 9320} 9321 9322// src/compiler/utilitiesPublic.ts 9323function isExternalModuleNameRelative(moduleName) { 9324 return pathIsRelative(moduleName) || isRootedDiskPath(moduleName); 9325} 9326function textSpanEnd(span) { 9327 return span.start + span.length; 9328} 9329function textSpanIsEmpty(span) { 9330 return span.length === 0; 9331} 9332function createTextSpan(start, length2) { 9333 if (start < 0) { 9334 throw new Error("start < 0"); 9335 } 9336 if (length2 < 0) { 9337 throw new Error("length < 0"); 9338 } 9339 return { start, length: length2 }; 9340} 9341function createTextSpanFromBounds(start, end) { 9342 return createTextSpan(start, end - start); 9343} 9344function textChangeRangeNewSpan(range) { 9345 return createTextSpan(range.span.start, range.newLength); 9346} 9347function textChangeRangeIsUnchanged(range) { 9348 return textSpanIsEmpty(range.span) && range.newLength === 0; 9349} 9350function createTextChangeRange(span, newLength) { 9351 if (newLength < 0) { 9352 throw new Error("newLength < 0"); 9353 } 9354 return { span, newLength }; 9355} 9356var unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); 9357function isParameterPropertyDeclaration(node, parent) { 9358 return hasSyntacticModifier(node, 16476 /* ParameterPropertyModifier */) && parent.kind === 176 /* Constructor */; 9359} 9360function walkUpBindingElementsAndPatterns(binding) { 9361 let node = binding.parent; 9362 while (isBindingElement(node.parent)) { 9363 node = node.parent.parent; 9364 } 9365 return node.parent; 9366} 9367function getCombinedFlags(node, getFlags) { 9368 if (isBindingElement(node)) { 9369 node = walkUpBindingElementsAndPatterns(node); 9370 } 9371 let flags = getFlags(node); 9372 if (node.kind === 261 /* VariableDeclaration */) { 9373 node = node.parent; 9374 } 9375 if (node && node.kind === 262 /* VariableDeclarationList */) { 9376 flags |= getFlags(node); 9377 node = node.parent; 9378 } 9379 if (node && node.kind === 244 /* VariableStatement */) { 9380 flags |= getFlags(node); 9381 } 9382 return flags; 9383} 9384function getCombinedModifierFlags(node) { 9385 return getCombinedFlags(node, getEffectiveModifierFlags); 9386} 9387function getCombinedNodeFlags(node) { 9388 return getCombinedFlags(node, (n) => n.flags); 9389} 9390function getOriginalNode(node, nodeTest) { 9391 if (node) { 9392 while (node.original !== void 0) { 9393 node = node.original; 9394 } 9395 } 9396 return !nodeTest || nodeTest(node) ? node : void 0; 9397} 9398function findAncestor(node, callback) { 9399 while (node) { 9400 const result = callback(node); 9401 if (result === "quit") { 9402 return void 0; 9403 } else if (result) { 9404 return node; 9405 } 9406 node = node.parent; 9407 } 9408 return void 0; 9409} 9410function isParseTreeNode(node) { 9411 return (node.flags & 8 /* Synthesized */) === 0; 9412} 9413function getParseTreeNode(node, nodeTest) { 9414 if (node === void 0 || isParseTreeNode(node)) { 9415 return node; 9416 } 9417 node = node.original; 9418 while (node) { 9419 if (isParseTreeNode(node)) { 9420 return !nodeTest || nodeTest(node) ? node : void 0; 9421 } 9422 node = node.original; 9423 } 9424} 9425function escapeLeadingUnderscores(identifier) { 9426 return identifier.length >= 2 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ ? "_" + identifier : identifier; 9427} 9428function unescapeLeadingUnderscores(identifier) { 9429 const id = identifier; 9430 return id.length >= 3 && id.charCodeAt(0) === 95 /* _ */ && id.charCodeAt(1) === 95 /* _ */ && id.charCodeAt(2) === 95 /* _ */ ? id.substr(1) : id; 9431} 9432function idText(identifierOrPrivateName) { 9433 return unescapeLeadingUnderscores(identifierOrPrivateName.escapedText); 9434} 9435function symbolName(symbol) { 9436 if (symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) { 9437 return idText(symbol.valueDeclaration.name); 9438 } 9439 return unescapeLeadingUnderscores(symbol.escapedName); 9440} 9441function nameForNamelessJSDocTypedef(declaration) { 9442 const hostNode = declaration.parent.parent; 9443 if (!hostNode) { 9444 return void 0; 9445 } 9446 if (isDeclaration(hostNode)) { 9447 return getDeclarationIdentifier(hostNode); 9448 } 9449 switch (hostNode.kind) { 9450 case 244 /* VariableStatement */: 9451 if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { 9452 return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); 9453 } 9454 break; 9455 case 245 /* ExpressionStatement */: 9456 let expr = hostNode.expression; 9457 if (expr.kind === 227 /* BinaryExpression */ && expr.operatorToken.kind === 63 /* EqualsToken */) { 9458 expr = expr.left; 9459 } 9460 switch (expr.kind) { 9461 case 211 /* PropertyAccessExpression */: 9462 return expr.name; 9463 case 212 /* ElementAccessExpression */: 9464 const arg = expr.argumentExpression; 9465 if (isIdentifier(arg)) { 9466 return arg; 9467 } 9468 } 9469 break; 9470 case 217 /* ParenthesizedExpression */: { 9471 return getDeclarationIdentifier(hostNode.expression); 9472 } 9473 case 257 /* LabeledStatement */: { 9474 if (isDeclaration(hostNode.statement) || isExpression(hostNode.statement)) { 9475 return getDeclarationIdentifier(hostNode.statement); 9476 } 9477 break; 9478 } 9479 } 9480} 9481function getDeclarationIdentifier(node) { 9482 const name = getNameOfDeclaration(node); 9483 return name && isIdentifier(name) ? name : void 0; 9484} 9485function nodeHasName(statement, name) { 9486 if (isNamedDeclaration(statement) && isIdentifier(statement.name) && idText(statement.name) === idText(name)) { 9487 return true; 9488 } 9489 if (isVariableStatement(statement) && some(statement.declarationList.declarations, (d) => nodeHasName(d, name))) { 9490 return true; 9491 } 9492 return false; 9493} 9494function getNameOfJSDocTypedef(declaration) { 9495 return declaration.name || nameForNamelessJSDocTypedef(declaration); 9496} 9497function isNamedDeclaration(node) { 9498 return !!node.name; 9499} 9500function getNonAssignedNameOfDeclaration(declaration) { 9501 switch (declaration.kind) { 9502 case 79 /* Identifier */: 9503 return declaration; 9504 case 356 /* JSDocPropertyTag */: 9505 case 349 /* JSDocParameterTag */: { 9506 const { name } = declaration; 9507 if (name.kind === 165 /* QualifiedName */) { 9508 return name.right; 9509 } 9510 break; 9511 } 9512 case 213 /* CallExpression */: 9513 case 227 /* BinaryExpression */: { 9514 const expr2 = declaration; 9515 switch (getAssignmentDeclarationKind(expr2)) { 9516 case 1 /* ExportsProperty */: 9517 case 4 /* ThisProperty */: 9518 case 5 /* Property */: 9519 case 3 /* PrototypeProperty */: 9520 return getElementOrPropertyAccessArgumentExpressionOrName(expr2.left); 9521 case 7 /* ObjectDefinePropertyValue */: 9522 case 8 /* ObjectDefinePropertyExports */: 9523 case 9 /* ObjectDefinePrototypeProperty */: 9524 return expr2.arguments[1]; 9525 default: 9526 return void 0; 9527 } 9528 } 9529 case 354 /* JSDocTypedefTag */: 9530 return getNameOfJSDocTypedef(declaration); 9531 case 348 /* JSDocEnumTag */: 9532 return nameForNamelessJSDocTypedef(declaration); 9533 case 280 /* ExportAssignment */: { 9534 const { expression } = declaration; 9535 return isIdentifier(expression) ? expression : void 0; 9536 } 9537 case 212 /* ElementAccessExpression */: 9538 const expr = declaration; 9539 if (isBindableStaticElementAccessExpression(expr)) { 9540 return expr.argumentExpression; 9541 } 9542 } 9543 return declaration.name; 9544} 9545function getNameOfDeclaration(declaration) { 9546 if (declaration === void 0) 9547 return void 0; 9548 return getNonAssignedNameOfDeclaration(declaration) || (isFunctionExpression(declaration) || isArrowFunction(declaration) || isClassExpression(declaration) ? getAssignedName(declaration) : void 0); 9549} 9550function getAssignedName(node) { 9551 if (!node.parent) { 9552 return void 0; 9553 } else if (isPropertyAssignment(node.parent) || isBindingElement(node.parent)) { 9554 return node.parent.name; 9555 } else if (isBinaryExpression(node.parent) && node === node.parent.right) { 9556 if (isIdentifier(node.parent.left)) { 9557 return node.parent.left; 9558 } else if (isAccessExpression(node.parent.left)) { 9559 return getElementOrPropertyAccessArgumentExpressionOrName(node.parent.left); 9560 } 9561 } else if (isVariableDeclaration(node.parent) && isIdentifier(node.parent.name)) { 9562 return node.parent.name; 9563 } 9564} 9565function getModifiers(node) { 9566 if (hasSyntacticModifier(node, 126975 /* Modifier */)) { 9567 return filter(node.modifiers, isModifier); 9568 } 9569 return void 0; 9570} 9571function getIllegalDecorators(node) { 9572 if (hasIllegalDecorators(node)) { 9573 return node.illegalDecorators; 9574 } 9575} 9576function getJSDocParameterTagsWorker(param, noCache) { 9577 if (param.name) { 9578 if (isIdentifier(param.name)) { 9579 const name = param.name.escapedText; 9580 return getJSDocTagsWorker(param.parent, noCache).filter((tag) => isJSDocParameterTag(tag) && isIdentifier(tag.name) && tag.name.escapedText === name); 9581 } else { 9582 const i = param.parent.parameters.indexOf(param); 9583 Debug.assert(i > -1, "Parameters should always be in their parents' parameter list"); 9584 const paramTags = getJSDocTagsWorker(param.parent, noCache).filter(isJSDocParameterTag); 9585 if (i < paramTags.length) { 9586 return [paramTags[i]]; 9587 } 9588 } 9589 } 9590 return emptyArray; 9591} 9592function getJSDocParameterTags(param) { 9593 return getJSDocParameterTagsWorker(param, false); 9594} 9595function getJSDocParameterTagsNoCache(param) { 9596 return getJSDocParameterTagsWorker(param, true); 9597} 9598function getJSDocTypeParameterTagsWorker(param, noCache) { 9599 const name = param.name.escapedText; 9600 return getJSDocTagsWorker(param.parent, noCache).filter((tag) => isJSDocTemplateTag(tag) && tag.typeParameters.some((tp) => tp.name.escapedText === name)); 9601} 9602function getJSDocTypeParameterTags(param) { 9603 return getJSDocTypeParameterTagsWorker(param, false); 9604} 9605function getJSDocTypeParameterTagsNoCache(param) { 9606 return getJSDocTypeParameterTagsWorker(param, true); 9607} 9608function getJSDocPublicTagNoCache(node) { 9609 return getFirstJSDocTag(node, isJSDocPublicTag, true); 9610} 9611function getJSDocPrivateTagNoCache(node) { 9612 return getFirstJSDocTag(node, isJSDocPrivateTag, true); 9613} 9614function getJSDocProtectedTagNoCache(node) { 9615 return getFirstJSDocTag(node, isJSDocProtectedTag, true); 9616} 9617function getJSDocReadonlyTagNoCache(node) { 9618 return getFirstJSDocTag(node, isJSDocReadonlyTag, true); 9619} 9620function getJSDocOverrideTagNoCache(node) { 9621 return getFirstJSDocTag(node, isJSDocOverrideTag, true); 9622} 9623function getJSDocDeprecatedTagNoCache(node) { 9624 return getFirstJSDocTag(node, isJSDocDeprecatedTag, true); 9625} 9626function getJSDocTypeTag(node) { 9627 const tag = getFirstJSDocTag(node, isJSDocTypeTag); 9628 if (tag && tag.typeExpression && tag.typeExpression.type) { 9629 return tag; 9630 } 9631 return void 0; 9632} 9633function getJSDocTagsWorker(node, noCache) { 9634 let tags = node.jsDocCache; 9635 if (tags === void 0 || noCache) { 9636 const comments = getJSDocCommentsAndTags(node, noCache); 9637 Debug.assert(comments.length < 2 || comments[0] !== comments[1]); 9638 tags = flatMap(comments, (j) => isJSDoc(j) ? j.tags : j); 9639 if (!noCache) { 9640 node.jsDocCache = tags; 9641 } 9642 } 9643 return tags; 9644} 9645function getFirstJSDocTag(node, predicate, noCache) { 9646 return find(getJSDocTagsWorker(node, noCache), predicate); 9647} 9648function getTextOfJSDocComment(comment) { 9649 return typeof comment === "string" ? comment : comment == null ? void 0 : comment.map((c) => c.kind === 330 /* JSDocText */ ? c.text : formatJSDocLink(c)).join(""); 9650} 9651function formatJSDocLink(link) { 9652 const kind = link.kind === 333 /* JSDocLink */ ? "link" : link.kind === 334 /* JSDocLinkCode */ ? "linkcode" : "linkplain"; 9653 const name = link.name ? entityNameToString(link.name) : ""; 9654 const space = link.name && link.text.startsWith("://") ? "" : " "; 9655 return `{@${kind} ${name}${space}${link.text}}`; 9656} 9657function isMemberName(node) { 9658 return node.kind === 79 /* Identifier */ || node.kind === 80 /* PrivateIdentifier */; 9659} 9660function isPropertyAccessChain(node) { 9661 return isPropertyAccessExpression(node) && !!(node.flags & 32 /* OptionalChain */); 9662} 9663function isElementAccessChain(node) { 9664 return isElementAccessExpression(node) && !!(node.flags & 32 /* OptionalChain */); 9665} 9666function isCallChain(node) { 9667 return isCallExpression(node) && !!(node.flags & 32 /* OptionalChain */); 9668} 9669function isOptionalChain(node) { 9670 const kind = node.kind; 9671 return !!(node.flags & 32 /* OptionalChain */) && (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */ || kind === 213 /* CallExpression */ || kind === 236 /* NonNullExpression */); 9672} 9673function isOptionalChainRoot(node) { 9674 return isOptionalChain(node) && !isNonNullExpression(node) && !!node.questionDotToken; 9675} 9676function isExpressionOfOptionalChainRoot(node) { 9677 return isOptionalChainRoot(node.parent) && node.parent.expression === node; 9678} 9679function isOutermostOptionalChain(node) { 9680 return !isOptionalChain(node.parent) || isOptionalChainRoot(node.parent) || node !== node.parent.expression; 9681} 9682function isNullishCoalesce(node) { 9683 return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 60 /* QuestionQuestionToken */; 9684} 9685function skipPartiallyEmittedExpressions(node) { 9686 return skipOuterExpressions(node, 8 /* PartiallyEmittedExpressions */); 9687} 9688function isNonNullChain(node) { 9689 return isNonNullExpression(node) && !!(node.flags & 32 /* OptionalChain */); 9690} 9691function isNamedExportBindings(node) { 9692 return node.kind === 283 /* NamespaceExport */ || node.kind === 282 /* NamedExports */; 9693} 9694function isUnparsedTextLike(node) { 9695 switch (node.kind) { 9696 case 311 /* UnparsedText */: 9697 case 312 /* UnparsedInternalText */: 9698 return true; 9699 default: 9700 return false; 9701 } 9702} 9703function isUnparsedNode(node) { 9704 return isUnparsedTextLike(node) || node.kind === 309 /* UnparsedPrologue */ || node.kind === 313 /* UnparsedSyntheticReference */; 9705} 9706function isNodeKind(kind) { 9707 return kind >= 165 /* FirstNode */; 9708} 9709function isTokenKind(kind) { 9710 return kind >= 0 /* FirstToken */ && kind <= 164 /* LastToken */; 9711} 9712function isToken(n) { 9713 return isTokenKind(n.kind); 9714} 9715function isNodeArray(array) { 9716 return hasProperty(array, "pos") && hasProperty(array, "end"); 9717} 9718function isLiteralKind(kind) { 9719 return 8 /* FirstLiteralToken */ <= kind && kind <= 14 /* LastLiteralToken */; 9720} 9721function isLiteralExpression(node) { 9722 return isLiteralKind(node.kind); 9723} 9724function isTemplateLiteralKind(kind) { 9725 return 14 /* FirstTemplateToken */ <= kind && kind <= 17 /* LastTemplateToken */; 9726} 9727function isTemplateMiddleOrTemplateTail(node) { 9728 const kind = node.kind; 9729 return kind === 16 /* TemplateMiddle */ || kind === 17 /* TemplateTail */; 9730} 9731function isAssertionKey(node) { 9732 return isStringLiteral(node) || isIdentifier(node); 9733} 9734function isGeneratedIdentifier(node) { 9735 return isIdentifier(node) && (node.autoGenerateFlags & 7 /* KindMask */) > 0 /* None */; 9736} 9737function isGeneratedPrivateIdentifier(node) { 9738 return isPrivateIdentifier(node) && (node.autoGenerateFlags & 7 /* KindMask */) > 0 /* None */; 9739} 9740function isPrivateIdentifierClassElementDeclaration(node) { 9741 return (isPropertyDeclaration(node) || isMethodOrAccessor(node)) && isPrivateIdentifier(node.name); 9742} 9743function isModifierKind(token) { 9744 switch (token) { 9745 case 127 /* AbstractKeyword */: 9746 case 128 /* AccessorKeyword */: 9747 case 133 /* AsyncKeyword */: 9748 case 86 /* ConstKeyword */: 9749 case 137 /* DeclareKeyword */: 9750 case 89 /* DefaultKeyword */: 9751 case 94 /* ExportKeyword */: 9752 case 102 /* InKeyword */: 9753 case 124 /* PublicKeyword */: 9754 case 122 /* PrivateKeyword */: 9755 case 123 /* ProtectedKeyword */: 9756 case 147 /* ReadonlyKeyword */: 9757 case 125 /* StaticKeyword */: 9758 case 146 /* OutKeyword */: 9759 case 163 /* OverrideKeyword */: 9760 return true; 9761 } 9762 return false; 9763} 9764function isParameterPropertyModifier(kind) { 9765 return !!(modifierToFlag(kind) & 16476 /* ParameterPropertyModifier */); 9766} 9767function isClassMemberModifier(idToken) { 9768 return isParameterPropertyModifier(idToken) || idToken === 125 /* StaticKeyword */ || idToken === 163 /* OverrideKeyword */ || idToken === 128 /* AccessorKeyword */; 9769} 9770function isModifier(node) { 9771 return isModifierKind(node.kind); 9772} 9773function isEntityName(node) { 9774 const kind = node.kind; 9775 return kind === 165 /* QualifiedName */ || kind === 79 /* Identifier */; 9776} 9777function isPropertyName(node) { 9778 const kind = node.kind; 9779 return kind === 79 /* Identifier */ || kind === 80 /* PrivateIdentifier */ || kind === 10 /* StringLiteral */ || kind === 8 /* NumericLiteral */ || kind === 166 /* ComputedPropertyName */; 9780} 9781function isBindingName(node) { 9782 const kind = node.kind; 9783 return kind === 79 /* Identifier */ || kind === 206 /* ObjectBindingPattern */ || kind === 207 /* ArrayBindingPattern */; 9784} 9785function isFunctionLike(node) { 9786 return !!node && isFunctionLikeKind(node.kind); 9787} 9788function isFunctionLikeOrClassStaticBlockDeclaration(node) { 9789 return !!node && (isFunctionLikeKind(node.kind) || isClassStaticBlockDeclaration(node)); 9790} 9791function isFunctionLikeDeclaration(node) { 9792 return node && isFunctionLikeDeclarationKind(node.kind); 9793} 9794function isFunctionLikeDeclarationKind(kind) { 9795 switch (kind) { 9796 case 263 /* FunctionDeclaration */: 9797 case 174 /* MethodDeclaration */: 9798 case 176 /* Constructor */: 9799 case 177 /* GetAccessor */: 9800 case 178 /* SetAccessor */: 9801 case 218 /* FunctionExpression */: 9802 case 219 /* ArrowFunction */: 9803 return true; 9804 default: 9805 return false; 9806 } 9807} 9808function isFunctionLikeKind(kind) { 9809 switch (kind) { 9810 case 173 /* MethodSignature */: 9811 case 179 /* CallSignature */: 9812 case 332 /* JSDocSignature */: 9813 case 180 /* ConstructSignature */: 9814 case 181 /* IndexSignature */: 9815 case 184 /* FunctionType */: 9816 case 326 /* JSDocFunctionType */: 9817 case 185 /* ConstructorType */: 9818 return true; 9819 default: 9820 return isFunctionLikeDeclarationKind(kind); 9821 } 9822} 9823function isAnnotationElement(node) { 9824 const kind = node.kind; 9825 return kind === 172 /* AnnotationPropertyDeclaration */; 9826} 9827function isClassElement(node) { 9828 const kind = node.kind; 9829 return kind === 176 /* Constructor */ || kind === 171 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 241 /* SemicolonClassElement */; 9830} 9831function isClassLike(node) { 9832 return node && (node.kind === 264 /* ClassDeclaration */ || node.kind === 232 /* ClassExpression */ || node.kind === 265 /* StructDeclaration */); 9833} 9834function isAccessor(node) { 9835 return node && (node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */); 9836} 9837function isAutoAccessorPropertyDeclaration(node) { 9838 return isPropertyDeclaration(node) && hasAccessorModifier(node); 9839} 9840function isMethodOrAccessor(node) { 9841 switch (node.kind) { 9842 case 174 /* MethodDeclaration */: 9843 case 177 /* GetAccessor */: 9844 case 178 /* SetAccessor */: 9845 return true; 9846 default: 9847 return false; 9848 } 9849} 9850function isModifierLike(node) { 9851 return isModifier(node) || isDecoratorOrAnnotation(node); 9852} 9853function isTypeElement(node) { 9854 const kind = node.kind; 9855 return kind === 180 /* ConstructSignature */ || kind === 179 /* CallSignature */ || kind === 170 /* PropertySignature */ || kind === 173 /* MethodSignature */ || kind === 181 /* IndexSignature */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; 9856} 9857function isObjectLiteralElementLike(node) { 9858 const kind = node.kind; 9859 return kind === 305 /* PropertyAssignment */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 307 /* SpreadAssignment */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */; 9860} 9861function isTypeNode(node) { 9862 return isTypeNodeKind(node.kind); 9863} 9864function isFunctionOrConstructorTypeNode(node) { 9865 switch (node.kind) { 9866 case 184 /* FunctionType */: 9867 case 185 /* ConstructorType */: 9868 return true; 9869 } 9870 return false; 9871} 9872function isBindingPattern(node) { 9873 if (node) { 9874 const kind = node.kind; 9875 return kind === 207 /* ArrayBindingPattern */ || kind === 206 /* ObjectBindingPattern */; 9876 } 9877 return false; 9878} 9879function isAssignmentPattern(node) { 9880 const kind = node.kind; 9881 return kind === 209 /* ArrayLiteralExpression */ || kind === 210 /* ObjectLiteralExpression */; 9882} 9883function isArrayBindingElement(node) { 9884 const kind = node.kind; 9885 return kind === 208 /* BindingElement */ || kind === 233 /* OmittedExpression */; 9886} 9887function isDeclarationBindingElement(bindingElement) { 9888 switch (bindingElement.kind) { 9889 case 261 /* VariableDeclaration */: 9890 case 168 /* Parameter */: 9891 case 208 /* BindingElement */: 9892 return true; 9893 } 9894 return false; 9895} 9896function isTemplateLiteral(node) { 9897 const kind = node.kind; 9898 return kind === 229 /* TemplateExpression */ || kind === 14 /* NoSubstitutionTemplateLiteral */; 9899} 9900function isLeftHandSideExpression(node) { 9901 return isLeftHandSideExpressionKind(skipPartiallyEmittedExpressions(node).kind); 9902} 9903function isLeftHandSideExpressionKind(kind) { 9904 switch (kind) { 9905 case 211 /* PropertyAccessExpression */: 9906 case 212 /* ElementAccessExpression */: 9907 case 214 /* NewExpression */: 9908 case 213 /* CallExpression */: 9909 case 287 /* JsxElement */: 9910 case 288 /* JsxSelfClosingElement */: 9911 case 291 /* JsxFragment */: 9912 case 215 /* TaggedTemplateExpression */: 9913 case 209 /* ArrayLiteralExpression */: 9914 case 217 /* ParenthesizedExpression */: 9915 case 210 /* ObjectLiteralExpression */: 9916 case 232 /* ClassExpression */: 9917 case 218 /* FunctionExpression */: 9918 case 220 /* EtsComponentExpression */: 9919 case 79 /* Identifier */: 9920 case 80 /* PrivateIdentifier */: 9921 case 13 /* RegularExpressionLiteral */: 9922 case 8 /* NumericLiteral */: 9923 case 9 /* BigIntLiteral */: 9924 case 10 /* StringLiteral */: 9925 case 14 /* NoSubstitutionTemplateLiteral */: 9926 case 229 /* TemplateExpression */: 9927 case 96 /* FalseKeyword */: 9928 case 105 /* NullKeyword */: 9929 case 109 /* ThisKeyword */: 9930 case 111 /* TrueKeyword */: 9931 case 107 /* SuperKeyword */: 9932 case 236 /* NonNullExpression */: 9933 case 234 /* ExpressionWithTypeArguments */: 9934 case 237 /* MetaProperty */: 9935 case 101 /* ImportKeyword */: 9936 return true; 9937 default: 9938 return false; 9939 } 9940} 9941function isUnaryExpression(node) { 9942 return isUnaryExpressionKind(skipPartiallyEmittedExpressions(node).kind); 9943} 9944function isUnaryExpressionKind(kind) { 9945 switch (kind) { 9946 case 225 /* PrefixUnaryExpression */: 9947 case 226 /* PostfixUnaryExpression */: 9948 case 221 /* DeleteExpression */: 9949 case 222 /* TypeOfExpression */: 9950 case 223 /* VoidExpression */: 9951 case 224 /* AwaitExpression */: 9952 case 216 /* TypeAssertionExpression */: 9953 return true; 9954 default: 9955 return isLeftHandSideExpressionKind(kind); 9956 } 9957} 9958function isExpression(node) { 9959 return isExpressionKind(skipPartiallyEmittedExpressions(node).kind); 9960} 9961function isExpressionKind(kind) { 9962 switch (kind) { 9963 case 228 /* ConditionalExpression */: 9964 case 230 /* YieldExpression */: 9965 case 219 /* ArrowFunction */: 9966 case 227 /* BinaryExpression */: 9967 case 231 /* SpreadElement */: 9968 case 235 /* AsExpression */: 9969 case 233 /* OmittedExpression */: 9970 case 360 /* CommaListExpression */: 9971 case 359 /* PartiallyEmittedExpression */: 9972 case 239 /* SatisfiesExpression */: 9973 return true; 9974 default: 9975 return isUnaryExpressionKind(kind); 9976 } 9977} 9978function isForInOrOfStatement(node) { 9979 return node.kind === 250 /* ForInStatement */ || node.kind === 251 /* ForOfStatement */; 9980} 9981function isConciseBody(node) { 9982 return isBlock(node) || isExpression(node); 9983} 9984function isForInitializer(node) { 9985 return isVariableDeclarationList(node) || isExpression(node); 9986} 9987function isModuleBody(node) { 9988 const kind = node.kind; 9989 return kind === 271 /* ModuleBlock */ || kind === 270 /* ModuleDeclaration */ || kind === 79 /* Identifier */; 9990} 9991function isNamedImportBindings(node) { 9992 const kind = node.kind; 9993 return kind === 278 /* NamedImports */ || kind === 277 /* NamespaceImport */; 9994} 9995function isDeclarationKind(kind) { 9996 return kind === 219 /* ArrowFunction */ || kind === 208 /* BindingElement */ || kind === 264 /* ClassDeclaration */ || kind === 232 /* ClassExpression */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 176 /* Constructor */ || kind === 269 /* EnumDeclaration */ || kind === 308 /* EnumMember */ || kind === 284 /* ExportSpecifier */ || kind === 263 /* FunctionDeclaration */ || kind === 218 /* FunctionExpression */ || kind === 177 /* GetAccessor */ || kind === 276 /* ImportClause */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 279 /* ImportSpecifier */ || kind === 267 /* InterfaceDeclaration */ || kind === 294 /* JsxAttribute */ || kind === 174 /* MethodDeclaration */ || kind === 173 /* MethodSignature */ || kind === 270 /* ModuleDeclaration */ || kind === 273 /* NamespaceExportDeclaration */ || kind === 277 /* NamespaceImport */ || kind === 283 /* NamespaceExport */ || kind === 168 /* Parameter */ || kind === 305 /* PropertyAssignment */ || kind === 171 /* PropertyDeclaration */ || kind === 172 /* AnnotationPropertyDeclaration */ || kind === 170 /* PropertySignature */ || kind === 178 /* SetAccessor */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 268 /* TypeAliasDeclaration */ || kind === 167 /* TypeParameter */ || kind === 261 /* VariableDeclaration */ || kind === 354 /* JSDocTypedefTag */ || kind === 347 /* JSDocCallbackTag */ || kind === 356 /* JSDocPropertyTag */; 9997} 9998function isDeclarationStatementKind(kind) { 9999 return kind === 263 /* FunctionDeclaration */ || kind === 285 /* MissingDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 281 /* ExportDeclaration */ || kind === 280 /* ExportAssignment */ || kind === 273 /* NamespaceExportDeclaration */; 10000} 10001function isStatementKindButNotDeclarationKind(kind) { 10002 return kind === 253 /* BreakStatement */ || kind === 252 /* ContinueStatement */ || kind === 260 /* DebuggerStatement */ || kind === 247 /* DoStatement */ || kind === 245 /* ExpressionStatement */ || kind === 243 /* EmptyStatement */ || kind === 250 /* ForInStatement */ || kind === 251 /* ForOfStatement */ || kind === 249 /* ForStatement */ || kind === 246 /* IfStatement */ || kind === 257 /* LabeledStatement */ || kind === 254 /* ReturnStatement */ || kind === 256 /* SwitchStatement */ || kind === 258 /* ThrowStatement */ || kind === 259 /* TryStatement */ || kind === 244 /* VariableStatement */ || kind === 248 /* WhileStatement */ || kind === 255 /* WithStatement */ || kind === 358 /* NotEmittedStatement */ || kind === 362 /* EndOfDeclarationMarker */ || kind === 361 /* MergeDeclarationMarker */; 10003} 10004function isDeclaration(node) { 10005 if (node.kind === 167 /* TypeParameter */) { 10006 return node.parent && node.parent.kind !== 353 /* JSDocTemplateTag */ || isInJSFile(node); 10007 } 10008 return isDeclarationKind(node.kind); 10009} 10010function isDeclarationStatement(node) { 10011 return isDeclarationStatementKind(node.kind); 10012} 10013function isStatementButNotDeclaration(node) { 10014 return isStatementKindButNotDeclarationKind(node.kind); 10015} 10016function isStatement(node) { 10017 const kind = node.kind; 10018 return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || isBlockStatement(node); 10019} 10020function isBlockStatement(node) { 10021 if (node.kind !== 242 /* Block */) 10022 return false; 10023 if (node.parent !== void 0) { 10024 if (node.parent.kind === 259 /* TryStatement */ || node.parent.kind === 301 /* CatchClause */) { 10025 return false; 10026 } 10027 } 10028 return !isFunctionBlock(node); 10029} 10030function isStatementOrBlock(node) { 10031 const kind = node.kind; 10032 return isStatementKindButNotDeclarationKind(kind) || isDeclarationStatementKind(kind) || kind === 242 /* Block */; 10033} 10034function isModuleReference(node) { 10035 const kind = node.kind; 10036 return kind === 286 /* ExternalModuleReference */ || kind === 165 /* QualifiedName */ || kind === 79 /* Identifier */; 10037} 10038function isJsxTagNameExpression(node) { 10039 const kind = node.kind; 10040 return kind === 109 /* ThisKeyword */ || kind === 79 /* Identifier */ || kind === 211 /* PropertyAccessExpression */; 10041} 10042function isJsxChild(node) { 10043 const kind = node.kind; 10044 return kind === 287 /* JsxElement */ || kind === 297 /* JsxExpression */ || kind === 288 /* JsxSelfClosingElement */ || kind === 11 /* JsxText */ || kind === 291 /* JsxFragment */; 10045} 10046function isJsxAttributeLike(node) { 10047 const kind = node.kind; 10048 return kind === 294 /* JsxAttribute */ || kind === 296 /* JsxSpreadAttribute */; 10049} 10050function isStringLiteralOrJsxExpression(node) { 10051 const kind = node.kind; 10052 return kind === 10 /* StringLiteral */ || kind === 297 /* JsxExpression */; 10053} 10054function isCaseOrDefaultClause(node) { 10055 const kind = node.kind; 10056 return kind === 298 /* CaseClause */ || kind === 299 /* DefaultClause */; 10057} 10058function isJSDocNode(node) { 10059 return node.kind >= 318 /* FirstJSDocNode */ && node.kind <= 356 /* LastJSDocNode */; 10060} 10061function isJSDocTag(node) { 10062 return node.kind >= 336 /* FirstJSDocTagNode */ && node.kind <= 356 /* LastJSDocTagNode */; 10063} 10064function hasJSDocNodes(node) { 10065 const { jsDoc } = node; 10066 return !!jsDoc && jsDoc.length > 0; 10067} 10068function hasInitializer(node) { 10069 return !!node.initializer; 10070} 10071var MAX_SMI_X86 = 1073741823; 10072function guessIndentation(lines) { 10073 let indentation = MAX_SMI_X86; 10074 for (const line of lines) { 10075 if (!line.length) { 10076 continue; 10077 } 10078 let i = 0; 10079 for (; i < line.length && i < indentation; i++) { 10080 if (!isWhiteSpaceLike(line.charCodeAt(i))) { 10081 break; 10082 } 10083 } 10084 if (i < indentation) { 10085 indentation = i; 10086 } 10087 if (indentation === 0) { 10088 return 0; 10089 } 10090 } 10091 return indentation === MAX_SMI_X86 ? void 0 : indentation; 10092} 10093function isStringLiteralLike(node) { 10094 return node.kind === 10 /* StringLiteral */ || node.kind === 14 /* NoSubstitutionTemplateLiteral */; 10095} 10096var _MemoryUtils = class { 10097 static tryGC() { 10098 if (!(global && global.gc && typeof global.gc === "function")) { 10099 return; 10100 } 10101 const currentMemory = process.memoryUsage().heapUsed; 10102 if (currentMemory > _MemoryUtils.baseMemorySize && currentMemory - _MemoryUtils.MemoryAfterGC > _MemoryUtils.memoryGCThreshold) { 10103 global.gc(); 10104 _MemoryUtils.updateBaseMemory(currentMemory); 10105 return; 10106 } 10107 } 10108 static initializeBaseMemory(baseMemorySize) { 10109 const currentMemory = process.memoryUsage().heapUsed; 10110 _MemoryUtils.baseMemorySize = baseMemorySize ? baseMemorySize : currentMemory; 10111 _MemoryUtils.MemoryAfterGC = currentMemory; 10112 } 10113 static updateBaseMemory(MemoryBeforeGC) { 10114 const currentMemory = process.memoryUsage().heapUsed; 10115 _MemoryUtils.baseMemorySize = MemoryBeforeGC; 10116 _MemoryUtils.MemoryAfterGC = currentMemory; 10117 } 10118}; 10119var MemoryUtils = _MemoryUtils; 10120MemoryUtils.MemoryAfterGC = 0; 10121MemoryUtils.baseMemorySize = 0; 10122MemoryUtils.MIN_GC_THRESHOLD = 256 * 1024 * 1024; 10123MemoryUtils.memoryGCThreshold = _MemoryUtils.MIN_GC_THRESHOLD; 10124MemoryUtils.GC_THRESHOLD_RATIO = 0.4; 10125 10126// src/compiler/utilities.ts 10127function createSymbolTable(symbols) { 10128 const result = new Map2(); 10129 if (symbols) { 10130 for (const symbol of symbols) { 10131 result.set(symbol.escapedName, symbol); 10132 } 10133 } 10134 return result; 10135} 10136var stringWriter = createSingleLineStringWriter(); 10137function createSingleLineStringWriter() { 10138 var str = ""; 10139 const writeText = (text) => str += text; 10140 return { 10141 getText: () => str, 10142 write: writeText, 10143 rawWrite: writeText, 10144 writeKeyword: writeText, 10145 writeOperator: writeText, 10146 writePunctuation: writeText, 10147 writeSpace: writeText, 10148 writeStringLiteral: writeText, 10149 writeLiteral: writeText, 10150 writeParameter: writeText, 10151 writeProperty: writeText, 10152 writeSymbol: (s, _) => writeText(s), 10153 writeTrailingSemicolon: writeText, 10154 writeComment: writeText, 10155 getTextPos: () => str.length, 10156 getLine: () => 0, 10157 getColumn: () => 0, 10158 getIndent: () => 0, 10159 isAtStartOfLine: () => false, 10160 hasTrailingComment: () => false, 10161 hasTrailingWhitespace: () => !!str.length && isWhiteSpaceLike(str.charCodeAt(str.length - 1)), 10162 writeLine: () => str += " ", 10163 increaseIndent: noop, 10164 decreaseIndent: noop, 10165 clear: () => str = "", 10166 trackSymbol: () => false, 10167 reportInaccessibleThisError: noop, 10168 reportInaccessibleUniqueSymbolError: noop, 10169 reportPrivateInBaseOfClassExpression: noop 10170 }; 10171} 10172function copyEntries(source, target) { 10173 source.forEach((value, key) => { 10174 target.set(key, value); 10175 }); 10176} 10177function getFullWidth(node) { 10178 return node.end - node.pos; 10179} 10180function packageIdToPackageName({ name, subModuleName }) { 10181 return subModuleName ? `${name}/${subModuleName}` : name; 10182} 10183function packageIdToString(packageId) { 10184 return `${packageIdToPackageName(packageId)}@${packageId.version}`; 10185} 10186function containsParseError(node) { 10187 aggregateChildData(node); 10188 return (node.flags & 524288 /* ThisNodeOrAnySubNodesHasError */) !== 0; 10189} 10190function aggregateChildData(node) { 10191 if (!(node.flags & 1048576 /* HasAggregatedChildData */)) { 10192 const thisNodeOrAnySubNodesHasError = (node.flags & 131072 /* ThisNodeHasError */) !== 0 || forEachChild(node, containsParseError); 10193 if (thisNodeOrAnySubNodesHasError) { 10194 node.flags |= 524288 /* ThisNodeOrAnySubNodesHasError */; 10195 } 10196 node.flags |= 1048576 /* HasAggregatedChildData */; 10197 } 10198} 10199function getSourceFileOfNode(node) { 10200 while (node && node.kind !== 314 /* SourceFile */) { 10201 node = node.parent; 10202 } 10203 return node; 10204} 10205function getEndLinePosition(line, sourceFile) { 10206 Debug.assert(line >= 0); 10207 const lineStarts = getLineStarts(sourceFile); 10208 const lineIndex = line; 10209 const sourceText = sourceFile.text; 10210 if (lineIndex + 1 === lineStarts.length) { 10211 return sourceText.length - 1; 10212 } else { 10213 const start = lineStarts[lineIndex]; 10214 let pos = lineStarts[lineIndex + 1] - 1; 10215 Debug.assert(isLineBreak(sourceText.charCodeAt(pos))); 10216 while (start <= pos && isLineBreak(sourceText.charCodeAt(pos))) { 10217 pos--; 10218 } 10219 return pos; 10220 } 10221} 10222function isFileLevelUniqueName(sourceFile, name, hasGlobalName) { 10223 return !(hasGlobalName && hasGlobalName(name)) && !sourceFile.identifiers.has(name); 10224} 10225function nodeIsMissing(node) { 10226 if (node === void 0) { 10227 return true; 10228 } 10229 if (node.virtual) { 10230 return false; 10231 } 10232 return node.pos === node.end && node.pos >= 0 && node.kind !== 1 /* EndOfFileToken */; 10233} 10234function nodeIsPresent(node) { 10235 return !nodeIsMissing(node); 10236} 10237function isRecognizedTripleSlashComment(text, commentPos, commentEnd) { 10238 if (text.charCodeAt(commentPos + 1) === 47 /* slash */ && commentPos + 2 < commentEnd && text.charCodeAt(commentPos + 2) === 47 /* slash */) { 10239 const textSubStr = text.substring(commentPos, commentEnd); 10240 return fullTripleSlashReferencePathRegEx.test(textSubStr) || fullTripleSlashAMDReferencePathRegEx.test(textSubStr) || fullTripleSlashReferenceTypeReferenceDirectiveRegEx.test(textSubStr) || defaultLibReferenceRegEx.test(textSubStr) ? true : false; 10241 } 10242 return false; 10243} 10244function isPinnedComment(text, start) { 10245 return text.charCodeAt(start + 1) === 42 /* asterisk */ && text.charCodeAt(start + 2) === 33 /* exclamation */; 10246} 10247function getTokenPosOfNode(node, sourceFile, includeJsDoc) { 10248 if (nodeIsMissing(node)) { 10249 return node.pos; 10250 } 10251 if (isJSDocNode(node) || node.kind === 11 /* JsxText */) { 10252 return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos, false, true); 10253 } 10254 if (includeJsDoc && hasJSDocNodes(node)) { 10255 return getTokenPosOfNode(node.jsDoc[0], sourceFile); 10256 } 10257 if (node.kind === 357 /* SyntaxList */ && node._children.length > 0) { 10258 return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); 10259 } 10260 return node.virtual ? node.pos : skipTrivia( 10261 (sourceFile || getSourceFileOfNode(node)).text, 10262 node.pos, 10263 false, 10264 false, 10265 isInJSDoc(node) 10266 ); 10267} 10268function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia = false) { 10269 return getTextOfNodeFromSourceText(sourceFile.text, node, includeTrivia); 10270} 10271function isJSDocTypeExpressionOrChild(node) { 10272 return !!findAncestor(node, isJSDocTypeExpression); 10273} 10274function getTextOfNodeFromSourceText(sourceText, node, includeTrivia = false) { 10275 if (nodeIsMissing(node)) { 10276 return ""; 10277 } 10278 let text = sourceText.substring(includeTrivia ? node.pos : skipTrivia(sourceText, node.pos), node.end); 10279 if (isJSDocTypeExpressionOrChild(node)) { 10280 text = text.split(/\r\n|\n|\r/).map((line) => trimStringStart(line.replace(/^\s*\*/, ""))).join("\n"); 10281 } 10282 return text; 10283} 10284function getTextOfNode(node, includeTrivia = false) { 10285 return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node, includeTrivia); 10286} 10287function getEmitFlags(node) { 10288 const emitNode = node.emitNode; 10289 return emitNode && emitNode.flags || 0; 10290} 10291function getLiteralText(node, sourceFile, flags) { 10292 var _a2; 10293 if (sourceFile && canUseOriginalText(node, flags)) { 10294 return getSourceTextOfNodeFromSourceFile(sourceFile, node); 10295 } 10296 switch (node.kind) { 10297 case 10 /* StringLiteral */: { 10298 const escapeText = flags & 2 /* JsxAttributeEscape */ ? escapeJsxAttributeString : flags & 1 /* NeverAsciiEscape */ || getEmitFlags(node) & 16777216 /* NoAsciiEscaping */ ? escapeString : escapeNonAsciiString; 10299 if (node.singleQuote) { 10300 return "'" + escapeText(node.text, 39 /* singleQuote */) + "'"; 10301 } else { 10302 return '"' + escapeText(node.text, 34 /* doubleQuote */) + '"'; 10303 } 10304 } 10305 case 14 /* NoSubstitutionTemplateLiteral */: 10306 case 15 /* TemplateHead */: 10307 case 16 /* TemplateMiddle */: 10308 case 17 /* TemplateTail */: { 10309 const escapeText = flags & 1 /* NeverAsciiEscape */ || getEmitFlags(node) & 16777216 /* NoAsciiEscaping */ ? escapeString : escapeNonAsciiString; 10310 const rawText = (_a2 = node.rawText) != null ? _a2 : escapeTemplateSubstitution(escapeText(node.text, 96 /* backtick */)); 10311 switch (node.kind) { 10312 case 14 /* NoSubstitutionTemplateLiteral */: 10313 return "`" + rawText + "`"; 10314 case 15 /* TemplateHead */: 10315 return "`" + rawText + "${"; 10316 case 16 /* TemplateMiddle */: 10317 return "}" + rawText + "${"; 10318 case 17 /* TemplateTail */: 10319 return "}" + rawText + "`"; 10320 } 10321 } 10322 case 8 /* NumericLiteral */: 10323 case 9 /* BigIntLiteral */: 10324 return node.text; 10325 case 13 /* RegularExpressionLiteral */: 10326 if (flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated) { 10327 return node.text + (node.text.charCodeAt(node.text.length - 1) === 92 /* backslash */ ? " /" : "/"); 10328 } 10329 return node.text; 10330 } 10331 return Debug.fail(`Literal kind '${node.kind}' not accounted for.`); 10332} 10333function canUseOriginalText(node, flags) { 10334 if (nodeIsSynthesized(node) || !node.parent || flags & 4 /* TerminateUnterminatedLiterals */ && node.isUnterminated || node.flags & -2147483648 /* NoOriginalText */) { 10335 return false; 10336 } 10337 if (isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */) { 10338 return !!(flags & 8 /* AllowNumericSeparator */); 10339 } 10340 return !isBigIntLiteral(node); 10341} 10342function makeIdentifierFromModuleName(moduleName) { 10343 return getBaseFileName(moduleName).replace(/^(\d)/, "_$1").replace(/\W/g, "_"); 10344} 10345function isBlockOrCatchScoped(declaration) { 10346 return (getCombinedNodeFlags(declaration) & 3 /* BlockScoped */) !== 0 || isCatchClauseVariableDeclarationOrBindingElement(declaration); 10347} 10348function isCatchClauseVariableDeclarationOrBindingElement(declaration) { 10349 const node = getRootDeclaration(declaration); 10350 return node.kind === 261 /* VariableDeclaration */ && node.parent.kind === 301 /* CatchClause */; 10351} 10352function isAmbientModule(node) { 10353 return isModuleDeclaration(node) && (node.name.kind === 10 /* StringLiteral */ || isGlobalScopeAugmentation(node)); 10354} 10355function isModuleWithStringLiteralName(node) { 10356 return isModuleDeclaration(node) && node.name.kind === 10 /* StringLiteral */; 10357} 10358function isEffectiveModuleDeclaration(node) { 10359 return isModuleDeclaration(node) || isIdentifier(node); 10360} 10361function isGlobalScopeAugmentation(module2) { 10362 return !!(module2.flags & 1024 /* GlobalAugmentation */); 10363} 10364function isModuleAugmentationExternal(node) { 10365 switch (node.parent.kind) { 10366 case 314 /* SourceFile */: 10367 return isExternalModule(node.parent); 10368 case 271 /* ModuleBlock */: 10369 return isAmbientModule(node.parent.parent) && isSourceFile(node.parent.parent.parent) && !isExternalModule(node.parent.parent.parent); 10370 } 10371 return false; 10372} 10373function isBlockScope(node, parentNode) { 10374 switch (node.kind) { 10375 case 314 /* SourceFile */: 10376 case 272 /* CaseBlock */: 10377 case 301 /* CatchClause */: 10378 case 270 /* ModuleDeclaration */: 10379 case 249 /* ForStatement */: 10380 case 250 /* ForInStatement */: 10381 case 251 /* ForOfStatement */: 10382 case 176 /* Constructor */: 10383 case 174 /* MethodDeclaration */: 10384 case 177 /* GetAccessor */: 10385 case 178 /* SetAccessor */: 10386 case 263 /* FunctionDeclaration */: 10387 case 218 /* FunctionExpression */: 10388 case 219 /* ArrowFunction */: 10389 case 171 /* PropertyDeclaration */: 10390 case 172 /* AnnotationPropertyDeclaration */: 10391 case 175 /* ClassStaticBlockDeclaration */: 10392 return true; 10393 case 242 /* Block */: 10394 return !isFunctionLikeOrClassStaticBlockDeclaration(parentNode); 10395 } 10396 return false; 10397} 10398function getEnclosingBlockScopeContainer(node) { 10399 return findAncestor(node.parent, (current) => isBlockScope(current, current.parent)); 10400} 10401function declarationNameToString(name) { 10402 if (name && name.virtual && name.kind === 79 /* Identifier */) { 10403 return name.escapedText.toString(); 10404 } else { 10405 return !name || getFullWidth(name) === 0 ? "(Missing)" : getTextOfNode(name); 10406 } 10407} 10408function isComputedNonLiteralName(name) { 10409 return name.kind === 166 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression); 10410} 10411function tryGetTextOfPropertyName(name) { 10412 switch (name.kind) { 10413 case 79 /* Identifier */: 10414 case 80 /* PrivateIdentifier */: 10415 return name.autoGenerateFlags ? void 0 : name.escapedText; 10416 case 10 /* StringLiteral */: 10417 case 8 /* NumericLiteral */: 10418 case 14 /* NoSubstitutionTemplateLiteral */: 10419 return escapeLeadingUnderscores(name.text); 10420 case 166 /* ComputedPropertyName */: 10421 if (isStringOrNumericLiteralLike(name.expression)) 10422 return escapeLeadingUnderscores(name.expression.text); 10423 return void 0; 10424 default: 10425 return Debug.assertNever(name); 10426 } 10427} 10428function getTextOfPropertyName(name) { 10429 return Debug.checkDefined(tryGetTextOfPropertyName(name)); 10430} 10431function entityNameToString(name) { 10432 switch (name.kind) { 10433 case 109 /* ThisKeyword */: 10434 return "this"; 10435 case 80 /* PrivateIdentifier */: 10436 case 79 /* Identifier */: 10437 return getFullWidth(name) === 0 ? idText(name) : getTextOfNode(name); 10438 case 165 /* QualifiedName */: 10439 return entityNameToString(name.left) + "." + entityNameToString(name.right); 10440 case 211 /* PropertyAccessExpression */: 10441 if (isIdentifier(name.name) || isPrivateIdentifier(name.name)) { 10442 return entityNameToString(name.expression) + "." + entityNameToString(name.name); 10443 } else { 10444 return Debug.assertNever(name.name); 10445 } 10446 case 320 /* JSDocMemberName */: 10447 return entityNameToString(name.left) + entityNameToString(name.right); 10448 default: 10449 return Debug.assertNever(name); 10450 } 10451} 10452function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3) { 10453 const span = getErrorSpanForNode(sourceFile, node); 10454 return createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); 10455} 10456function assertDiagnosticLocation(file, start, length2) { 10457 Debug.assertGreaterThanOrEqual(start, 0); 10458 Debug.assertGreaterThanOrEqual(length2, 0); 10459 if (file) { 10460 Debug.assertLessThanOrEqual(start, file.text.length); 10461 Debug.assertLessThanOrEqual(start + length2, file.text.length); 10462 } 10463} 10464function getSpanOfTokenAtPosition(sourceFile, pos) { 10465 const scanner = createScanner(sourceFile.languageVersion, true, sourceFile.languageVariant, sourceFile.text, void 0, pos); 10466 scanner.scan(); 10467 const start = scanner.getTokenPos(); 10468 return createTextSpanFromBounds(start, scanner.getTextPos()); 10469} 10470function getErrorSpanForArrowFunction(sourceFile, node) { 10471 const pos = skipTrivia(sourceFile.text, node.pos); 10472 if (node.body && node.body.kind === 242 /* Block */) { 10473 const { line: startLine } = getLineAndCharacterOfPosition(sourceFile, node.body.pos); 10474 const { line: endLine } = getLineAndCharacterOfPosition(sourceFile, node.body.end); 10475 if (startLine < endLine) { 10476 return createTextSpan(pos, getEndLinePosition(startLine, sourceFile) - pos + 1); 10477 } 10478 } 10479 return createTextSpanFromBounds(pos, node.end); 10480} 10481function getErrorSpanForNode(sourceFile, node) { 10482 let errorNode = node; 10483 switch (node.kind) { 10484 case 314 /* SourceFile */: 10485 const pos2 = skipTrivia(sourceFile.text, 0, false); 10486 if (pos2 === sourceFile.text.length) { 10487 return createTextSpan(0, 0); 10488 } 10489 return getSpanOfTokenAtPosition(sourceFile, pos2); 10490 case 261 /* VariableDeclaration */: 10491 case 208 /* BindingElement */: 10492 case 264 /* ClassDeclaration */: 10493 case 232 /* ClassExpression */: 10494 case 265 /* StructDeclaration */: 10495 case 267 /* InterfaceDeclaration */: 10496 case 270 /* ModuleDeclaration */: 10497 case 269 /* EnumDeclaration */: 10498 case 308 /* EnumMember */: 10499 case 263 /* FunctionDeclaration */: 10500 case 218 /* FunctionExpression */: 10501 case 174 /* MethodDeclaration */: 10502 case 177 /* GetAccessor */: 10503 case 178 /* SetAccessor */: 10504 case 268 /* TypeAliasDeclaration */: 10505 case 171 /* PropertyDeclaration */: 10506 case 172 /* AnnotationPropertyDeclaration */: 10507 case 170 /* PropertySignature */: 10508 case 277 /* NamespaceImport */: 10509 errorNode = node.name; 10510 break; 10511 case 219 /* ArrowFunction */: 10512 return getErrorSpanForArrowFunction(sourceFile, node); 10513 case 298 /* CaseClause */: 10514 case 299 /* DefaultClause */: 10515 const start = skipTrivia(sourceFile.text, node.pos); 10516 const end = node.statements.length > 0 ? node.statements[0].pos : node.end; 10517 return createTextSpanFromBounds(start, end); 10518 } 10519 if (errorNode === void 0) { 10520 return getSpanOfTokenAtPosition(sourceFile, node.pos); 10521 } 10522 Debug.assert(!isJSDoc(errorNode)); 10523 const isMissing = nodeIsMissing(errorNode); 10524 const pos = isMissing || isJsxText(node) || node.virtual && !(node.flags & 536870912 /* KitImportFlags */) ? errorNode.pos : skipTrivia(sourceFile.text, errorNode.pos); 10525 if (isMissing) { 10526 Debug.assert(pos === errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); 10527 Debug.assert(pos === errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); 10528 } else { 10529 Debug.assert(pos >= errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); 10530 Debug.assert(pos <= errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); 10531 } 10532 return createTextSpanFromBounds(pos, errorNode.end); 10533} 10534function isExternalOrCommonJsModule(file) { 10535 return (file.externalModuleIndicator || file.commonJsModuleIndicator) !== void 0; 10536} 10537function isJsonSourceFile(file) { 10538 return file.scriptKind === 6 /* JSON */; 10539} 10540function isEnumConst(node) { 10541 return !!(getCombinedModifierFlags(node) & 2048 /* Const */); 10542} 10543function isVarConst(node) { 10544 return !!(getCombinedNodeFlags(node) & 2 /* Const */); 10545} 10546function isLet(node) { 10547 return !!(getCombinedNodeFlags(node) & 1 /* Let */); 10548} 10549function isLiteralImportTypeNode(n) { 10550 return isImportTypeNode(n) && isLiteralTypeNode(n.argument) && isStringLiteral(n.argument.literal); 10551} 10552function isPrologueDirective(node) { 10553 return node.kind === 245 /* ExpressionStatement */ && node.expression.kind === 10 /* StringLiteral */; 10554} 10555function isCustomPrologue(node) { 10556 return !!(getEmitFlags(node) & 1048576 /* CustomPrologue */); 10557} 10558function isHoistedFunction(node) { 10559 return isCustomPrologue(node) && isFunctionDeclaration(node); 10560} 10561function isHoistedVariable(node) { 10562 return isIdentifier(node.name) && !node.initializer; 10563} 10564function isHoistedVariableStatement(node) { 10565 return isCustomPrologue(node) && isVariableStatement(node) && every(node.declarationList.declarations, isHoistedVariable); 10566} 10567function getJSDocCommentRanges(node, text) { 10568 const commentRanges = node.kind === 168 /* Parameter */ || node.kind === 167 /* TypeParameter */ || node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */ || node.kind === 217 /* ParenthesizedExpression */ || node.kind === 261 /* VariableDeclaration */ || node.kind === 284 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos); 10569 return filter(commentRanges, (comment) => text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 3) !== 47 /* slash */); 10570} 10571var fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*<reference\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/; 10572var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*<reference\s+types\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/; 10573var fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*<amd-dependency\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/; 10574var defaultLibReferenceRegEx = /^(\/\/\/\s*<reference\s+no-default-lib\s*=\s*)(('[^']*')|("[^"]*"))\s*\/>/; 10575function isVariableLike(node) { 10576 if (node) { 10577 switch (node.kind) { 10578 case 208 /* BindingElement */: 10579 case 308 /* EnumMember */: 10580 case 168 /* Parameter */: 10581 case 305 /* PropertyAssignment */: 10582 case 171 /* PropertyDeclaration */: 10583 case 170 /* PropertySignature */: 10584 case 306 /* ShorthandPropertyAssignment */: 10585 case 261 /* VariableDeclaration */: 10586 return true; 10587 } 10588 } 10589 return false; 10590} 10591function isFunctionBlock(node) { 10592 return node && node.kind === 242 /* Block */ && isFunctionLike(node.parent); 10593} 10594function isObjectLiteralMethod(node) { 10595 return node && node.kind === 174 /* MethodDeclaration */ && node.parent.kind === 210 /* ObjectLiteralExpression */; 10596} 10597function isObjectLiteralOrClassExpressionMethodOrAccessor(node) { 10598 return (node.kind === 174 /* MethodDeclaration */ || node.kind === 177 /* GetAccessor */ || node.kind === 178 /* SetAccessor */) && (node.parent.kind === 210 /* ObjectLiteralExpression */ || node.parent.kind === 232 /* ClassExpression */); 10599} 10600function getContainingClass(node) { 10601 return findAncestor(node.parent, isClassLike); 10602} 10603function getThisContainer(node, includeArrowFunctions) { 10604 Debug.assert(node.kind !== 314 /* SourceFile */); 10605 while (true) { 10606 node = node.parent; 10607 if (!node) { 10608 return Debug.fail(); 10609 } 10610 switch (node.kind) { 10611 case 166 /* ComputedPropertyName */: 10612 if (isClassLike(node.parent.parent)) { 10613 return node; 10614 } 10615 node = node.parent; 10616 break; 10617 case 169 /* Decorator */: 10618 if (node.parent.kind === 168 /* Parameter */ && isClassElement(node.parent.parent)) { 10619 node = node.parent.parent; 10620 } else if (isClassElement(node.parent)) { 10621 node = node.parent; 10622 } 10623 break; 10624 case 219 /* ArrowFunction */: 10625 if (!includeArrowFunctions) { 10626 continue; 10627 } 10628 case 263 /* FunctionDeclaration */: 10629 case 218 /* FunctionExpression */: 10630 case 270 /* ModuleDeclaration */: 10631 case 175 /* ClassStaticBlockDeclaration */: 10632 case 171 /* PropertyDeclaration */: 10633 case 170 /* PropertySignature */: 10634 case 174 /* MethodDeclaration */: 10635 case 173 /* MethodSignature */: 10636 case 176 /* Constructor */: 10637 case 177 /* GetAccessor */: 10638 case 178 /* SetAccessor */: 10639 case 179 /* CallSignature */: 10640 case 180 /* ConstructSignature */: 10641 case 181 /* IndexSignature */: 10642 case 269 /* EnumDeclaration */: 10643 case 314 /* SourceFile */: 10644 return node; 10645 } 10646 } 10647} 10648function isInTopLevelContext(node) { 10649 if (isIdentifier(node) && (isClassDeclaration(node.parent) || isFunctionDeclaration(node.parent)) && node.parent.name === node) { 10650 node = node.parent; 10651 } 10652 const container = getThisContainer(node, true); 10653 return isSourceFile(container); 10654} 10655function getImmediatelyInvokedFunctionExpression(func) { 10656 if (func.kind === 218 /* FunctionExpression */ || func.kind === 219 /* ArrowFunction */) { 10657 let prev = func; 10658 let parent = func.parent; 10659 while (parent.kind === 217 /* ParenthesizedExpression */) { 10660 prev = parent; 10661 parent = parent.parent; 10662 } 10663 if (parent.kind === 213 /* CallExpression */ && parent.expression === prev) { 10664 return parent; 10665 } 10666 } 10667} 10668function isSuperProperty(node) { 10669 const kind = node.kind; 10670 return (kind === 211 /* PropertyAccessExpression */ || kind === 212 /* ElementAccessExpression */) && node.expression.kind === 107 /* SuperKeyword */; 10671} 10672function isThisInitializedDeclaration(node) { 10673 var _a2; 10674 return !!node && isVariableDeclaration(node) && ((_a2 = node.initializer) == null ? void 0 : _a2.kind) === 109 /* ThisKeyword */; 10675} 10676function isPartOfTypeQuery(node) { 10677 while (node.kind === 165 /* QualifiedName */ || node.kind === 79 /* Identifier */) { 10678 node = node.parent; 10679 } 10680 return node.kind === 186 /* TypeQuery */; 10681} 10682function isInJSFile(node) { 10683 return !!node && !!(node.flags & 262144 /* JavaScriptFile */); 10684} 10685function isInJsonFile(node) { 10686 return !!node && !!(node.flags & 67108864 /* JsonFile */); 10687} 10688function isInJSDoc(node) { 10689 return !!node && !!(node.flags & 8388608 /* JSDoc */); 10690} 10691function isRequireCall(callExpression, requireStringLiteralLikeArgument) { 10692 if (callExpression.kind !== 213 /* CallExpression */) { 10693 return false; 10694 } 10695 const { expression, arguments: args } = callExpression; 10696 if (expression.kind !== 79 /* Identifier */ || expression.escapedText !== "require") { 10697 return false; 10698 } 10699 if (args.length !== 1) { 10700 return false; 10701 } 10702 const arg = args[0]; 10703 return !requireStringLiteralLikeArgument || isStringLiteralLike(arg); 10704} 10705function isVariableDeclarationInitializedToBareOrAccessedRequire(node) { 10706 return isVariableDeclarationInitializedWithRequireHelper(node, true); 10707} 10708function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) { 10709 return isVariableDeclaration(node) && !!node.initializer && isRequireCall(allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, true); 10710} 10711function isStringDoubleQuoted(str, sourceFile) { 10712 return getSourceTextOfNodeFromSourceFile(sourceFile, str).charCodeAt(0) === 34 /* doubleQuote */; 10713} 10714function isAssignmentDeclaration(decl) { 10715 return isBinaryExpression(decl) || isAccessExpression(decl) || isIdentifier(decl) || isCallExpression(decl); 10716} 10717function hasExpandoValueProperty(node, isPrototypeAssignment) { 10718 return forEach(node.properties, (p) => isPropertyAssignment(p) && isIdentifier(p.name) && p.name.escapedText === "value" && p.initializer && getExpandoInitializer(p.initializer, isPrototypeAssignment)); 10719} 10720function getAssignedExpandoInitializer(node) { 10721 if (node && node.parent && isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 63 /* EqualsToken */) { 10722 const isPrototypeAssignment = isPrototypeAccess(node.parent.left); 10723 return getExpandoInitializer(node.parent.right, isPrototypeAssignment) || getDefaultedExpandoInitializer(node.parent.left, node.parent.right, isPrototypeAssignment); 10724 } 10725 if (node && isCallExpression(node) && isBindableObjectDefinePropertyCall(node)) { 10726 const result = hasExpandoValueProperty(node.arguments[2], node.arguments[1].text === "prototype"); 10727 if (result) { 10728 return result; 10729 } 10730 } 10731} 10732function getExpandoInitializer(initializer, isPrototypeAssignment) { 10733 if (isCallExpression(initializer)) { 10734 const e = skipParentheses(initializer.expression); 10735 return e.kind === 218 /* FunctionExpression */ || e.kind === 219 /* ArrowFunction */ ? initializer : void 0; 10736 } 10737 if (initializer.kind === 218 /* FunctionExpression */ || initializer.kind === 232 /* ClassExpression */ || initializer.kind === 219 /* ArrowFunction */) { 10738 return initializer; 10739 } 10740 if (isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { 10741 return initializer; 10742 } 10743} 10744function getDefaultedExpandoInitializer(name, initializer, isPrototypeAssignment) { 10745 const e = isBinaryExpression(initializer) && (initializer.operatorToken.kind === 56 /* BarBarToken */ || initializer.operatorToken.kind === 60 /* QuestionQuestionToken */) && getExpandoInitializer(initializer.right, isPrototypeAssignment); 10746 if (e && isSameEntityName(name, initializer.left)) { 10747 return e; 10748 } 10749} 10750function isSameEntityName(name, initializer) { 10751 if (isPropertyNameLiteral(name) && isPropertyNameLiteral(initializer)) { 10752 return getTextOfIdentifierOrLiteral(name) === getTextOfIdentifierOrLiteral(initializer); 10753 } 10754 if (isMemberName(name) && isLiteralLikeAccess(initializer) && (initializer.expression.kind === 109 /* ThisKeyword */ || isIdentifier(initializer.expression) && (initializer.expression.escapedText === "window" || initializer.expression.escapedText === "self" || initializer.expression.escapedText === "global"))) { 10755 return isSameEntityName(name, getNameOrArgument(initializer)); 10756 } 10757 if (isLiteralLikeAccess(name) && isLiteralLikeAccess(initializer)) { 10758 return getElementOrPropertyAccessName(name) === getElementOrPropertyAccessName(initializer) && isSameEntityName(name.expression, initializer.expression); 10759 } 10760 return false; 10761} 10762function getRightMostAssignedExpression(node) { 10763 while (isAssignmentExpression(node, true)) { 10764 node = node.right; 10765 } 10766 return node; 10767} 10768function isExportsIdentifier(node) { 10769 return isIdentifier(node) && node.escapedText === "exports"; 10770} 10771function isModuleIdentifier(node) { 10772 return isIdentifier(node) && node.escapedText === "module"; 10773} 10774function isModuleExportsAccessExpression(node) { 10775 return (isPropertyAccessExpression(node) || isLiteralLikeElementAccess(node)) && isModuleIdentifier(node.expression) && getElementOrPropertyAccessName(node) === "exports"; 10776} 10777function getAssignmentDeclarationKind(expr) { 10778 const special = getAssignmentDeclarationKindWorker(expr); 10779 return special === 5 /* Property */ || isInJSFile(expr) ? special : 0 /* None */; 10780} 10781function isBindableObjectDefinePropertyCall(expr) { 10782 return length(expr.arguments) === 3 && isPropertyAccessExpression(expr.expression) && isIdentifier(expr.expression.expression) && idText(expr.expression.expression) === "Object" && idText(expr.expression.name) === "defineProperty" && isStringOrNumericLiteralLike(expr.arguments[1]) && isBindableStaticNameExpression(expr.arguments[0], true); 10783} 10784function isLiteralLikeAccess(node) { 10785 return isPropertyAccessExpression(node) || isLiteralLikeElementAccess(node); 10786} 10787function isLiteralLikeElementAccess(node) { 10788 return isElementAccessExpression(node) && isStringOrNumericLiteralLike(node.argumentExpression); 10789} 10790function isBindableStaticAccessExpression(node, excludeThisKeyword) { 10791 return isPropertyAccessExpression(node) && (!excludeThisKeyword && node.expression.kind === 109 /* ThisKeyword */ || isIdentifier(node.name) && isBindableStaticNameExpression(node.expression, true)) || isBindableStaticElementAccessExpression(node, excludeThisKeyword); 10792} 10793function isBindableStaticElementAccessExpression(node, excludeThisKeyword) { 10794 return isLiteralLikeElementAccess(node) && (!excludeThisKeyword && node.expression.kind === 109 /* ThisKeyword */ || isEntityNameExpression(node.expression) || isBindableStaticAccessExpression(node.expression, true)); 10795} 10796function isBindableStaticNameExpression(node, excludeThisKeyword) { 10797 return isEntityNameExpression(node) || isBindableStaticAccessExpression(node, excludeThisKeyword); 10798} 10799function getNameOrArgument(expr) { 10800 if (isPropertyAccessExpression(expr)) { 10801 return expr.name; 10802 } 10803 return expr.argumentExpression; 10804} 10805function getAssignmentDeclarationKindWorker(expr) { 10806 if (isCallExpression(expr)) { 10807 if (!isBindableObjectDefinePropertyCall(expr)) { 10808 return 0 /* None */; 10809 } 10810 const entityName = expr.arguments[0]; 10811 if (isExportsIdentifier(entityName) || isModuleExportsAccessExpression(entityName)) { 10812 return 8 /* ObjectDefinePropertyExports */; 10813 } 10814 if (isBindableStaticAccessExpression(entityName) && getElementOrPropertyAccessName(entityName) === "prototype") { 10815 return 9 /* ObjectDefinePrototypeProperty */; 10816 } 10817 return 7 /* ObjectDefinePropertyValue */; 10818 } 10819 if (expr.operatorToken.kind !== 63 /* EqualsToken */ || !isAccessExpression(expr.left) || isVoidZero(getRightMostAssignedExpression(expr))) { 10820 return 0 /* None */; 10821 } 10822 if (isBindableStaticNameExpression(expr.left.expression, true) && getElementOrPropertyAccessName(expr.left) === "prototype" && isObjectLiteralExpression(getInitializerOfBinaryExpression(expr))) { 10823 return 6 /* Prototype */; 10824 } 10825 return getAssignmentDeclarationPropertyAccessKind(expr.left); 10826} 10827function isVoidZero(node) { 10828 return isVoidExpression(node) && isNumericLiteral(node.expression) && node.expression.text === "0"; 10829} 10830function getElementOrPropertyAccessArgumentExpressionOrName(node) { 10831 if (isPropertyAccessExpression(node)) { 10832 return node.name; 10833 } 10834 const arg = skipParentheses(node.argumentExpression); 10835 if (isNumericLiteral(arg) || isStringLiteralLike(arg)) { 10836 return arg; 10837 } 10838 return node; 10839} 10840function getElementOrPropertyAccessName(node) { 10841 const name = getElementOrPropertyAccessArgumentExpressionOrName(node); 10842 if (name) { 10843 if (isIdentifier(name)) { 10844 return name.escapedText; 10845 } 10846 if (isStringLiteralLike(name) || isNumericLiteral(name)) { 10847 return escapeLeadingUnderscores(name.text); 10848 } 10849 } 10850 return void 0; 10851} 10852function getAssignmentDeclarationPropertyAccessKind(lhs) { 10853 if (lhs.expression.kind === 109 /* ThisKeyword */) { 10854 return 4 /* ThisProperty */; 10855 } else if (isModuleExportsAccessExpression(lhs)) { 10856 return 2 /* ModuleExports */; 10857 } else if (isBindableStaticNameExpression(lhs.expression, true)) { 10858 if (isPrototypeAccess(lhs.expression)) { 10859 return 3 /* PrototypeProperty */; 10860 } 10861 let nextToLast = lhs; 10862 while (!isIdentifier(nextToLast.expression)) { 10863 nextToLast = nextToLast.expression; 10864 } 10865 const id = nextToLast.expression; 10866 if ((id.escapedText === "exports" || id.escapedText === "module" && getElementOrPropertyAccessName(nextToLast) === "exports") && isBindableStaticAccessExpression(lhs)) { 10867 return 1 /* ExportsProperty */; 10868 } 10869 if (isBindableStaticNameExpression(lhs, true) || isElementAccessExpression(lhs) && isDynamicName(lhs)) { 10870 return 5 /* Property */; 10871 } 10872 } 10873 return 0 /* None */; 10874} 10875function getInitializerOfBinaryExpression(expr) { 10876 while (isBinaryExpression(expr.right)) { 10877 expr = expr.right; 10878 } 10879 return expr.right; 10880} 10881function isSpecialPropertyDeclaration(expr) { 10882 return isInJSFile(expr) && expr.parent && expr.parent.kind === 245 /* ExpressionStatement */ && (!isElementAccessExpression(expr) || isLiteralLikeElementAccess(expr)) && !!getJSDocTypeTag(expr.parent); 10883} 10884function setValueDeclaration(symbol, node) { 10885 const { valueDeclaration } = symbol; 10886 if (!valueDeclaration || !(node.flags & 16777216 /* Ambient */ && !(valueDeclaration.flags & 16777216 /* Ambient */)) && (isAssignmentDeclaration(valueDeclaration) && !isAssignmentDeclaration(node)) || valueDeclaration.kind !== node.kind && isEffectiveModuleDeclaration(valueDeclaration)) { 10887 symbol.valueDeclaration = node; 10888 } 10889} 10890function isFunctionSymbol(symbol) { 10891 if (!symbol || !symbol.valueDeclaration) { 10892 return false; 10893 } 10894 const decl = symbol.valueDeclaration; 10895 return decl.kind === 263 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer); 10896} 10897function getExternalModuleName(node) { 10898 switch (node.kind) { 10899 case 275 /* ImportDeclaration */: 10900 case 281 /* ExportDeclaration */: 10901 return node.moduleSpecifier; 10902 case 274 /* ImportEqualsDeclaration */: 10903 return node.moduleReference.kind === 286 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0; 10904 case 205 /* ImportType */: 10905 return isLiteralImportTypeNode(node) ? node.argument.literal : void 0; 10906 case 213 /* CallExpression */: 10907 return node.arguments[0]; 10908 case 270 /* ModuleDeclaration */: 10909 return node.name.kind === 10 /* StringLiteral */ ? node.name : void 0; 10910 default: 10911 return Debug.assertNever(node); 10912 } 10913} 10914function isJSDocConstructSignature(node) { 10915 const param = isJSDocFunctionType(node) ? firstOrUndefined(node.parameters) : void 0; 10916 const name = tryCast(param && param.name, isIdentifier); 10917 return !!name && name.escapedText === "new"; 10918} 10919function isJSDocTypeAlias(node) { 10920 return node.kind === 354 /* JSDocTypedefTag */ || node.kind === 347 /* JSDocCallbackTag */ || node.kind === 348 /* JSDocEnumTag */; 10921} 10922function getSourceOfAssignment(node) { 10923 return isExpressionStatement(node) && isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 63 /* EqualsToken */ ? getRightMostAssignedExpression(node.expression) : void 0; 10924} 10925function getSourceOfDefaultedAssignment(node) { 10926 return isExpressionStatement(node) && isBinaryExpression(node.expression) && getAssignmentDeclarationKind(node.expression) !== 0 /* None */ && isBinaryExpression(node.expression.right) && (node.expression.right.operatorToken.kind === 56 /* BarBarToken */ || node.expression.right.operatorToken.kind === 60 /* QuestionQuestionToken */) ? node.expression.right.right : void 0; 10927} 10928function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { 10929 switch (node.kind) { 10930 case 244 /* VariableStatement */: 10931 const v = getSingleVariableOfVariableStatement(node); 10932 return v && v.initializer; 10933 case 171 /* PropertyDeclaration */: 10934 return node.initializer; 10935 case 172 /* AnnotationPropertyDeclaration */: 10936 return node.initializer; 10937 case 305 /* PropertyAssignment */: 10938 return node.initializer; 10939 } 10940} 10941function getSingleVariableOfVariableStatement(node) { 10942 return isVariableStatement(node) ? firstOrUndefined(node.declarationList.declarations) : void 0; 10943} 10944function getNestedModuleDeclaration(node) { 10945 return isModuleDeclaration(node) && node.body && node.body.kind === 270 /* ModuleDeclaration */ ? node.body : void 0; 10946} 10947function getJSDocCommentsAndTags(hostNode, noCache) { 10948 let result; 10949 if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) { 10950 result = addRange(result, filterOwnedJSDocTags(hostNode, last(hostNode.initializer.jsDoc))); 10951 } 10952 let node = hostNode; 10953 while (node && node.parent) { 10954 if (hasJSDocNodes(node)) { 10955 result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc))); 10956 } 10957 if (node.kind === 168 /* Parameter */) { 10958 result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node)); 10959 break; 10960 } 10961 if (node.kind === 167 /* TypeParameter */) { 10962 result = addRange(result, (noCache ? getJSDocTypeParameterTagsNoCache : getJSDocTypeParameterTags)(node)); 10963 break; 10964 } 10965 node = getNextJSDocCommentLocation(node); 10966 } 10967 return result || emptyArray; 10968} 10969function filterOwnedJSDocTags(hostNode, jsDoc) { 10970 if (isJSDoc(jsDoc)) { 10971 const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag)); 10972 return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags; 10973 } 10974 return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0; 10975} 10976function ownsJSDocTag(hostNode, tag) { 10977 return !isJSDocTypeTag(tag) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode; 10978} 10979function getNextJSDocCommentLocation(node) { 10980 const parent = node.parent; 10981 if (parent.kind === 305 /* PropertyAssignment */ || parent.kind === 280 /* ExportAssignment */ || parent.kind === 171 /* PropertyDeclaration */ || parent.kind === 245 /* ExpressionStatement */ && node.kind === 211 /* PropertyAccessExpression */ || parent.kind === 254 /* ReturnStatement */ || getNestedModuleDeclaration(parent) || isBinaryExpression(node) && node.operatorToken.kind === 63 /* EqualsToken */) { 10982 return parent; 10983 } else if (parent.parent && (getSingleVariableOfVariableStatement(parent.parent) === node || isBinaryExpression(parent) && parent.operatorToken.kind === 63 /* EqualsToken */)) { 10984 return parent.parent; 10985 } else if (parent.parent && parent.parent.parent && (getSingleVariableOfVariableStatement(parent.parent.parent) || getSingleInitializerOfVariableStatementOrPropertyDeclaration(parent.parent.parent) === node || getSourceOfDefaultedAssignment(parent.parent.parent))) { 10986 return parent.parent.parent; 10987 } 10988} 10989function getEffectiveContainerForJSDocTemplateTag(node) { 10990 if (isJSDoc(node.parent) && node.parent.tags) { 10991 const typeAlias = find(node.parent.tags, isJSDocTypeAlias); 10992 if (typeAlias) { 10993 return typeAlias; 10994 } 10995 } 10996 return getHostSignatureFromJSDoc(node); 10997} 10998function getHostSignatureFromJSDoc(node) { 10999 const host = getEffectiveJSDocHost(node); 11000 if (host) { 11001 return isPropertySignature(host) && host.type && isFunctionLike(host.type) ? host.type : isFunctionLike(host) ? host : void 0; 11002 } 11003 return void 0; 11004} 11005function getEffectiveJSDocHost(node) { 11006 const host = getJSDocHost(node); 11007 if (host) { 11008 return getSourceOfDefaultedAssignment(host) || getSourceOfAssignment(host) || getSingleInitializerOfVariableStatementOrPropertyDeclaration(host) || getSingleVariableOfVariableStatement(host) || getNestedModuleDeclaration(host) || host; 11009 } 11010} 11011function getJSDocHost(node) { 11012 const jsDoc = getJSDocRoot(node); 11013 if (!jsDoc) { 11014 return void 0; 11015 } 11016 const host = jsDoc.parent; 11017 if (host && host.jsDoc && jsDoc === lastOrUndefined(host.jsDoc)) { 11018 return host; 11019 } 11020} 11021function getJSDocRoot(node) { 11022 return findAncestor(node.parent, isJSDoc); 11023} 11024function getAssignmentTargetKind(node) { 11025 let parent = node.parent; 11026 while (true) { 11027 switch (parent.kind) { 11028 case 227 /* BinaryExpression */: 11029 const binaryOperator = parent.operatorToken.kind; 11030 return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 63 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; 11031 case 225 /* PrefixUnaryExpression */: 11032 case 226 /* PostfixUnaryExpression */: 11033 const unaryOperator = parent.operator; 11034 return unaryOperator === 45 /* PlusPlusToken */ || unaryOperator === 46 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; 11035 case 250 /* ForInStatement */: 11036 case 251 /* ForOfStatement */: 11037 return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; 11038 case 217 /* ParenthesizedExpression */: 11039 case 209 /* ArrayLiteralExpression */: 11040 case 231 /* SpreadElement */: 11041 case 236 /* NonNullExpression */: 11042 node = parent; 11043 break; 11044 case 307 /* SpreadAssignment */: 11045 node = parent.parent; 11046 break; 11047 case 306 /* ShorthandPropertyAssignment */: 11048 if (parent.name !== node) { 11049 return 0 /* None */; 11050 } 11051 node = parent.parent; 11052 break; 11053 case 305 /* PropertyAssignment */: 11054 if (parent.name === node) { 11055 return 0 /* None */; 11056 } 11057 node = parent.parent; 11058 break; 11059 default: 11060 return 0 /* None */; 11061 } 11062 parent = node.parent; 11063 } 11064} 11065function isAssignmentTarget(node) { 11066 return getAssignmentTargetKind(node) !== 0 /* None */; 11067} 11068function skipParentheses(node, excludeJSDocTypeAssertions) { 11069 const flags = excludeJSDocTypeAssertions ? 1 /* Parentheses */ | 16 /* ExcludeJSDocTypeAssertion */ : 1 /* Parentheses */; 11070 return skipOuterExpressions(node, flags); 11071} 11072function isNodeDescendantOf(node, ancestor) { 11073 while (node) { 11074 if (node === ancestor) 11075 return true; 11076 node = node.parent; 11077 } 11078 return false; 11079} 11080function isIdentifierName(node) { 11081 const parent = node.parent; 11082 switch (parent.kind) { 11083 case 171 /* PropertyDeclaration */: 11084 case 172 /* AnnotationPropertyDeclaration */: 11085 case 170 /* PropertySignature */: 11086 case 174 /* MethodDeclaration */: 11087 case 173 /* MethodSignature */: 11088 case 177 /* GetAccessor */: 11089 case 178 /* SetAccessor */: 11090 case 308 /* EnumMember */: 11091 case 305 /* PropertyAssignment */: 11092 case 211 /* PropertyAccessExpression */: 11093 return parent.name === node; 11094 case 165 /* QualifiedName */: 11095 return parent.right === node; 11096 case 208 /* BindingElement */: 11097 case 279 /* ImportSpecifier */: 11098 return parent.propertyName === node; 11099 case 284 /* ExportSpecifier */: 11100 case 294 /* JsxAttribute */: 11101 case 288 /* JsxSelfClosingElement */: 11102 case 289 /* JsxOpeningElement */: 11103 case 290 /* JsxClosingElement */: 11104 return true; 11105 } 11106 return false; 11107} 11108function isAliasableExpression(e) { 11109 return isEntityNameExpression(e) || isClassExpression(e); 11110} 11111function exportAssignmentIsAlias(node) { 11112 const e = getExportAssignmentExpression(node); 11113 return isAliasableExpression(e); 11114} 11115function getExportAssignmentExpression(node) { 11116 return isExportAssignment(node) ? node.expression : node.right; 11117} 11118function getRootComponent(node, compilerOptions) { 11119 var _a2, _b, _c; 11120 while (node) { 11121 if (isEtsComponentExpression(node)) { 11122 return [node, "etsComponentType"]; 11123 } else if (isCallExpression(node) && isIdentifier(node.expression)) { 11124 if ((_c = (_b = (_a2 = compilerOptions.ets) == null ? void 0 : _a2.syntaxComponents) == null ? void 0 : _b.attrUICallback) == null ? void 0 : _c.map((item) => item.name).includes(node.expression.escapedText.toString())) { 11125 return [node, "callExpressionComponentType"]; 11126 } else { 11127 return [node, "otherType"]; 11128 } 11129 } 11130 node = node.expression; 11131 } 11132 return [void 0, void 0]; 11133} 11134function getVirtualEtsComponent(node) { 11135 while (node) { 11136 if (isPropertyAccessExpression(node) && node.expression && node.expression.virtual) { 11137 return node; 11138 } 11139 node = node.expression; 11140 } 11141 return void 0; 11142} 11143function isKeyword(token) { 11144 return 81 /* FirstKeyword */ <= token && token <= 164 /* LastKeyword */; 11145} 11146function isAsyncFunction(node) { 11147 switch (node.kind) { 11148 case 263 /* FunctionDeclaration */: 11149 case 218 /* FunctionExpression */: 11150 case 219 /* ArrowFunction */: 11151 case 174 /* MethodDeclaration */: 11152 return node.body !== void 0 && node.asteriskToken === void 0 && hasSyntacticModifier(node, 512 /* Async */); 11153 } 11154 return false; 11155} 11156function isStringOrNumericLiteralLike(node) { 11157 return isStringLiteralLike(node) || isNumericLiteral(node); 11158} 11159function isSignedNumericLiteral(node) { 11160 return isPrefixUnaryExpression(node) && (node.operator === 39 /* PlusToken */ || node.operator === 40 /* MinusToken */) && isNumericLiteral(node.operand); 11161} 11162function hasDynamicName(declaration) { 11163 const name = getNameOfDeclaration(declaration); 11164 return !!name && isDynamicName(name); 11165} 11166function isDynamicName(name) { 11167 if (!(name.kind === 166 /* ComputedPropertyName */ || name.kind === 212 /* ElementAccessExpression */)) { 11168 return false; 11169 } 11170 const expr = isElementAccessExpression(name) ? skipParentheses(name.argumentExpression) : name.expression; 11171 return !isStringOrNumericLiteralLike(expr) && !isSignedNumericLiteral(expr); 11172} 11173function getPropertyNameForPropertyNameNode(name) { 11174 switch (name.kind) { 11175 case 79 /* Identifier */: 11176 case 80 /* PrivateIdentifier */: 11177 return name.escapedText; 11178 case 10 /* StringLiteral */: 11179 case 8 /* NumericLiteral */: 11180 return escapeLeadingUnderscores(name.text); 11181 case 166 /* ComputedPropertyName */: 11182 const nameExpression = name.expression; 11183 if (isStringOrNumericLiteralLike(nameExpression)) { 11184 return escapeLeadingUnderscores(nameExpression.text); 11185 } else if (isSignedNumericLiteral(nameExpression)) { 11186 if (nameExpression.operator === 40 /* MinusToken */) { 11187 return tokenToString(nameExpression.operator) + nameExpression.operand.text; 11188 } 11189 return nameExpression.operand.text; 11190 } 11191 return void 0; 11192 default: 11193 return Debug.assertNever(name); 11194 } 11195} 11196function isPropertyNameLiteral(node) { 11197 switch (node.kind) { 11198 case 79 /* Identifier */: 11199 case 10 /* StringLiteral */: 11200 case 14 /* NoSubstitutionTemplateLiteral */: 11201 case 8 /* NumericLiteral */: 11202 return true; 11203 default: 11204 return false; 11205 } 11206} 11207function getTextOfIdentifierOrLiteral(node) { 11208 return isMemberName(node) ? idText(node) : node.text; 11209} 11210function getEscapedTextOfIdentifierOrLiteral(node) { 11211 return isMemberName(node) ? node.escapedText : escapeLeadingUnderscores(node.text); 11212} 11213function getSymbolNameForPrivateIdentifier(containingClassSymbol, description) { 11214 return `__#${getSymbolId(containingClassSymbol)}@${description}`; 11215} 11216function isPushOrUnshiftIdentifier(node) { 11217 return node.escapedText === "push" || node.escapedText === "unshift"; 11218} 11219function isParameterDeclaration(node) { 11220 const root = getRootDeclaration(node); 11221 return root.kind === 168 /* Parameter */; 11222} 11223function getRootDeclaration(node) { 11224 while (node.kind === 208 /* BindingElement */) { 11225 node = node.parent.parent; 11226 } 11227 return node; 11228} 11229function nodeIsSynthesized(range) { 11230 return positionIsSynthesized(range.pos) || positionIsSynthesized(range.end); 11231} 11232function getExpressionAssociativity(expression) { 11233 const operator = getOperator(expression); 11234 const hasArguments = expression.kind === 214 /* NewExpression */ && expression.arguments !== void 0; 11235 return getOperatorAssociativity(expression.kind, operator, hasArguments); 11236} 11237function getOperatorAssociativity(kind, operator, hasArguments) { 11238 switch (kind) { 11239 case 214 /* NewExpression */: 11240 return hasArguments ? 0 /* Left */ : 1 /* Right */; 11241 case 225 /* PrefixUnaryExpression */: 11242 case 222 /* TypeOfExpression */: 11243 case 223 /* VoidExpression */: 11244 case 221 /* DeleteExpression */: 11245 case 224 /* AwaitExpression */: 11246 case 228 /* ConditionalExpression */: 11247 case 230 /* YieldExpression */: 11248 return 1 /* Right */; 11249 case 227 /* BinaryExpression */: 11250 switch (operator) { 11251 case 42 /* AsteriskAsteriskToken */: 11252 case 63 /* EqualsToken */: 11253 case 64 /* PlusEqualsToken */: 11254 case 65 /* MinusEqualsToken */: 11255 case 67 /* AsteriskAsteriskEqualsToken */: 11256 case 66 /* AsteriskEqualsToken */: 11257 case 68 /* SlashEqualsToken */: 11258 case 69 /* PercentEqualsToken */: 11259 case 70 /* LessThanLessThanEqualsToken */: 11260 case 71 /* GreaterThanGreaterThanEqualsToken */: 11261 case 72 /* GreaterThanGreaterThanGreaterThanEqualsToken */: 11262 case 73 /* AmpersandEqualsToken */: 11263 case 78 /* CaretEqualsToken */: 11264 case 74 /* BarEqualsToken */: 11265 case 75 /* BarBarEqualsToken */: 11266 case 76 /* AmpersandAmpersandEqualsToken */: 11267 case 77 /* QuestionQuestionEqualsToken */: 11268 return 1 /* Right */; 11269 } 11270 } 11271 return 0 /* Left */; 11272} 11273function getExpressionPrecedence(expression) { 11274 const operator = getOperator(expression); 11275 const hasArguments = expression.kind === 214 /* NewExpression */ && expression.arguments !== void 0; 11276 return getOperatorPrecedence(expression.kind, operator, hasArguments); 11277} 11278function getOperator(expression) { 11279 if (expression.kind === 227 /* BinaryExpression */) { 11280 return expression.operatorToken.kind; 11281 } else if (expression.kind === 225 /* PrefixUnaryExpression */ || expression.kind === 226 /* PostfixUnaryExpression */) { 11282 return expression.operator; 11283 } else { 11284 return expression.kind; 11285 } 11286} 11287function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { 11288 switch (nodeKind) { 11289 case 360 /* CommaListExpression */: 11290 return 0 /* Comma */; 11291 case 231 /* SpreadElement */: 11292 return 1 /* Spread */; 11293 case 230 /* YieldExpression */: 11294 return 2 /* Yield */; 11295 case 228 /* ConditionalExpression */: 11296 return 4 /* Conditional */; 11297 case 227 /* BinaryExpression */: 11298 switch (operatorKind) { 11299 case 27 /* CommaToken */: 11300 return 0 /* Comma */; 11301 case 63 /* EqualsToken */: 11302 case 64 /* PlusEqualsToken */: 11303 case 65 /* MinusEqualsToken */: 11304 case 67 /* AsteriskAsteriskEqualsToken */: 11305 case 66 /* AsteriskEqualsToken */: 11306 case 68 /* SlashEqualsToken */: 11307 case 69 /* PercentEqualsToken */: 11308 case 70 /* LessThanLessThanEqualsToken */: 11309 case 71 /* GreaterThanGreaterThanEqualsToken */: 11310 case 72 /* GreaterThanGreaterThanGreaterThanEqualsToken */: 11311 case 73 /* AmpersandEqualsToken */: 11312 case 78 /* CaretEqualsToken */: 11313 case 74 /* BarEqualsToken */: 11314 case 75 /* BarBarEqualsToken */: 11315 case 76 /* AmpersandAmpersandEqualsToken */: 11316 case 77 /* QuestionQuestionEqualsToken */: 11317 return 3 /* Assignment */; 11318 default: 11319 return getBinaryOperatorPrecedence(operatorKind); 11320 } 11321 case 216 /* TypeAssertionExpression */: 11322 case 236 /* NonNullExpression */: 11323 case 225 /* PrefixUnaryExpression */: 11324 case 222 /* TypeOfExpression */: 11325 case 223 /* VoidExpression */: 11326 case 221 /* DeleteExpression */: 11327 case 224 /* AwaitExpression */: 11328 return 16 /* Unary */; 11329 case 226 /* PostfixUnaryExpression */: 11330 return 17 /* Update */; 11331 case 213 /* CallExpression */: 11332 return 18 /* LeftHandSide */; 11333 case 214 /* NewExpression */: 11334 return hasArguments ? 19 /* Member */ : 18 /* LeftHandSide */; 11335 case 215 /* TaggedTemplateExpression */: 11336 case 211 /* PropertyAccessExpression */: 11337 case 212 /* ElementAccessExpression */: 11338 case 237 /* MetaProperty */: 11339 return 19 /* Member */; 11340 case 235 /* AsExpression */: 11341 case 239 /* SatisfiesExpression */: 11342 return 11 /* Relational */; 11343 case 109 /* ThisKeyword */: 11344 case 107 /* SuperKeyword */: 11345 case 79 /* Identifier */: 11346 case 80 /* PrivateIdentifier */: 11347 case 105 /* NullKeyword */: 11348 case 111 /* TrueKeyword */: 11349 case 96 /* FalseKeyword */: 11350 case 8 /* NumericLiteral */: 11351 case 9 /* BigIntLiteral */: 11352 case 10 /* StringLiteral */: 11353 case 209 /* ArrayLiteralExpression */: 11354 case 210 /* ObjectLiteralExpression */: 11355 case 218 /* FunctionExpression */: 11356 case 219 /* ArrowFunction */: 11357 case 232 /* ClassExpression */: 11358 case 13 /* RegularExpressionLiteral */: 11359 case 14 /* NoSubstitutionTemplateLiteral */: 11360 case 229 /* TemplateExpression */: 11361 case 217 /* ParenthesizedExpression */: 11362 case 233 /* OmittedExpression */: 11363 case 287 /* JsxElement */: 11364 case 288 /* JsxSelfClosingElement */: 11365 case 291 /* JsxFragment */: 11366 return 20 /* Primary */; 11367 default: 11368 return -1 /* Invalid */; 11369 } 11370} 11371function getBinaryOperatorPrecedence(kind) { 11372 switch (kind) { 11373 case 60 /* QuestionQuestionToken */: 11374 return 4 /* Coalesce */; 11375 case 56 /* BarBarToken */: 11376 return 5 /* LogicalOR */; 11377 case 55 /* AmpersandAmpersandToken */: 11378 return 6 /* LogicalAND */; 11379 case 51 /* BarToken */: 11380 return 7 /* BitwiseOR */; 11381 case 52 /* CaretToken */: 11382 return 8 /* BitwiseXOR */; 11383 case 50 /* AmpersandToken */: 11384 return 9 /* BitwiseAND */; 11385 case 34 /* EqualsEqualsToken */: 11386 case 35 /* ExclamationEqualsToken */: 11387 case 36 /* EqualsEqualsEqualsToken */: 11388 case 37 /* ExclamationEqualsEqualsToken */: 11389 return 10 /* Equality */; 11390 case 29 /* LessThanToken */: 11391 case 31 /* GreaterThanToken */: 11392 case 32 /* LessThanEqualsToken */: 11393 case 33 /* GreaterThanEqualsToken */: 11394 case 103 /* InstanceOfKeyword */: 11395 case 102 /* InKeyword */: 11396 case 129 /* AsKeyword */: 11397 case 151 /* SatisfiesKeyword */: 11398 return 11 /* Relational */; 11399 case 47 /* LessThanLessThanToken */: 11400 case 48 /* GreaterThanGreaterThanToken */: 11401 case 49 /* GreaterThanGreaterThanGreaterThanToken */: 11402 return 12 /* Shift */; 11403 case 39 /* PlusToken */: 11404 case 40 /* MinusToken */: 11405 return 13 /* Additive */; 11406 case 41 /* AsteriskToken */: 11407 case 43 /* SlashToken */: 11408 case 44 /* PercentToken */: 11409 return 14 /* Multiplicative */; 11410 case 42 /* AsteriskAsteriskToken */: 11411 return 15 /* Exponentiation */; 11412 } 11413 return -1; 11414} 11415var templateSubstitutionRegExp = /\$\{/g; 11416function escapeTemplateSubstitution(str) { 11417 return str.replace(templateSubstitutionRegExp, "\\${"); 11418} 11419function hasInvalidEscape(template) { 11420 return template && !!(isNoSubstitutionTemplateLiteral(template) ? template.templateFlags : template.head.templateFlags || some(template.templateSpans, (span) => !!span.literal.templateFlags)); 11421} 11422var doubleQuoteEscapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; 11423var singleQuoteEscapedCharsRegExp = /[\\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; 11424var backtickQuoteEscapedCharsRegExp = /\r\n|[\\\`\u0000-\u001f\t\v\f\b\r\u2028\u2029\u0085]/g; 11425var escapedCharsMap = new Map2(getEntries({ 11426 " ": "\\t", 11427 "\v": "\\v", 11428 "\f": "\\f", 11429 "\b": "\\b", 11430 "\r": "\\r", 11431 "\n": "\\n", 11432 "\\": "\\\\", 11433 '"': '\\"', 11434 "'": "\\'", 11435 "`": "\\`", 11436 "\u2028": "\\u2028", 11437 "\u2029": "\\u2029", 11438 "\x85": "\\u0085", 11439 "\r\n": "\\r\\n" 11440})); 11441function encodeUtf16EscapeSequence(charCode) { 11442 const hexCharCode = charCode.toString(16).toUpperCase(); 11443 const paddedHexCode = ("0000" + hexCharCode).slice(-4); 11444 return "\\u" + paddedHexCode; 11445} 11446function getReplacement(c, offset, input) { 11447 if (c.charCodeAt(0) === 0 /* nullCharacter */) { 11448 const lookAhead = input.charCodeAt(offset + c.length); 11449 if (lookAhead >= 48 /* _0 */ && lookAhead <= 57 /* _9 */) { 11450 return "\\x00"; 11451 } 11452 return "\\0"; 11453 } 11454 return escapedCharsMap.get(c) || encodeUtf16EscapeSequence(c.charCodeAt(0)); 11455} 11456function escapeString(s, quoteChar) { 11457 const escapedCharsRegExp = quoteChar === 96 /* backtick */ ? backtickQuoteEscapedCharsRegExp : quoteChar === 39 /* singleQuote */ ? singleQuoteEscapedCharsRegExp : doubleQuoteEscapedCharsRegExp; 11458 return s.replace(escapedCharsRegExp, getReplacement); 11459} 11460var nonAsciiCharacters = /[^\u0000-\u007F]/g; 11461function escapeNonAsciiString(s, quoteChar) { 11462 s = escapeString(s, quoteChar); 11463 return nonAsciiCharacters.test(s) ? s.replace(nonAsciiCharacters, (c) => encodeUtf16EscapeSequence(c.charCodeAt(0))) : s; 11464} 11465var jsxDoubleQuoteEscapedCharsRegExp = /[\"\u0000-\u001f\u2028\u2029\u0085]/g; 11466var jsxSingleQuoteEscapedCharsRegExp = /[\'\u0000-\u001f\u2028\u2029\u0085]/g; 11467var jsxEscapedCharsMap = new Map2(getEntries({ 11468 '"': """, 11469 "'": "'" 11470})); 11471function encodeJsxCharacterEntity(charCode) { 11472 const hexCharCode = charCode.toString(16).toUpperCase(); 11473 return "&#x" + hexCharCode + ";"; 11474} 11475function getJsxAttributeStringReplacement(c) { 11476 if (c.charCodeAt(0) === 0 /* nullCharacter */) { 11477 return "�"; 11478 } 11479 return jsxEscapedCharsMap.get(c) || encodeJsxCharacterEntity(c.charCodeAt(0)); 11480} 11481function escapeJsxAttributeString(s, quoteChar) { 11482 const escapedCharsRegExp = quoteChar === 39 /* singleQuote */ ? jsxSingleQuoteEscapedCharsRegExp : jsxDoubleQuoteEscapedCharsRegExp; 11483 return s.replace(escapedCharsRegExp, getJsxAttributeStringReplacement); 11484} 11485var indentStrings = ["", " "]; 11486function getIndentString(level) { 11487 const singleLevel = indentStrings[1]; 11488 for (let current = indentStrings.length; current <= level; current++) { 11489 indentStrings.push(indentStrings[current - 1] + singleLevel); 11490 } 11491 return indentStrings[level]; 11492} 11493function getIndentSize() { 11494 return indentStrings[1].length; 11495} 11496function getTrailingSemicolonDeferringWriter(writer) { 11497 let pendingTrailingSemicolon = false; 11498 function commitPendingTrailingSemicolon() { 11499 if (pendingTrailingSemicolon) { 11500 writer.writeTrailingSemicolon(";"); 11501 pendingTrailingSemicolon = false; 11502 } 11503 } 11504 return { 11505 ...writer, 11506 writeTrailingSemicolon() { 11507 pendingTrailingSemicolon = true; 11508 }, 11509 writeLiteral(s) { 11510 commitPendingTrailingSemicolon(); 11511 writer.writeLiteral(s); 11512 }, 11513 writeStringLiteral(s) { 11514 commitPendingTrailingSemicolon(); 11515 writer.writeStringLiteral(s); 11516 }, 11517 writeSymbol(s, sym) { 11518 commitPendingTrailingSemicolon(); 11519 writer.writeSymbol(s, sym); 11520 }, 11521 writePunctuation(s) { 11522 commitPendingTrailingSemicolon(); 11523 writer.writePunctuation(s); 11524 }, 11525 writeKeyword(s) { 11526 commitPendingTrailingSemicolon(); 11527 writer.writeKeyword(s); 11528 }, 11529 writeOperator(s) { 11530 commitPendingTrailingSemicolon(); 11531 writer.writeOperator(s); 11532 }, 11533 writeParameter(s) { 11534 commitPendingTrailingSemicolon(); 11535 writer.writeParameter(s); 11536 }, 11537 writeSpace(s) { 11538 commitPendingTrailingSemicolon(); 11539 writer.writeSpace(s); 11540 }, 11541 writeProperty(s) { 11542 commitPendingTrailingSemicolon(); 11543 writer.writeProperty(s); 11544 }, 11545 writeComment(s) { 11546 commitPendingTrailingSemicolon(); 11547 writer.writeComment(s); 11548 }, 11549 writeLine() { 11550 commitPendingTrailingSemicolon(); 11551 writer.writeLine(); 11552 }, 11553 increaseIndent() { 11554 commitPendingTrailingSemicolon(); 11555 writer.increaseIndent(); 11556 }, 11557 decreaseIndent() { 11558 commitPendingTrailingSemicolon(); 11559 writer.decreaseIndent(); 11560 } 11561 }; 11562} 11563function hostUsesCaseSensitiveFileNames(host) { 11564 return host.useCaseSensitiveFileNames ? host.useCaseSensitiveFileNames() : false; 11565} 11566function hostGetCanonicalFileName(host) { 11567 return createGetCanonicalFileName(hostUsesCaseSensitiveFileNames(host)); 11568} 11569function getPossibleOriginalInputExtensionForExtension(path2) { 11570 return fileExtensionIsOneOf(path2, [".d.mts" /* Dmts */, ".mjs" /* Mjs */, ".mts" /* Mts */]) ? [".mts" /* Mts */, ".mjs" /* Mjs */] : fileExtensionIsOneOf(path2, [".d.cts" /* Dcts */, ".cjs" /* Cjs */, ".cts" /* Cts */]) ? [".cts" /* Cts */, ".cjs" /* Cjs */] : fileExtensionIsOneOf(path2, [`.json.d.ts`]) ? [".json" /* Json */] : [".tsx" /* Tsx */, ".ts" /* Ts */, ".jsx" /* Jsx */, ".js" /* Js */]; 11571} 11572function outFile(options) { 11573 return options.outFile || options.out; 11574} 11575function getPathsBasePath(options, host) { 11576 var _a2, _b; 11577 if (!options.paths) 11578 return void 0; 11579 return (_b = options.baseUrl) != null ? _b : Debug.checkDefined(options.pathsBasePath || ((_a2 = host.getCurrentDirectory) == null ? void 0 : _a2.call(host)), "Encountered 'paths' without a 'baseUrl', config file, or host 'getCurrentDirectory'."); 11580} 11581function ensureDirectoriesExist(directoryPath, createDirectory, directoryExists) { 11582 if (directoryPath.length > getRootLength(directoryPath) && !directoryExists(directoryPath)) { 11583 const parentDirectory = getDirectoryPath(directoryPath); 11584 ensureDirectoriesExist(parentDirectory, createDirectory, directoryExists); 11585 createDirectory(directoryPath); 11586 } 11587} 11588function writeFileEnsuringDirectories(path2, data, writeByteOrderMark, writeFile2, createDirectory, directoryExists) { 11589 try { 11590 writeFile2(path2, data, writeByteOrderMark); 11591 } catch (e) { 11592 ensureDirectoriesExist(getDirectoryPath(normalizePath(path2)), createDirectory, directoryExists); 11593 writeFile2(path2, data, writeByteOrderMark); 11594 } 11595} 11596function getLineOfLocalPositionFromLineMap(lineMap, pos) { 11597 return computeLineOfPosition(lineMap, pos); 11598} 11599function isThisIdentifier(node) { 11600 return !!node && node.kind === 79 /* Identifier */ && identifierIsThisKeyword(node); 11601} 11602function identifierIsThisKeyword(id) { 11603 return id.originalKeywordKind === 109 /* ThisKeyword */; 11604} 11605function emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments) { 11606 emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, node.pos, leadingComments); 11607} 11608function emitNewLineBeforeLeadingCommentsOfPosition(lineMap, writer, pos, leadingComments) { 11609 if (leadingComments && leadingComments.length && pos !== leadingComments[0].pos && getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, leadingComments[0].pos)) { 11610 writer.writeLine(); 11611 } 11612} 11613function emitNewLineBeforeLeadingCommentOfPosition(lineMap, writer, pos, commentPos) { 11614 if (pos !== commentPos && getLineOfLocalPositionFromLineMap(lineMap, pos) !== getLineOfLocalPositionFromLineMap(lineMap, commentPos)) { 11615 writer.writeLine(); 11616 } 11617} 11618function emitComments(text, lineMap, writer, comments, leadingSeparator, trailingSeparator, newLine, writeComment) { 11619 if (comments && comments.length > 0) { 11620 if (leadingSeparator) { 11621 writer.writeSpace(" "); 11622 } 11623 let emitInterveningSeparator = false; 11624 for (const comment of comments) { 11625 if (emitInterveningSeparator) { 11626 writer.writeSpace(" "); 11627 emitInterveningSeparator = false; 11628 } 11629 writeComment(text, lineMap, writer, comment.pos, comment.end, newLine); 11630 if (comment.hasTrailingNewLine) { 11631 writer.writeLine(); 11632 } else { 11633 emitInterveningSeparator = true; 11634 } 11635 } 11636 if (emitInterveningSeparator && trailingSeparator) { 11637 writer.writeSpace(" "); 11638 } 11639 } 11640} 11641function emitDetachedComments(text, lineMap, writer, writeComment, node, newLine, removeComments) { 11642 let leadingComments; 11643 let currentDetachedCommentInfo; 11644 if (removeComments) { 11645 if (node.pos === 0) { 11646 leadingComments = filter(getLeadingCommentRanges(text, node.pos), isPinnedCommentLocal); 11647 } 11648 } else { 11649 leadingComments = getLeadingCommentRanges(text, node.pos); 11650 } 11651 if (leadingComments) { 11652 const detachedComments = []; 11653 let lastComment; 11654 for (const comment of leadingComments) { 11655 if (lastComment) { 11656 const lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, lastComment.end); 11657 const commentLine = getLineOfLocalPositionFromLineMap(lineMap, comment.pos); 11658 if (commentLine >= lastCommentLine + 2) { 11659 break; 11660 } 11661 } 11662 detachedComments.push(comment); 11663 lastComment = comment; 11664 } 11665 if (detachedComments.length) { 11666 const lastCommentLine = getLineOfLocalPositionFromLineMap(lineMap, last(detachedComments).end); 11667 const nodeLine = getLineOfLocalPositionFromLineMap(lineMap, skipTrivia(text, node.pos)); 11668 if (nodeLine >= lastCommentLine + 2) { 11669 emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments); 11670 emitComments(text, lineMap, writer, detachedComments, false, true, newLine, writeComment); 11671 currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: last(detachedComments).end }; 11672 } 11673 } 11674 } 11675 return currentDetachedCommentInfo; 11676 function isPinnedCommentLocal(comment) { 11677 return isPinnedComment(text, comment.pos); 11678 } 11679} 11680function writeCommentRange(text, lineMap, writer, commentPos, commentEnd, newLine) { 11681 if (text.charCodeAt(commentPos + 1) === 42 /* asterisk */) { 11682 const firstCommentLineAndCharacter = computeLineAndCharacterOfPosition(lineMap, commentPos); 11683 const lineCount = lineMap.length; 11684 let firstCommentLineIndent; 11685 for (let pos = commentPos, currentLine = firstCommentLineAndCharacter.line; pos < commentEnd; currentLine++) { 11686 const nextLineStart = currentLine + 1 === lineCount ? text.length + 1 : lineMap[currentLine + 1]; 11687 if (pos !== commentPos) { 11688 if (firstCommentLineIndent === void 0) { 11689 firstCommentLineIndent = calculateIndent(text, lineMap[firstCommentLineAndCharacter.line], commentPos); 11690 } 11691 const currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); 11692 const spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(text, pos, nextLineStart); 11693 if (spacesToEmit > 0) { 11694 let numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); 11695 const indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); 11696 writer.rawWrite(indentSizeSpaceString); 11697 while (numberOfSingleSpacesToEmit) { 11698 writer.rawWrite(" "); 11699 numberOfSingleSpacesToEmit--; 11700 } 11701 } else { 11702 writer.rawWrite(""); 11703 } 11704 } 11705 writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart); 11706 pos = nextLineStart; 11707 } 11708 } else { 11709 writer.writeComment(text.substring(commentPos, commentEnd)); 11710 } 11711} 11712function writeTrimmedCurrentLine(text, commentEnd, writer, newLine, pos, nextLineStart) { 11713 const end = Math.min(commentEnd, nextLineStart - 1); 11714 const currentLineText = trimString(text.substring(pos, end)); 11715 if (currentLineText) { 11716 writer.writeComment(currentLineText); 11717 if (end !== commentEnd) { 11718 writer.writeLine(); 11719 } 11720 } else { 11721 writer.rawWrite(newLine); 11722 } 11723} 11724function calculateIndent(text, pos, end) { 11725 let currentLineIndent = 0; 11726 for (; pos < end && isWhiteSpaceSingleLine(text.charCodeAt(pos)); pos++) { 11727 if (text.charCodeAt(pos) === 9 /* tab */) { 11728 currentLineIndent += getIndentSize() - currentLineIndent % getIndentSize(); 11729 } else { 11730 currentLineIndent++; 11731 } 11732 } 11733 return currentLineIndent; 11734} 11735function hasSyntacticModifier(node, flags) { 11736 return !!getSelectedSyntacticModifierFlags(node, flags); 11737} 11738function isStatic(node) { 11739 return isClassElement(node) && hasStaticModifier(node) || isClassStaticBlockDeclaration(node); 11740} 11741function hasIllegalDecorators(node) { 11742 return canHaveIllegalDecorators(node); 11743} 11744function hasStaticModifier(node) { 11745 return hasSyntacticModifier(node, 32 /* Static */); 11746} 11747function hasAccessorModifier(node) { 11748 return hasSyntacticModifier(node, 128 /* Accessor */); 11749} 11750function getSelectedSyntacticModifierFlags(node, flags) { 11751 return getSyntacticModifierFlags(node) & flags; 11752} 11753function getModifierFlagsWorker(node, includeJSDoc, alwaysIncludeJSDoc) { 11754 if (node.kind >= 0 /* FirstToken */ && node.kind <= 164 /* LastToken */) { 11755 return 0 /* None */; 11756 } 11757 if (!(node.modifierFlagsCache & 536870912 /* HasComputedFlags */)) { 11758 node.modifierFlagsCache = getSyntacticModifierFlagsNoCache(node) | 536870912 /* HasComputedFlags */; 11759 } 11760 if (includeJSDoc && !(node.modifierFlagsCache & 4096 /* HasComputedJSDocModifiers */) && (alwaysIncludeJSDoc || isInJSFile(node)) && node.parent) { 11761 node.modifierFlagsCache |= getJSDocModifierFlagsNoCache(node) | 4096 /* HasComputedJSDocModifiers */; 11762 } 11763 return node.modifierFlagsCache & ~(536870912 /* HasComputedFlags */ | 4096 /* HasComputedJSDocModifiers */); 11764} 11765function getEffectiveModifierFlags(node) { 11766 return getModifierFlagsWorker(node, true); 11767} 11768function getSyntacticModifierFlags(node) { 11769 return getModifierFlagsWorker(node, false); 11770} 11771function getJSDocModifierFlagsNoCache(node) { 11772 let flags = 0 /* None */; 11773 if (!!node.parent && !isParameter(node)) { 11774 if (isInJSFile(node)) { 11775 if (getJSDocPublicTagNoCache(node)) 11776 flags |= 4 /* Public */; 11777 if (getJSDocPrivateTagNoCache(node)) 11778 flags |= 8 /* Private */; 11779 if (getJSDocProtectedTagNoCache(node)) 11780 flags |= 16 /* Protected */; 11781 if (getJSDocReadonlyTagNoCache(node)) 11782 flags |= 64 /* Readonly */; 11783 if (getJSDocOverrideTagNoCache(node)) 11784 flags |= 16384 /* Override */; 11785 } 11786 if (getJSDocDeprecatedTagNoCache(node)) 11787 flags |= 8192 /* Deprecated */; 11788 } 11789 return flags; 11790} 11791function getEffectiveModifierFlagsNoCache(node) { 11792 return getSyntacticModifierFlagsNoCache(node) | getJSDocModifierFlagsNoCache(node); 11793} 11794function getSyntacticModifierFlagsNoCache(node) { 11795 let flags = canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0 /* None */; 11796 if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.isInJSDocNamespace) { 11797 flags |= 1 /* Export */; 11798 } 11799 return flags; 11800} 11801function modifiersToFlags(modifiers) { 11802 let flags = 0 /* None */; 11803 if (modifiers) { 11804 for (const modifier of modifiers) { 11805 flags |= modifierToFlag(modifier.kind); 11806 } 11807 } 11808 return flags; 11809} 11810function modifierToFlag(token) { 11811 switch (token) { 11812 case 125 /* StaticKeyword */: 11813 return 32 /* Static */; 11814 case 124 /* PublicKeyword */: 11815 return 4 /* Public */; 11816 case 123 /* ProtectedKeyword */: 11817 return 16 /* Protected */; 11818 case 122 /* PrivateKeyword */: 11819 return 8 /* Private */; 11820 case 127 /* AbstractKeyword */: 11821 return 256 /* Abstract */; 11822 case 128 /* AccessorKeyword */: 11823 return 128 /* Accessor */; 11824 case 94 /* ExportKeyword */: 11825 return 1 /* Export */; 11826 case 137 /* DeclareKeyword */: 11827 return 2 /* Ambient */; 11828 case 86 /* ConstKeyword */: 11829 return 2048 /* Const */; 11830 case 89 /* DefaultKeyword */: 11831 return 1024 /* Default */; 11832 case 133 /* AsyncKeyword */: 11833 return 512 /* Async */; 11834 case 147 /* ReadonlyKeyword */: 11835 return 64 /* Readonly */; 11836 case 163 /* OverrideKeyword */: 11837 return 16384 /* Override */; 11838 case 102 /* InKeyword */: 11839 return 32768 /* In */; 11840 case 146 /* OutKeyword */: 11841 return 65536 /* Out */; 11842 case 169 /* Decorator */: 11843 return 131072 /* Decorator */; 11844 } 11845 return 0 /* None */; 11846} 11847function isLogicalOrCoalescingAssignmentOperator(token) { 11848 return token === 75 /* BarBarEqualsToken */ || token === 76 /* AmpersandAmpersandEqualsToken */ || token === 77 /* QuestionQuestionEqualsToken */; 11849} 11850function isAssignmentOperator(token) { 11851 return token >= 63 /* FirstAssignment */ && token <= 78 /* LastAssignment */; 11852} 11853function isAssignmentExpression(node, excludeCompoundAssignment) { 11854 return isBinaryExpression(node) && (excludeCompoundAssignment ? node.operatorToken.kind === 63 /* EqualsToken */ : isAssignmentOperator(node.operatorToken.kind)) && isLeftHandSideExpression(node.left); 11855} 11856function isDestructuringAssignment(node) { 11857 if (isAssignmentExpression(node, true)) { 11858 const kind = node.left.kind; 11859 return kind === 210 /* ObjectLiteralExpression */ || kind === 209 /* ArrayLiteralExpression */; 11860 } 11861 return false; 11862} 11863function isEntityNameExpression(node) { 11864 return node.kind === 79 /* Identifier */ || isPropertyAccessEntityNameExpression(node); 11865} 11866function isDottedName(node) { 11867 return node.kind === 79 /* Identifier */ || node.kind === 109 /* ThisKeyword */ || node.kind === 107 /* SuperKeyword */ || node.kind === 237 /* MetaProperty */ || node.kind === 211 /* PropertyAccessExpression */ && isDottedName(node.expression) || node.kind === 217 /* ParenthesizedExpression */ && isDottedName(node.expression); 11868} 11869function isPropertyAccessEntityNameExpression(node) { 11870 return isPropertyAccessExpression(node) && isIdentifier(node.name) && isEntityNameExpression(node.expression); 11871} 11872function isPrototypeAccess(node) { 11873 return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === "prototype"; 11874} 11875function isEmptyObjectLiteral(expression) { 11876 return expression.kind === 210 /* ObjectLiteralExpression */ && expression.properties.length === 0; 11877} 11878function tryExtractTSExtension(fileName) { 11879 return find(supportedTSExtensionsForExtractExtension, (extension) => fileExtensionIs(fileName, extension)); 11880} 11881function readJsonOrUndefined(path2, hostOrText) { 11882 const jsonText = isString(hostOrText) ? hostOrText : hostOrText.readFile(path2); 11883 if (!jsonText) 11884 return void 0; 11885 const result = parseConfigFileTextToJson(path2, jsonText); 11886 return !result.error ? result.config : void 0; 11887} 11888function readJson(path2, host) { 11889 return readJsonOrUndefined(path2, host) || {}; 11890} 11891function directoryProbablyExists(directoryName, host) { 11892 return !host.directoryExists || host.directoryExists(directoryName); 11893} 11894var carriageReturnLineFeed = "\r\n"; 11895var lineFeed = "\n"; 11896function getNewLineCharacter(options, getNewLine) { 11897 switch (options.newLine) { 11898 case 0 /* CarriageReturnLineFeed */: 11899 return carriageReturnLineFeed; 11900 case 1 /* LineFeed */: 11901 return lineFeed; 11902 } 11903 return getNewLine ? getNewLine() : sys ? sys.newLine : carriageReturnLineFeed; 11904} 11905function rangeIsOnSingleLine(range, sourceFile) { 11906 return rangeStartIsOnSameLineAsRangeEnd(range, range, sourceFile); 11907} 11908function rangeStartPositionsAreOnSameLine(range1, range2, sourceFile) { 11909 return positionsAreOnSameLine( 11910 getStartPositionOfRange(range1, sourceFile, false), 11911 getStartPositionOfRange(range2, sourceFile, false), 11912 sourceFile 11913 ); 11914} 11915function rangeEndPositionsAreOnSameLine(range1, range2, sourceFile) { 11916 return positionsAreOnSameLine(range1.end, range2.end, sourceFile); 11917} 11918function rangeStartIsOnSameLineAsRangeEnd(range1, range2, sourceFile) { 11919 return positionsAreOnSameLine(getStartPositionOfRange(range1, sourceFile, false), range2.end, sourceFile); 11920} 11921function rangeEndIsOnSameLineAsRangeStart(range1, range2, sourceFile) { 11922 return positionsAreOnSameLine(range1.end, getStartPositionOfRange(range2, sourceFile, false), sourceFile); 11923} 11924function getLinesBetweenRangeEndAndRangeStart(range1, range2, sourceFile, includeSecondRangeComments) { 11925 const range2Start = getStartPositionOfRange(range2, sourceFile, includeSecondRangeComments); 11926 return getLinesBetweenPositions(sourceFile, range1.end, range2Start); 11927} 11928function positionsAreOnSameLine(pos1, pos2, sourceFile) { 11929 return getLinesBetweenPositions(sourceFile, pos1, pos2) === 0; 11930} 11931function getStartPositionOfRange(range, sourceFile, includeComments) { 11932 return positionIsSynthesized(range.pos) ? -1 : skipTrivia(sourceFile.text, range.pos, false, includeComments); 11933} 11934function getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter(pos, stopPos, sourceFile, includeComments) { 11935 const startPos = skipTrivia(sourceFile.text, pos, false, includeComments); 11936 const prevPos = getPreviousNonWhitespacePosition(startPos, stopPos, sourceFile); 11937 return getLinesBetweenPositions(sourceFile, prevPos != null ? prevPos : stopPos, startPos); 11938} 11939function getLinesBetweenPositionAndNextNonWhitespaceCharacter(pos, stopPos, sourceFile, includeComments) { 11940 const nextPos = skipTrivia(sourceFile.text, pos, false, includeComments); 11941 return getLinesBetweenPositions(sourceFile, pos, Math.min(stopPos, nextPos)); 11942} 11943function getPreviousNonWhitespacePosition(pos, stopPos = 0, sourceFile) { 11944 while (pos-- > stopPos) { 11945 if (!isWhiteSpaceLike(sourceFile.text.charCodeAt(pos))) { 11946 return pos; 11947 } 11948 } 11949} 11950function closeFileWatcher(watcher) { 11951 watcher.close(); 11952} 11953function clearMap(map2, onDeleteValue) { 11954 map2.forEach(onDeleteValue); 11955 map2.clear(); 11956} 11957function getLastChild(node) { 11958 let lastChild; 11959 forEachChild( 11960 node, 11961 (child) => { 11962 if (nodeIsPresent(child)) 11963 lastChild = child; 11964 }, 11965 (children) => { 11966 for (let i = children.length - 1; i >= 0; i--) { 11967 if (nodeIsPresent(children[i])) { 11968 lastChild = children[i]; 11969 break; 11970 } 11971 } 11972 } 11973 ); 11974 return lastChild; 11975} 11976function isTypeNodeKind(kind) { 11977 return kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */ || kind === 132 /* AnyKeyword */ || kind === 159 /* UnknownKeyword */ || kind === 149 /* NumberKeyword */ || kind === 162 /* BigIntKeyword */ || kind === 150 /* ObjectKeyword */ || kind === 135 /* BooleanKeyword */ || kind === 153 /* StringKeyword */ || kind === 154 /* SymbolKeyword */ || kind === 115 /* VoidKeyword */ || kind === 157 /* UndefinedKeyword */ || kind === 145 /* NeverKeyword */ || kind === 234 /* ExpressionWithTypeArguments */ || kind === 321 /* JSDocAllType */ || kind === 322 /* JSDocUnknownType */ || kind === 323 /* JSDocNullableType */ || kind === 324 /* JSDocNonNullableType */ || kind === 325 /* JSDocOptionalType */ || kind === 326 /* JSDocFunctionType */ || kind === 327 /* JSDocVariadicType */; 11978} 11979function isAccessExpression(node) { 11980 return node.kind === 211 /* PropertyAccessExpression */ || node.kind === 212 /* ElementAccessExpression */; 11981} 11982function isBundleFileTextLike(section) { 11983 switch (section.kind) { 11984 case "text" /* Text */: 11985 case "internal" /* Internal */: 11986 return true; 11987 default: 11988 return false; 11989 } 11990} 11991function getLeftmostAccessExpression(expr) { 11992 while (isAccessExpression(expr)) { 11993 expr = expr.expression; 11994 } 11995 return expr; 11996} 11997function getLeftmostExpression(node, stopAtCallExpressions) { 11998 while (true) { 11999 switch (node.kind) { 12000 case 226 /* PostfixUnaryExpression */: 12001 node = node.operand; 12002 continue; 12003 case 227 /* BinaryExpression */: 12004 node = node.left; 12005 continue; 12006 case 228 /* ConditionalExpression */: 12007 node = node.condition; 12008 continue; 12009 case 215 /* TaggedTemplateExpression */: 12010 node = node.tag; 12011 continue; 12012 case 213 /* CallExpression */: 12013 if (stopAtCallExpressions) { 12014 return node; 12015 } 12016 case 235 /* AsExpression */: 12017 case 212 /* ElementAccessExpression */: 12018 case 211 /* PropertyAccessExpression */: 12019 case 236 /* NonNullExpression */: 12020 case 359 /* PartiallyEmittedExpression */: 12021 case 239 /* SatisfiesExpression */: 12022 node = node.expression; 12023 continue; 12024 } 12025 return node; 12026 } 12027} 12028function Symbol4(flags, name) { 12029 this.flags = flags; 12030 this.escapedName = name; 12031 this.declarations = void 0; 12032 this.valueDeclaration = void 0; 12033 this.id = void 0; 12034 this.mergeId = void 0; 12035 this.parent = void 0; 12036} 12037function Type3(checker, flags) { 12038 this.flags = flags; 12039 if (Debug.isDebugging || tracing) { 12040 this.checker = checker; 12041 } 12042} 12043function Signature2(checker, flags) { 12044 this.flags = flags; 12045 if (Debug.isDebugging) { 12046 this.checker = checker; 12047 } 12048} 12049function Node4(kind, pos, end) { 12050 this.pos = pos; 12051 this.end = end; 12052 this.kind = kind; 12053 this.id = 0; 12054 this.flags = 0 /* None */; 12055 this.modifierFlagsCache = 0 /* None */; 12056 this.transformFlags = 0 /* None */; 12057 this.parent = void 0; 12058 this.original = void 0; 12059} 12060function Token(kind, pos, end) { 12061 this.pos = pos; 12062 this.end = end; 12063 this.kind = kind; 12064 this.id = 0; 12065 this.flags = 0 /* None */; 12066 this.transformFlags = 0 /* None */; 12067 this.parent = void 0; 12068} 12069function Identifier2(kind, pos, end) { 12070 this.pos = pos; 12071 this.end = end; 12072 this.kind = kind; 12073 this.id = 0; 12074 this.flags = 0 /* None */; 12075 this.transformFlags = 0 /* None */; 12076 this.parent = void 0; 12077 this.original = void 0; 12078 this.flowNode = void 0; 12079} 12080function SourceMapSource(fileName, text, skipTrivia2) { 12081 this.fileName = fileName; 12082 this.text = text; 12083 this.skipTrivia = skipTrivia2 || ((pos) => pos); 12084} 12085var objectAllocator = { 12086 getNodeConstructor: () => Node4, 12087 getTokenConstructor: () => Token, 12088 getIdentifierConstructor: () => Identifier2, 12089 getPrivateIdentifierConstructor: () => Node4, 12090 getSourceFileConstructor: () => Node4, 12091 getSymbolConstructor: () => Symbol4, 12092 getTypeConstructor: () => Type3, 12093 getSignatureConstructor: () => Signature2, 12094 getSourceMapSourceConstructor: () => SourceMapSource 12095}; 12096function formatStringFromArgs(text, args, baseIndex = 0) { 12097 return text.replace(/{(\d+)}/g, (_match, index) => "" + Debug.checkDefined(args[+index + baseIndex])); 12098} 12099var localizedDiagnosticMessages; 12100function getLocaleSpecificMessage(message) { 12101 return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message; 12102} 12103function createDetachedDiagnostic(fileName, start, length2, message) { 12104 assertDiagnosticLocation(void 0, start, length2); 12105 let text = getLocaleSpecificMessage(message); 12106 if (arguments.length > 4) { 12107 text = formatStringFromArgs(text, arguments, 4); 12108 } 12109 return { 12110 file: void 0, 12111 start, 12112 length: length2, 12113 messageText: text, 12114 category: message.category, 12115 code: message.code, 12116 reportsUnnecessary: message.reportsUnnecessary, 12117 fileName 12118 }; 12119} 12120function isDiagnosticWithDetachedLocation(diagnostic) { 12121 return diagnostic.file === void 0 && diagnostic.start !== void 0 && diagnostic.length !== void 0 && typeof diagnostic.fileName === "string"; 12122} 12123function attachFileToDiagnostic(diagnostic, file) { 12124 const fileName = file.fileName || ""; 12125 const length2 = file.text.length; 12126 Debug.assertEqual(diagnostic.fileName, fileName); 12127 Debug.assertLessThanOrEqual(diagnostic.start, length2); 12128 Debug.assertLessThanOrEqual(diagnostic.start + diagnostic.length, length2); 12129 const diagnosticWithLocation = { 12130 file, 12131 start: diagnostic.start, 12132 length: diagnostic.length, 12133 messageText: diagnostic.messageText, 12134 category: diagnostic.category, 12135 code: diagnostic.code, 12136 reportsUnnecessary: diagnostic.reportsUnnecessary 12137 }; 12138 if (diagnostic.relatedInformation) { 12139 diagnosticWithLocation.relatedInformation = []; 12140 for (const related of diagnostic.relatedInformation) { 12141 if (isDiagnosticWithDetachedLocation(related) && related.fileName === fileName) { 12142 Debug.assertLessThanOrEqual(related.start, length2); 12143 Debug.assertLessThanOrEqual(related.start + related.length, length2); 12144 diagnosticWithLocation.relatedInformation.push(attachFileToDiagnostic(related, file)); 12145 } else { 12146 diagnosticWithLocation.relatedInformation.push(related); 12147 } 12148 } 12149 } 12150 return diagnosticWithLocation; 12151} 12152function attachFileToDiagnostics(diagnostics, file) { 12153 const diagnosticsWithLocation = []; 12154 for (const diagnostic of diagnostics) { 12155 diagnosticsWithLocation.push(attachFileToDiagnostic(diagnostic, file)); 12156 } 12157 return diagnosticsWithLocation; 12158} 12159function createFileDiagnostic(file, start, length2, message) { 12160 assertDiagnosticLocation(file, start, length2); 12161 let text = getLocaleSpecificMessage(message); 12162 if (arguments.length > 4) { 12163 text = formatStringFromArgs(text, arguments, 4); 12164 } 12165 return { 12166 file, 12167 start, 12168 length: length2, 12169 messageText: text, 12170 category: message.category, 12171 code: message.code, 12172 reportsUnnecessary: message.reportsUnnecessary, 12173 reportsDeprecated: message.reportsDeprecated 12174 }; 12175} 12176function formatMessage(_dummy, message) { 12177 let text = getLocaleSpecificMessage(message); 12178 if (arguments.length > 2) { 12179 text = formatStringFromArgs(text, arguments, 2); 12180 } 12181 return text; 12182} 12183function createCompilerDiagnostic(message) { 12184 let text = getLocaleSpecificMessage(message); 12185 if (arguments.length > 1) { 12186 text = formatStringFromArgs(text, arguments, 1); 12187 } 12188 return { 12189 file: void 0, 12190 start: void 0, 12191 length: void 0, 12192 messageText: text, 12193 category: message.category, 12194 code: message.code, 12195 reportsUnnecessary: message.reportsUnnecessary, 12196 reportsDeprecated: message.reportsDeprecated 12197 }; 12198} 12199function getLanguageVariant(scriptKind) { 12200 return scriptKind === 4 /* TSX */ || scriptKind === 2 /* JSX */ || scriptKind === 1 /* JS */ || scriptKind === 6 /* JSON */ ? 1 /* JSX */ : 0 /* Standard */; 12201} 12202function getEmitScriptTarget(compilerOptions) { 12203 return compilerOptions.target || compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 0 /* ES3 */; 12204} 12205function getEmitModuleKind(compilerOptions) { 12206 return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */; 12207} 12208function getEmitModuleResolutionKind(compilerOptions) { 12209 let moduleResolution = compilerOptions.moduleResolution; 12210 if (moduleResolution === void 0) { 12211 switch (getEmitModuleKind(compilerOptions)) { 12212 case 1 /* CommonJS */: 12213 moduleResolution = 2 /* NodeJs */; 12214 break; 12215 case 100 /* Node16 */: 12216 moduleResolution = 3 /* Node16 */; 12217 break; 12218 case 199 /* NodeNext */: 12219 moduleResolution = 99 /* NodeNext */; 12220 break; 12221 default: 12222 moduleResolution = 1 /* Classic */; 12223 break; 12224 } 12225 } 12226 return moduleResolution; 12227} 12228function unreachableCodeIsError(options) { 12229 return options.allowUnreachableCode === false; 12230} 12231function unusedLabelIsError(options) { 12232 return options.allowUnusedLabels === false; 12233} 12234function shouldPreserveConstEnums(compilerOptions) { 12235 return !!(compilerOptions.preserveConstEnums || compilerOptions.isolatedModules); 12236} 12237function getStrictOptionValue(compilerOptions, flag) { 12238 return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag]; 12239} 12240var reservedCharacterPattern = /[^\w\s\/]/g; 12241var wildcardCharCodes = [42 /* asterisk */, 63 /* question */]; 12242var commonPackageFolders = ["node_modules", "oh_modules", "bower_components", "jspm_packages"]; 12243var implicitExcludePathRegexPattern = `(?!(${commonPackageFolders.join("|")})(/|$))`; 12244var filesMatcher = { 12245 singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*", 12246 doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, 12247 replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment) 12248}; 12249var directoriesMatcher = { 12250 singleAsteriskRegexFragment: "[^/]*", 12251 doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`, 12252 replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment) 12253}; 12254var excludeMatcher = { 12255 singleAsteriskRegexFragment: "[^/]*", 12256 doubleAsteriskRegexFragment: "(/.+?)?", 12257 replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment) 12258}; 12259var wildcardMatchers = { 12260 files: filesMatcher, 12261 directories: directoriesMatcher, 12262 exclude: excludeMatcher 12263}; 12264function getRegularExpressionForWildcard(specs, basePath, usage) { 12265 const patterns = getRegularExpressionsForWildcards(specs, basePath, usage); 12266 if (!patterns || !patterns.length) { 12267 return void 0; 12268 } 12269 const pattern = patterns.map((pattern2) => `(${pattern2})`).join("|"); 12270 const terminator = usage === "exclude" ? "($|/)" : "$"; 12271 return `^(${pattern})${terminator}`; 12272} 12273function getRegularExpressionsForWildcards(specs, basePath, usage) { 12274 if (specs === void 0 || specs.length === 0) { 12275 return void 0; 12276 } 12277 return flatMap(specs, (spec) => spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage])); 12278} 12279function isImplicitGlob(lastPathComponent) { 12280 return !/[.*?]/.test(lastPathComponent); 12281} 12282function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter: replaceWildcardCharacter2 }) { 12283 let subpattern = ""; 12284 let hasWrittenComponent = false; 12285 const components = getNormalizedPathComponents(spec, basePath); 12286 const lastComponent = last(components); 12287 if (usage !== "exclude" && lastComponent === "**") { 12288 return void 0; 12289 } 12290 components[0] = removeTrailingDirectorySeparator(components[0]); 12291 if (isImplicitGlob(lastComponent)) { 12292 components.push("**", "*"); 12293 } 12294 let optionalCount = 0; 12295 for (let component of components) { 12296 if (component === "**") { 12297 subpattern += doubleAsteriskRegexFragment; 12298 } else { 12299 if (usage === "directories") { 12300 subpattern += "("; 12301 optionalCount++; 12302 } 12303 if (hasWrittenComponent) { 12304 subpattern += directorySeparator; 12305 } 12306 if (usage !== "exclude") { 12307 let componentPattern = ""; 12308 if (component.charCodeAt(0) === 42 /* asterisk */) { 12309 componentPattern += "([^./]" + singleAsteriskRegexFragment + ")?"; 12310 component = component.substr(1); 12311 } else if (component.charCodeAt(0) === 63 /* question */) { 12312 componentPattern += "[^./]"; 12313 component = component.substr(1); 12314 } 12315 componentPattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter2); 12316 if (componentPattern !== component) { 12317 subpattern += implicitExcludePathRegexPattern; 12318 } 12319 subpattern += componentPattern; 12320 } else { 12321 subpattern += component.replace(reservedCharacterPattern, replaceWildcardCharacter2); 12322 } 12323 } 12324 hasWrittenComponent = true; 12325 } 12326 while (optionalCount > 0) { 12327 subpattern += ")?"; 12328 optionalCount--; 12329 } 12330 return subpattern; 12331} 12332function replaceWildcardCharacter(match, singleAsteriskRegexFragment) { 12333 return match === "*" ? singleAsteriskRegexFragment : match === "?" ? "[^/]" : "\\" + match; 12334} 12335function getFileMatcherPatterns(path2, excludes, includes, useCaseSensitiveFileNames, currentDirectory) { 12336 path2 = normalizePath(path2); 12337 currentDirectory = normalizePath(currentDirectory); 12338 const absolutePath = combinePaths(currentDirectory, path2); 12339 return { 12340 includeFilePatterns: map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), (pattern) => `^${pattern}$`), 12341 includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"), 12342 includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"), 12343 excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"), 12344 basePaths: getBasePaths(path2, includes, useCaseSensitiveFileNames) 12345 }; 12346} 12347function getRegexFromPattern(pattern, useCaseSensitiveFileNames) { 12348 return new RegExp(pattern, useCaseSensitiveFileNames ? "" : "i"); 12349} 12350function matchFiles(path2, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries, realpath) { 12351 path2 = normalizePath(path2); 12352 currentDirectory = normalizePath(currentDirectory); 12353 const patterns = getFileMatcherPatterns(path2, excludes, includes, useCaseSensitiveFileNames, currentDirectory); 12354 const includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map((pattern) => getRegexFromPattern(pattern, useCaseSensitiveFileNames)); 12355 const includeDirectoryRegex = patterns.includeDirectoryPattern && getRegexFromPattern(patterns.includeDirectoryPattern, useCaseSensitiveFileNames); 12356 const excludeRegex = patterns.excludePattern && getRegexFromPattern(patterns.excludePattern, useCaseSensitiveFileNames); 12357 const results = includeFileRegexes ? includeFileRegexes.map(() => []) : [[]]; 12358 const visited = new Map2(); 12359 const toCanonical = createGetCanonicalFileName(useCaseSensitiveFileNames); 12360 for (const basePath of patterns.basePaths) { 12361 visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth); 12362 } 12363 return flatten(results); 12364 function visitDirectory(path3, absolutePath, depth2) { 12365 const canonicalPath = toCanonical(realpath(absolutePath)); 12366 if (visited.has(canonicalPath)) 12367 return; 12368 visited.set(canonicalPath, true); 12369 const { files, directories } = getFileSystemEntries(path3); 12370 for (const current of sort(files, compareStringsCaseSensitive)) { 12371 const name = combinePaths(path3, current); 12372 const absoluteName = combinePaths(absolutePath, current); 12373 if (extensions && !fileExtensionIsOneOf(name, extensions)) 12374 continue; 12375 if (excludeRegex && excludeRegex.test(absoluteName)) 12376 continue; 12377 if (!includeFileRegexes) { 12378 results[0].push(name); 12379 } else { 12380 const includeIndex = findIndex(includeFileRegexes, (re) => re.test(absoluteName)); 12381 if (includeIndex !== -1) { 12382 results[includeIndex].push(name); 12383 } 12384 } 12385 } 12386 if (depth2 !== void 0) { 12387 depth2--; 12388 if (depth2 === 0) { 12389 return; 12390 } 12391 } 12392 for (const current of sort(directories, compareStringsCaseSensitive)) { 12393 const name = combinePaths(path3, current); 12394 const absoluteName = combinePaths(absolutePath, current); 12395 if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) && (!excludeRegex || !excludeRegex.test(absoluteName))) { 12396 visitDirectory(name, absoluteName, depth2); 12397 } 12398 } 12399 } 12400} 12401function getBasePaths(path2, includes, useCaseSensitiveFileNames) { 12402 const basePaths = [path2]; 12403 if (includes) { 12404 const includeBasePaths = []; 12405 for (const include of includes) { 12406 const absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(path2, include)); 12407 includeBasePaths.push(getIncludeBasePath(absolute)); 12408 } 12409 includeBasePaths.sort(getStringComparer(!useCaseSensitiveFileNames)); 12410 for (const includeBasePath of includeBasePaths) { 12411 if (every(basePaths, (basePath) => !containsPath(basePath, includeBasePath, path2, !useCaseSensitiveFileNames))) { 12412 basePaths.push(includeBasePath); 12413 } 12414 } 12415 } 12416 return basePaths; 12417} 12418function getIncludeBasePath(absolute) { 12419 const wildcardOffset = indexOfAnyCharCode(absolute, wildcardCharCodes); 12420 if (wildcardOffset < 0) { 12421 return !hasExtension(absolute) ? absolute : removeTrailingDirectorySeparator(getDirectoryPath(absolute)); 12422 } 12423 return absolute.substring(0, absolute.lastIndexOf(directorySeparator, wildcardOffset)); 12424} 12425function ensureScriptKind(fileName, scriptKind) { 12426 return scriptKind || getScriptKindFromFileName(fileName) || 3 /* TS */; 12427} 12428function getScriptKindFromFileName(fileName) { 12429 const ext = fileName.substr(fileName.lastIndexOf(".")); 12430 switch (ext.toLowerCase()) { 12431 case ".js" /* Js */: 12432 case ".cjs" /* Cjs */: 12433 case ".mjs" /* Mjs */: 12434 return 1 /* JS */; 12435 case ".jsx" /* Jsx */: 12436 return 2 /* JSX */; 12437 case ".ts" /* Ts */: 12438 case ".cts" /* Cts */: 12439 case ".mts" /* Mts */: 12440 return 3 /* TS */; 12441 case ".tsx" /* Tsx */: 12442 return 4 /* TSX */; 12443 case ".json" /* Json */: 12444 return 6 /* JSON */; 12445 case ".ets" /* Ets */: 12446 return 8 /* ETS */; 12447 default: 12448 return 0 /* Unknown */; 12449 } 12450} 12451var supportedTSExtensions = [[".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts */, ".ets" /* Ets */, ".d.ets" /* Dets */], [".cts" /* Cts */, ".d.cts" /* Dcts */], [".mts" /* Mts */, ".d.mts" /* Dmts */]]; 12452var supportedTSExtensionsFlat = flatten(supportedTSExtensions); 12453var supportedTSExtensionsWithJson = [...supportedTSExtensions, [".json" /* Json */]]; 12454var supportedTSExtensionsForExtractExtension = [".d.ts" /* Dts */, ".d.cts" /* Dcts */, ".d.mts" /* Dmts */, ".d.ets" /* Dets */, ".cts" /* Cts */, ".mts" /* Mts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".cts" /* Cts */, ".mts" /* Mts */, ".ets" /* Ets */]; 12455var supportedJSExtensions = [[".js" /* Js */, ".jsx" /* Jsx */], [".mjs" /* Mjs */], [".cjs" /* Cjs */]]; 12456var supportedJSExtensionsFlat = flatten(supportedJSExtensions); 12457var allSupportedExtensions = [[".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts */, ".ets" /* Ets */, ".d.ets" /* Dets */, ".js" /* Js */, ".jsx" /* Jsx */], [".cts" /* Cts */, ".d.cts" /* Dcts */, ".cjs" /* Cjs */], [".mts" /* Mts */, ".d.mts" /* Dmts */, ".mjs" /* Mjs */]]; 12458var allSupportedExtensionsWithJson = [...allSupportedExtensions, [".json" /* Json */]]; 12459var supportedDeclarationExtensions = [".d.ts" /* Dts */, ".d.cts" /* Dcts */, ".d.mts" /* Dmts */, ".d.ets" /* Dets */]; 12460function hasJSFileExtension(fileName) { 12461 return some(supportedJSExtensionsFlat, (extension) => fileExtensionIs(fileName, extension)); 12462} 12463function hasTSFileExtension(fileName) { 12464 return some(supportedTSExtensionsFlat, (extension) => fileExtensionIs(fileName, extension)); 12465} 12466var extensionsToRemove = [".d.ts" /* Dts */, ".d.ets" /* Dets */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */, ".mjs" /* Mjs */, ".mts" /* Mts */, ".cjs" /* Cjs */, ".cts" /* Cts */, ".ts" /* Ts */, ".js" /* Js */, ".tsx" /* Tsx */, ".jsx" /* Jsx */, ".json" /* Json */, ".ets" /* Ets */]; 12467function removeFileExtension(path2) { 12468 for (const ext of extensionsToRemove) { 12469 const extensionless = tryRemoveExtension(path2, ext); 12470 if (extensionless !== void 0) { 12471 return extensionless; 12472 } 12473 } 12474 return path2; 12475} 12476function tryRemoveExtension(path2, extension) { 12477 return fileExtensionIs(path2, extension) ? removeExtension(path2, extension) : void 0; 12478} 12479function removeExtension(path2, extension) { 12480 return path2.substring(0, path2.length - extension.length); 12481} 12482function tryParsePattern(pattern) { 12483 const indexOfStar = pattern.indexOf("*"); 12484 if (indexOfStar === -1) { 12485 return pattern; 12486 } 12487 return pattern.indexOf("*", indexOfStar + 1) !== -1 ? void 0 : { 12488 prefix: pattern.substr(0, indexOfStar), 12489 suffix: pattern.substr(indexOfStar + 1) 12490 }; 12491} 12492function tryParsePatterns(paths) { 12493 return mapDefined(getOwnKeys(paths), (path2) => tryParsePattern(path2)); 12494} 12495function positionIsSynthesized(pos) { 12496 return !(pos >= 0); 12497} 12498function tryGetExtensionFromPath2(path2) { 12499 if (fileExtensionIs(path2, ".ets" /* Ets */)) { 12500 return ".ets" /* Ets */; 12501 } 12502 return find(extensionsToRemove, (e) => fileExtensionIs(path2, e)); 12503} 12504var emptyFileSystemEntries = { 12505 files: emptyArray, 12506 directories: emptyArray 12507}; 12508function matchPatternOrExact(patternOrStrings, candidate) { 12509 const patterns = []; 12510 for (const patternOrString of patternOrStrings) { 12511 if (patternOrString === candidate) { 12512 return candidate; 12513 } 12514 if (!isString(patternOrString)) { 12515 patterns.push(patternOrString); 12516 } 12517 } 12518 return findBestPatternMatch(patterns, (_) => _, candidate); 12519} 12520function sliceAfter(arr, value) { 12521 const index = arr.indexOf(value); 12522 Debug.assert(index !== -1); 12523 return arr.slice(index); 12524} 12525function addRelatedInfo(diagnostic, ...relatedInformation) { 12526 if (!relatedInformation.length) { 12527 return diagnostic; 12528 } 12529 if (!diagnostic.relatedInformation) { 12530 diagnostic.relatedInformation = []; 12531 } 12532 Debug.assert(diagnostic.relatedInformation !== emptyArray, "Diagnostic had empty array singleton for related info, but is still being constructed!"); 12533 diagnostic.relatedInformation.push(...relatedInformation); 12534 return diagnostic; 12535} 12536function parsePseudoBigInt(stringValue) { 12537 let log2Base; 12538 switch (stringValue.charCodeAt(1)) { 12539 case 98 /* b */: 12540 case 66 /* B */: 12541 log2Base = 1; 12542 break; 12543 case 111 /* o */: 12544 case 79 /* O */: 12545 log2Base = 3; 12546 break; 12547 case 120 /* x */: 12548 case 88 /* X */: 12549 log2Base = 4; 12550 break; 12551 default: 12552 const nIndex = stringValue.length - 1; 12553 let nonZeroStart = 0; 12554 while (stringValue.charCodeAt(nonZeroStart) === 48 /* _0 */) { 12555 nonZeroStart++; 12556 } 12557 return stringValue.slice(nonZeroStart, nIndex) || "0"; 12558 } 12559 const startIndex = 2, endIndex = stringValue.length - 1; 12560 const bitsNeeded = (endIndex - startIndex) * log2Base; 12561 const segments = new Uint16Array((bitsNeeded >>> 4) + (bitsNeeded & 15 ? 1 : 0)); 12562 for (let i = endIndex - 1, bitOffset = 0; i >= startIndex; i--, bitOffset += log2Base) { 12563 const segment = bitOffset >>> 4; 12564 const digitChar = stringValue.charCodeAt(i); 12565 const digit = digitChar <= 57 /* _9 */ ? digitChar - 48 /* _0 */ : 10 + digitChar - (digitChar <= 70 /* F */ ? 65 /* A */ : 97 /* a */); 12566 const shiftedDigit = digit << (bitOffset & 15); 12567 segments[segment] |= shiftedDigit; 12568 const residual = shiftedDigit >>> 16; 12569 if (residual) 12570 segments[segment + 1] |= residual; 12571 } 12572 let base10Value = ""; 12573 let firstNonzeroSegment = segments.length - 1; 12574 let segmentsRemaining = true; 12575 while (segmentsRemaining) { 12576 let mod10 = 0; 12577 segmentsRemaining = false; 12578 for (let segment = firstNonzeroSegment; segment >= 0; segment--) { 12579 const newSegment = mod10 << 16 | segments[segment]; 12580 const segmentValue = newSegment / 10 | 0; 12581 segments[segment] = segmentValue; 12582 mod10 = newSegment - segmentValue * 10; 12583 if (segmentValue && !segmentsRemaining) { 12584 firstNonzeroSegment = segment; 12585 segmentsRemaining = true; 12586 } 12587 } 12588 base10Value = mod10 + base10Value; 12589 } 12590 return base10Value; 12591} 12592function pseudoBigIntToString({ negative, base10Value }) { 12593 return (negative && base10Value !== "0" ? "-" : "") + base10Value; 12594} 12595function setTextRangePos(range, pos) { 12596 range.pos = pos; 12597 return range; 12598} 12599function setTextRangeEnd(range, end) { 12600 range.end = end; 12601 return range; 12602} 12603function setTextRangePosEnd(range, pos, end) { 12604 return setTextRangeEnd(setTextRangePos(range, pos), end); 12605} 12606function setTextRangePosWidth(range, pos, width) { 12607 return setTextRangePosEnd(range, pos, pos + width); 12608} 12609function setParent(child, parent) { 12610 if (child && parent) { 12611 child.parent = parent; 12612 } 12613 return child; 12614} 12615function getContainingNodeArray(node) { 12616 if (!node.parent) 12617 return void 0; 12618 switch (node.kind) { 12619 case 167 /* TypeParameter */: 12620 const { parent: parent2 } = node; 12621 return parent2.kind === 195 /* InferType */ ? void 0 : parent2.typeParameters; 12622 case 168 /* Parameter */: 12623 return node.parent.parameters; 12624 case 204 /* TemplateLiteralTypeSpan */: 12625 return node.parent.templateSpans; 12626 case 240 /* TemplateSpan */: 12627 return node.parent.templateSpans; 12628 case 169 /* Decorator */: { 12629 const { parent: parent3 } = node; 12630 return canHaveDecorators(parent3) ? parent3.modifiers : canHaveIllegalDecorators(parent3) ? parent3.illegalDecorators : void 0; 12631 } 12632 case 300 /* HeritageClause */: 12633 return node.parent.heritageClauses; 12634 } 12635 const { parent } = node; 12636 if (isJSDocTag(node)) { 12637 return isJSDocTypeLiteral(node.parent) ? void 0 : node.parent.tags; 12638 } 12639 switch (parent.kind) { 12640 case 187 /* TypeLiteral */: 12641 case 267 /* InterfaceDeclaration */: 12642 return isTypeElement(node) ? parent.members : void 0; 12643 case 192 /* UnionType */: 12644 case 193 /* IntersectionType */: 12645 return parent.types; 12646 case 189 /* TupleType */: 12647 case 209 /* ArrayLiteralExpression */: 12648 case 360 /* CommaListExpression */: 12649 case 278 /* NamedImports */: 12650 case 282 /* NamedExports */: 12651 return parent.elements; 12652 case 210 /* ObjectLiteralExpression */: 12653 case 295 /* JsxAttributes */: 12654 return parent.properties; 12655 case 213 /* CallExpression */: 12656 case 214 /* NewExpression */: 12657 return isTypeNode(node) ? parent.typeArguments : parent.expression === node ? void 0 : parent.arguments; 12658 case 287 /* JsxElement */: 12659 case 291 /* JsxFragment */: 12660 return isJsxChild(node) ? parent.children : void 0; 12661 case 289 /* JsxOpeningElement */: 12662 case 288 /* JsxSelfClosingElement */: 12663 return isTypeNode(node) ? parent.typeArguments : void 0; 12664 case 242 /* Block */: 12665 case 298 /* CaseClause */: 12666 case 299 /* DefaultClause */: 12667 case 271 /* ModuleBlock */: 12668 return parent.statements; 12669 case 272 /* CaseBlock */: 12670 return parent.clauses; 12671 case 264 /* ClassDeclaration */: 12672 case 232 /* ClassExpression */: 12673 return isClassElement(node) ? parent.members : void 0; 12674 case 269 /* EnumDeclaration */: 12675 return isEnumMember(node) ? parent.members : void 0; 12676 case 314 /* SourceFile */: 12677 return parent.statements; 12678 } 12679} 12680function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { 12681 return node.kind !== 11 /* JsxText */ ? getLeadingCommentRanges(sourceFileOfNode.text, node.pos) : void 0; 12682} 12683function createTextWriter(newLine) { 12684 var output; 12685 var indent2; 12686 var lineStart; 12687 var lineCount; 12688 var linePos; 12689 var hasTrailingComment = false; 12690 function updateLineCountAndPosFor(s) { 12691 const lineStartsOfS = computeLineStarts(s); 12692 if (lineStartsOfS.length > 1) { 12693 lineCount = lineCount + lineStartsOfS.length - 1; 12694 linePos = output.length - s.length + last(lineStartsOfS); 12695 lineStart = linePos - output.length === 0; 12696 } else { 12697 lineStart = false; 12698 } 12699 } 12700 function writeText(s) { 12701 if (s && s.length) { 12702 if (lineStart) { 12703 s = getIndentString(indent2) + s; 12704 lineStart = false; 12705 } 12706 output += s; 12707 updateLineCountAndPosFor(s); 12708 } 12709 } 12710 function write(s) { 12711 if (s) 12712 hasTrailingComment = false; 12713 writeText(s); 12714 } 12715 function writeComment(s) { 12716 if (s) 12717 hasTrailingComment = true; 12718 writeText(s); 12719 } 12720 function reset() { 12721 output = ""; 12722 indent2 = 0; 12723 lineStart = true; 12724 lineCount = 0; 12725 linePos = 0; 12726 hasTrailingComment = false; 12727 } 12728 function rawWrite(s) { 12729 if (s !== void 0) { 12730 output += s; 12731 updateLineCountAndPosFor(s); 12732 hasTrailingComment = false; 12733 } 12734 } 12735 function writeLiteral(s) { 12736 if (s && s.length) { 12737 write(s); 12738 } 12739 } 12740 function writeLine(force) { 12741 if (!lineStart || force) { 12742 output += newLine; 12743 lineCount++; 12744 linePos = output.length; 12745 lineStart = true; 12746 hasTrailingComment = false; 12747 } 12748 } 12749 function getTextPosWithWriteLine() { 12750 return lineStart ? output.length : output.length + newLine.length; 12751 } 12752 reset(); 12753 return { 12754 write, 12755 rawWrite, 12756 writeLiteral, 12757 writeLine, 12758 increaseIndent: () => { 12759 indent2++; 12760 }, 12761 decreaseIndent: () => { 12762 indent2--; 12763 }, 12764 getIndent: () => indent2, 12765 getTextPos: () => output.length, 12766 getLine: () => lineCount, 12767 getColumn: () => lineStart ? indent2 * getIndentSize() : output.length - linePos, 12768 getText: () => output, 12769 isAtStartOfLine: () => lineStart, 12770 hasTrailingComment: () => hasTrailingComment, 12771 hasTrailingWhitespace: () => !!output.length && isWhiteSpaceLike(output.charCodeAt(output.length - 1)), 12772 clear: reset, 12773 reportInaccessibleThisError: noop, 12774 reportPrivateInBaseOfClassExpression: noop, 12775 reportInaccessibleUniqueSymbolError: noop, 12776 trackSymbol: () => false, 12777 writeKeyword: write, 12778 writeOperator: write, 12779 writeParameter: write, 12780 writeProperty: write, 12781 writePunctuation: write, 12782 writeSpace: write, 12783 writeStringLiteral: write, 12784 writeSymbol: (s, _) => write(s), 12785 writeTrailingSemicolon: write, 12786 writeComment, 12787 getTextPosWithWriteLine 12788 }; 12789} 12790function setParentRecursive(rootNode, incremental) { 12791 if (!rootNode) 12792 return rootNode; 12793 forEachChildRecursively(rootNode, isJSDocNode(rootNode) ? bindParentToChildIgnoringJSDoc : bindParentToChild); 12794 return rootNode; 12795 function bindParentToChildIgnoringJSDoc(child, parent) { 12796 if (incremental && child.parent === parent) { 12797 return "skip"; 12798 } 12799 setParent(child, parent); 12800 } 12801 function bindJSDoc(child) { 12802 if (hasJSDocNodes(child)) { 12803 for (const doc of child.jsDoc) { 12804 bindParentToChildIgnoringJSDoc(doc, child); 12805 forEachChildRecursively(doc, bindParentToChildIgnoringJSDoc); 12806 } 12807 } 12808 } 12809 function bindParentToChild(child, parent) { 12810 return bindParentToChildIgnoringJSDoc(child, parent) || bindJSDoc(child); 12811 } 12812} 12813 12814// src/compiler/factory/baseNodeFactory.ts 12815function createBaseNodeFactory() { 12816 let NodeConstructor2; 12817 let TokenConstructor2; 12818 let IdentifierConstructor2; 12819 let PrivateIdentifierConstructor2; 12820 let SourceFileConstructor2; 12821 return { 12822 createBaseSourceFileNode, 12823 createBaseIdentifierNode, 12824 createBasePrivateIdentifierNode, 12825 createBaseTokenNode, 12826 createBaseNode 12827 }; 12828 function createBaseSourceFileNode(kind) { 12829 return new (SourceFileConstructor2 || (SourceFileConstructor2 = objectAllocator.getSourceFileConstructor()))(kind, -1, -1); 12830 } 12831 function createBaseIdentifierNode(kind) { 12832 return new (IdentifierConstructor2 || (IdentifierConstructor2 = objectAllocator.getIdentifierConstructor()))(kind, -1, -1); 12833 } 12834 function createBasePrivateIdentifierNode(kind) { 12835 return new (PrivateIdentifierConstructor2 || (PrivateIdentifierConstructor2 = objectAllocator.getPrivateIdentifierConstructor()))(kind, -1, -1); 12836 } 12837 function createBaseTokenNode(kind) { 12838 return new (TokenConstructor2 || (TokenConstructor2 = objectAllocator.getTokenConstructor()))(kind, -1, -1); 12839 } 12840 function createBaseNode(kind) { 12841 return new (NodeConstructor2 || (NodeConstructor2 = objectAllocator.getNodeConstructor()))(kind, -1, -1); 12842 } 12843} 12844 12845// src/compiler/factory/parenthesizerRules.ts 12846function createParenthesizerRules(factory2) { 12847 let binaryLeftOperandParenthesizerCache; 12848 let binaryRightOperandParenthesizerCache; 12849 return { 12850 getParenthesizeLeftSideOfBinaryForOperator, 12851 getParenthesizeRightSideOfBinaryForOperator, 12852 parenthesizeLeftSideOfBinary, 12853 parenthesizeRightSideOfBinary, 12854 parenthesizeExpressionOfComputedPropertyName, 12855 parenthesizeConditionOfConditionalExpression, 12856 parenthesizeBranchOfConditionalExpression, 12857 parenthesizeExpressionOfExportDefault, 12858 parenthesizeExpressionOfNew, 12859 parenthesizeLeftSideOfAccess, 12860 parenthesizeOperandOfPostfixUnary, 12861 parenthesizeOperandOfPrefixUnary, 12862 parenthesizeExpressionsOfCommaDelimitedList, 12863 parenthesizeExpressionForDisallowedComma, 12864 parenthesizeExpressionOfExpressionStatement, 12865 parenthesizeConciseBodyOfArrowFunction, 12866 parenthesizeCheckTypeOfConditionalType, 12867 parenthesizeExtendsTypeOfConditionalType, 12868 parenthesizeConstituentTypesOfUnionType, 12869 parenthesizeConstituentTypeOfUnionType, 12870 parenthesizeConstituentTypesOfIntersectionType, 12871 parenthesizeConstituentTypeOfIntersectionType, 12872 parenthesizeOperandOfTypeOperator, 12873 parenthesizeOperandOfReadonlyTypeOperator, 12874 parenthesizeNonArrayTypeOfPostfixType, 12875 parenthesizeElementTypesOfTupleType, 12876 parenthesizeElementTypeOfTupleType, 12877 parenthesizeTypeOfOptionalType, 12878 parenthesizeTypeArguments, 12879 parenthesizeLeadingTypeArgument 12880 }; 12881 function getParenthesizeLeftSideOfBinaryForOperator(operatorKind) { 12882 binaryLeftOperandParenthesizerCache || (binaryLeftOperandParenthesizerCache = new Map2()); 12883 let parenthesizerRule = binaryLeftOperandParenthesizerCache.get(operatorKind); 12884 if (!parenthesizerRule) { 12885 parenthesizerRule = (node) => parenthesizeLeftSideOfBinary(operatorKind, node); 12886 binaryLeftOperandParenthesizerCache.set(operatorKind, parenthesizerRule); 12887 } 12888 return parenthesizerRule; 12889 } 12890 function getParenthesizeRightSideOfBinaryForOperator(operatorKind) { 12891 binaryRightOperandParenthesizerCache || (binaryRightOperandParenthesizerCache = new Map2()); 12892 let parenthesizerRule = binaryRightOperandParenthesizerCache.get(operatorKind); 12893 if (!parenthesizerRule) { 12894 parenthesizerRule = (node) => parenthesizeRightSideOfBinary(operatorKind, void 0, node); 12895 binaryRightOperandParenthesizerCache.set(operatorKind, parenthesizerRule); 12896 } 12897 return parenthesizerRule; 12898 } 12899 function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { 12900 const binaryOperatorPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, binaryOperator); 12901 const binaryOperatorAssociativity = getOperatorAssociativity(227 /* BinaryExpression */, binaryOperator); 12902 const emittedOperand = skipPartiallyEmittedExpressions(operand); 12903 if (!isLeftSideOfBinary && operand.kind === 219 /* ArrowFunction */ && binaryOperatorPrecedence > 3 /* Assignment */) { 12904 return true; 12905 } 12906 const operandPrecedence = getExpressionPrecedence(emittedOperand); 12907 switch (compareValues(operandPrecedence, binaryOperatorPrecedence)) { 12908 case -1 /* LessThan */: 12909 if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ && operand.kind === 230 /* YieldExpression */) { 12910 return false; 12911 } 12912 return true; 12913 case 1 /* GreaterThan */: 12914 return false; 12915 case 0 /* EqualTo */: 12916 if (isLeftSideOfBinary) { 12917 return binaryOperatorAssociativity === 1 /* Right */; 12918 } else { 12919 if (isBinaryExpression(emittedOperand) && emittedOperand.operatorToken.kind === binaryOperator) { 12920 if (operatorHasAssociativeProperty(binaryOperator)) { 12921 return false; 12922 } 12923 if (binaryOperator === 39 /* PlusToken */) { 12924 const leftKind = leftOperand ? getLiteralKindOfBinaryPlusOperand(leftOperand) : 0 /* Unknown */; 12925 if (isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(emittedOperand)) { 12926 return false; 12927 } 12928 } 12929 } 12930 const operandAssociativity = getExpressionAssociativity(emittedOperand); 12931 return operandAssociativity === 0 /* Left */; 12932 } 12933 } 12934 } 12935 function operatorHasAssociativeProperty(binaryOperator) { 12936 return binaryOperator === 41 /* AsteriskToken */ || binaryOperator === 51 /* BarToken */ || binaryOperator === 50 /* AmpersandToken */ || binaryOperator === 52 /* CaretToken */ || binaryOperator === 27 /* CommaToken */; 12937 } 12938 function getLiteralKindOfBinaryPlusOperand(node) { 12939 node = skipPartiallyEmittedExpressions(node); 12940 if (isLiteralKind(node.kind)) { 12941 return node.kind; 12942 } 12943 if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 39 /* PlusToken */) { 12944 if (node.cachedLiteralKind !== void 0) { 12945 return node.cachedLiteralKind; 12946 } 12947 const leftKind = getLiteralKindOfBinaryPlusOperand(node.left); 12948 const literalKind = isLiteralKind(leftKind) && leftKind === getLiteralKindOfBinaryPlusOperand(node.right) ? leftKind : 0 /* Unknown */; 12949 node.cachedLiteralKind = literalKind; 12950 return literalKind; 12951 } 12952 return 0 /* Unknown */; 12953 } 12954 function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { 12955 const skipped = skipPartiallyEmittedExpressions(operand); 12956 if (skipped.kind === 217 /* ParenthesizedExpression */) { 12957 return operand; 12958 } 12959 return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) ? factory2.createParenthesizedExpression(operand) : operand; 12960 } 12961 function parenthesizeLeftSideOfBinary(binaryOperator, leftSide) { 12962 return parenthesizeBinaryOperand(binaryOperator, leftSide, true); 12963 } 12964 function parenthesizeRightSideOfBinary(binaryOperator, leftSide, rightSide) { 12965 return parenthesizeBinaryOperand(binaryOperator, rightSide, false, leftSide); 12966 } 12967 function parenthesizeExpressionOfComputedPropertyName(expression) { 12968 return isCommaSequence(expression) ? factory2.createParenthesizedExpression(expression) : expression; 12969 } 12970 function parenthesizeConditionOfConditionalExpression(condition) { 12971 const conditionalPrecedence = getOperatorPrecedence(228 /* ConditionalExpression */, 57 /* QuestionToken */); 12972 const emittedCondition = skipPartiallyEmittedExpressions(condition); 12973 const conditionPrecedence = getExpressionPrecedence(emittedCondition); 12974 if (compareValues(conditionPrecedence, conditionalPrecedence) !== 1 /* GreaterThan */) { 12975 return factory2.createParenthesizedExpression(condition); 12976 } 12977 return condition; 12978 } 12979 function parenthesizeBranchOfConditionalExpression(branch) { 12980 const emittedExpression = skipPartiallyEmittedExpressions(branch); 12981 return isCommaSequence(emittedExpression) ? factory2.createParenthesizedExpression(branch) : branch; 12982 } 12983 function parenthesizeExpressionOfExportDefault(expression) { 12984 const check = skipPartiallyEmittedExpressions(expression); 12985 let needsParens = isCommaSequence(check); 12986 if (!needsParens) { 12987 switch (getLeftmostExpression(check, false).kind) { 12988 case 232 /* ClassExpression */: 12989 case 218 /* FunctionExpression */: 12990 needsParens = true; 12991 } 12992 } 12993 return needsParens ? factory2.createParenthesizedExpression(expression) : expression; 12994 } 12995 function parenthesizeExpressionOfNew(expression) { 12996 const leftmostExpr = getLeftmostExpression(expression, true); 12997 switch (leftmostExpr.kind) { 12998 case 213 /* CallExpression */: 12999 return factory2.createParenthesizedExpression(expression); 13000 case 214 /* NewExpression */: 13001 return !leftmostExpr.arguments ? factory2.createParenthesizedExpression(expression) : expression; 13002 } 13003 return parenthesizeLeftSideOfAccess(expression); 13004 } 13005 function parenthesizeLeftSideOfAccess(expression, optionalChain) { 13006 const emittedExpression = skipPartiallyEmittedExpressions(expression); 13007 if (isLeftHandSideExpression(emittedExpression) && (emittedExpression.kind !== 214 /* NewExpression */ || emittedExpression.arguments) && (optionalChain || !isOptionalChain(emittedExpression))) { 13008 return expression; 13009 } 13010 return setTextRange(factory2.createParenthesizedExpression(expression), expression); 13011 } 13012 function parenthesizeOperandOfPostfixUnary(operand) { 13013 return isLeftHandSideExpression(operand) ? operand : setTextRange(factory2.createParenthesizedExpression(operand), operand); 13014 } 13015 function parenthesizeOperandOfPrefixUnary(operand) { 13016 return isUnaryExpression(operand) ? operand : setTextRange(factory2.createParenthesizedExpression(operand), operand); 13017 } 13018 function parenthesizeExpressionsOfCommaDelimitedList(elements) { 13019 const result = sameMap(elements, parenthesizeExpressionForDisallowedComma); 13020 return setTextRange(factory2.createNodeArray(result, elements.hasTrailingComma), elements); 13021 } 13022 function parenthesizeExpressionForDisallowedComma(expression) { 13023 const emittedExpression = skipPartiallyEmittedExpressions(expression); 13024 const expressionPrecedence = getExpressionPrecedence(emittedExpression); 13025 const commaPrecedence = getOperatorPrecedence(227 /* BinaryExpression */, 27 /* CommaToken */); 13026 return expressionPrecedence > commaPrecedence ? expression : setTextRange(factory2.createParenthesizedExpression(expression), expression); 13027 } 13028 function parenthesizeExpressionOfExpressionStatement(expression) { 13029 const emittedExpression = skipPartiallyEmittedExpressions(expression); 13030 if (isCallExpression(emittedExpression)) { 13031 const callee = emittedExpression.expression; 13032 const kind = skipPartiallyEmittedExpressions(callee).kind; 13033 if (kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */) { 13034 const updated = factory2.updateCallExpression( 13035 emittedExpression, 13036 setTextRange(factory2.createParenthesizedExpression(callee), callee), 13037 emittedExpression.typeArguments, 13038 emittedExpression.arguments 13039 ); 13040 return factory2.restoreOuterExpressions(expression, updated, 8 /* PartiallyEmittedExpressions */); 13041 } 13042 } 13043 const leftmostExpressionKind = getLeftmostExpression(emittedExpression, false).kind; 13044 if (leftmostExpressionKind === 210 /* ObjectLiteralExpression */ || leftmostExpressionKind === 218 /* FunctionExpression */) { 13045 return setTextRange(factory2.createParenthesizedExpression(expression), expression); 13046 } 13047 return expression; 13048 } 13049 function parenthesizeConciseBodyOfArrowFunction(body) { 13050 if (!isBlock(body) && (isCommaSequence(body) || getLeftmostExpression(body, false).kind === 210 /* ObjectLiteralExpression */)) { 13051 return setTextRange(factory2.createParenthesizedExpression(body), body); 13052 } 13053 return body; 13054 } 13055 function parenthesizeCheckTypeOfConditionalType(checkType) { 13056 switch (checkType.kind) { 13057 case 184 /* FunctionType */: 13058 case 185 /* ConstructorType */: 13059 case 194 /* ConditionalType */: 13060 return factory2.createParenthesizedType(checkType); 13061 } 13062 return checkType; 13063 } 13064 function parenthesizeExtendsTypeOfConditionalType(extendsType) { 13065 switch (extendsType.kind) { 13066 case 194 /* ConditionalType */: 13067 return factory2.createParenthesizedType(extendsType); 13068 } 13069 return extendsType; 13070 } 13071 function parenthesizeConstituentTypeOfUnionType(type) { 13072 switch (type.kind) { 13073 case 192 /* UnionType */: 13074 case 193 /* IntersectionType */: 13075 return factory2.createParenthesizedType(type); 13076 } 13077 return parenthesizeCheckTypeOfConditionalType(type); 13078 } 13079 function parenthesizeConstituentTypesOfUnionType(members) { 13080 return factory2.createNodeArray(sameMap(members, parenthesizeConstituentTypeOfUnionType)); 13081 } 13082 function parenthesizeConstituentTypeOfIntersectionType(type) { 13083 switch (type.kind) { 13084 case 192 /* UnionType */: 13085 case 193 /* IntersectionType */: 13086 return factory2.createParenthesizedType(type); 13087 } 13088 return parenthesizeConstituentTypeOfUnionType(type); 13089 } 13090 function parenthesizeConstituentTypesOfIntersectionType(members) { 13091 return factory2.createNodeArray(sameMap(members, parenthesizeConstituentTypeOfIntersectionType)); 13092 } 13093 function parenthesizeOperandOfTypeOperator(type) { 13094 switch (type.kind) { 13095 case 193 /* IntersectionType */: 13096 return factory2.createParenthesizedType(type); 13097 } 13098 return parenthesizeConstituentTypeOfIntersectionType(type); 13099 } 13100 function parenthesizeOperandOfReadonlyTypeOperator(type) { 13101 switch (type.kind) { 13102 case 198 /* TypeOperator */: 13103 return factory2.createParenthesizedType(type); 13104 } 13105 return parenthesizeOperandOfTypeOperator(type); 13106 } 13107 function parenthesizeNonArrayTypeOfPostfixType(type) { 13108 switch (type.kind) { 13109 case 195 /* InferType */: 13110 case 198 /* TypeOperator */: 13111 case 186 /* TypeQuery */: 13112 return factory2.createParenthesizedType(type); 13113 } 13114 return parenthesizeOperandOfTypeOperator(type); 13115 } 13116 function parenthesizeElementTypesOfTupleType(types) { 13117 return factory2.createNodeArray(sameMap(types, parenthesizeElementTypeOfTupleType)); 13118 } 13119 function parenthesizeElementTypeOfTupleType(type) { 13120 if (hasJSDocPostfixQuestion(type)) 13121 return factory2.createParenthesizedType(type); 13122 return type; 13123 } 13124 function hasJSDocPostfixQuestion(type) { 13125 if (isJSDocNullableType(type)) 13126 return type.postfix; 13127 if (isNamedTupleMember(type)) 13128 return hasJSDocPostfixQuestion(type.type); 13129 if (isFunctionTypeNode(type) || isConstructorTypeNode(type) || isTypeOperatorNode(type)) 13130 return hasJSDocPostfixQuestion(type.type); 13131 if (isConditionalTypeNode(type)) 13132 return hasJSDocPostfixQuestion(type.falseType); 13133 if (isUnionTypeNode(type)) 13134 return hasJSDocPostfixQuestion(last(type.types)); 13135 if (isIntersectionTypeNode(type)) 13136 return hasJSDocPostfixQuestion(last(type.types)); 13137 if (isInferTypeNode(type)) 13138 return !!type.typeParameter.constraint && hasJSDocPostfixQuestion(type.typeParameter.constraint); 13139 return false; 13140 } 13141 function parenthesizeTypeOfOptionalType(type) { 13142 if (hasJSDocPostfixQuestion(type)) 13143 return factory2.createParenthesizedType(type); 13144 return parenthesizeNonArrayTypeOfPostfixType(type); 13145 } 13146 function parenthesizeLeadingTypeArgument(node) { 13147 return isFunctionOrConstructorTypeNode(node) && node.typeParameters ? factory2.createParenthesizedType(node) : node; 13148 } 13149 function parenthesizeOrdinalTypeArgument(node, i) { 13150 return i === 0 ? parenthesizeLeadingTypeArgument(node) : node; 13151 } 13152 function parenthesizeTypeArguments(typeArguments) { 13153 if (some(typeArguments)) { 13154 return factory2.createNodeArray(sameMap(typeArguments, parenthesizeOrdinalTypeArgument)); 13155 } 13156 } 13157} 13158var nullParenthesizerRules = { 13159 getParenthesizeLeftSideOfBinaryForOperator: (_) => identity, 13160 getParenthesizeRightSideOfBinaryForOperator: (_) => identity, 13161 parenthesizeLeftSideOfBinary: (_binaryOperator, leftSide) => leftSide, 13162 parenthesizeRightSideOfBinary: (_binaryOperator, _leftSide, rightSide) => rightSide, 13163 parenthesizeExpressionOfComputedPropertyName: identity, 13164 parenthesizeConditionOfConditionalExpression: identity, 13165 parenthesizeBranchOfConditionalExpression: identity, 13166 parenthesizeExpressionOfExportDefault: identity, 13167 parenthesizeExpressionOfNew: (expression) => cast(expression, isLeftHandSideExpression), 13168 parenthesizeLeftSideOfAccess: (expression) => cast(expression, isLeftHandSideExpression), 13169 parenthesizeOperandOfPostfixUnary: (operand) => cast(operand, isLeftHandSideExpression), 13170 parenthesizeOperandOfPrefixUnary: (operand) => cast(operand, isUnaryExpression), 13171 parenthesizeExpressionsOfCommaDelimitedList: (nodes) => cast(nodes, isNodeArray), 13172 parenthesizeExpressionForDisallowedComma: identity, 13173 parenthesizeExpressionOfExpressionStatement: identity, 13174 parenthesizeConciseBodyOfArrowFunction: identity, 13175 parenthesizeCheckTypeOfConditionalType: identity, 13176 parenthesizeExtendsTypeOfConditionalType: identity, 13177 parenthesizeConstituentTypesOfUnionType: (nodes) => cast(nodes, isNodeArray), 13178 parenthesizeConstituentTypeOfUnionType: identity, 13179 parenthesizeConstituentTypesOfIntersectionType: (nodes) => cast(nodes, isNodeArray), 13180 parenthesizeConstituentTypeOfIntersectionType: identity, 13181 parenthesizeOperandOfTypeOperator: identity, 13182 parenthesizeOperandOfReadonlyTypeOperator: identity, 13183 parenthesizeNonArrayTypeOfPostfixType: identity, 13184 parenthesizeElementTypesOfTupleType: (nodes) => cast(nodes, isNodeArray), 13185 parenthesizeElementTypeOfTupleType: identity, 13186 parenthesizeTypeOfOptionalType: identity, 13187 parenthesizeTypeArguments: (nodes) => nodes && cast(nodes, isNodeArray), 13188 parenthesizeLeadingTypeArgument: identity 13189}; 13190 13191// src/compiler/factory/nodeConverters.ts 13192function createNodeConverters(factory2) { 13193 return { 13194 convertToFunctionBlock, 13195 convertToFunctionExpression, 13196 convertToArrayAssignmentElement, 13197 convertToObjectAssignmentElement, 13198 convertToAssignmentPattern, 13199 convertToObjectAssignmentPattern, 13200 convertToArrayAssignmentPattern, 13201 convertToAssignmentElementTarget 13202 }; 13203 function convertToFunctionBlock(node, multiLine) { 13204 if (isBlock(node)) 13205 return node; 13206 const returnStatement = factory2.createReturnStatement(node); 13207 setTextRange(returnStatement, node); 13208 const body = factory2.createBlock([returnStatement], multiLine); 13209 setTextRange(body, node); 13210 return body; 13211 } 13212 function convertToFunctionExpression(node) { 13213 if (!node.body) 13214 return Debug.fail(`Cannot convert a FunctionDeclaration without a body`); 13215 const updated = factory2.createFunctionExpression( 13216 node.modifiers, 13217 node.asteriskToken, 13218 node.name, 13219 node.typeParameters, 13220 node.parameters, 13221 node.type, 13222 node.body 13223 ); 13224 setOriginalNode(updated, node); 13225 setTextRange(updated, node); 13226 if (getStartsOnNewLine(node)) { 13227 setStartsOnNewLine(updated, true); 13228 } 13229 return updated; 13230 } 13231 function convertToArrayAssignmentElement(element) { 13232 if (isBindingElement(element)) { 13233 if (element.dotDotDotToken) { 13234 Debug.assertNode(element.name, isIdentifier); 13235 return setOriginalNode(setTextRange(factory2.createSpreadElement(element.name), element), element); 13236 } 13237 const expression = convertToAssignmentElementTarget(element.name); 13238 return element.initializer ? setOriginalNode( 13239 setTextRange( 13240 factory2.createAssignment(expression, element.initializer), 13241 element 13242 ), 13243 element 13244 ) : expression; 13245 } 13246 return cast(element, isExpression); 13247 } 13248 function convertToObjectAssignmentElement(element) { 13249 if (isBindingElement(element)) { 13250 if (element.dotDotDotToken) { 13251 Debug.assertNode(element.name, isIdentifier); 13252 return setOriginalNode(setTextRange(factory2.createSpreadAssignment(element.name), element), element); 13253 } 13254 if (element.propertyName) { 13255 const expression = convertToAssignmentElementTarget(element.name); 13256 return setOriginalNode(setTextRange(factory2.createPropertyAssignment(element.propertyName, element.initializer ? factory2.createAssignment(expression, element.initializer) : expression), element), element); 13257 } 13258 Debug.assertNode(element.name, isIdentifier); 13259 return setOriginalNode(setTextRange(factory2.createShorthandPropertyAssignment(element.name, element.initializer), element), element); 13260 } 13261 return cast(element, isObjectLiteralElementLike); 13262 } 13263 function convertToAssignmentPattern(node) { 13264 switch (node.kind) { 13265 case 207 /* ArrayBindingPattern */: 13266 case 209 /* ArrayLiteralExpression */: 13267 return convertToArrayAssignmentPattern(node); 13268 case 206 /* ObjectBindingPattern */: 13269 case 210 /* ObjectLiteralExpression */: 13270 return convertToObjectAssignmentPattern(node); 13271 } 13272 } 13273 function convertToObjectAssignmentPattern(node) { 13274 if (isObjectBindingPattern(node)) { 13275 return setOriginalNode( 13276 setTextRange( 13277 factory2.createObjectLiteralExpression(map(node.elements, convertToObjectAssignmentElement)), 13278 node 13279 ), 13280 node 13281 ); 13282 } 13283 return cast(node, isObjectLiteralExpression); 13284 } 13285 function convertToArrayAssignmentPattern(node) { 13286 if (isArrayBindingPattern(node)) { 13287 return setOriginalNode( 13288 setTextRange( 13289 factory2.createArrayLiteralExpression(map(node.elements, convertToArrayAssignmentElement)), 13290 node 13291 ), 13292 node 13293 ); 13294 } 13295 return cast(node, isArrayLiteralExpression); 13296 } 13297 function convertToAssignmentElementTarget(node) { 13298 if (isBindingPattern(node)) { 13299 return convertToAssignmentPattern(node); 13300 } 13301 return cast(node, isExpression); 13302 } 13303} 13304var nullNodeConverters = { 13305 convertToFunctionBlock: notImplemented, 13306 convertToFunctionExpression: notImplemented, 13307 convertToArrayAssignmentElement: notImplemented, 13308 convertToObjectAssignmentElement: notImplemented, 13309 convertToAssignmentPattern: notImplemented, 13310 convertToObjectAssignmentPattern: notImplemented, 13311 convertToArrayAssignmentPattern: notImplemented, 13312 convertToAssignmentElementTarget: notImplemented 13313}; 13314 13315// src/compiler/factory/nodeFactory.ts 13316var nextAutoGenerateId = 0; 13317var nodeFactoryPatchers = []; 13318function createNodeFactory(flags, baseFactory2) { 13319 const update = flags & 8 /* NoOriginalNode */ ? updateWithoutOriginal : updateWithOriginal; 13320 const parenthesizerRules = memoize(() => flags & 1 /* NoParenthesizerRules */ ? nullParenthesizerRules : createParenthesizerRules(factory2)); 13321 const converters = memoize(() => flags & 2 /* NoNodeConverters */ ? nullNodeConverters : createNodeConverters(factory2)); 13322 const getBinaryCreateFunction = memoizeOne((operator) => (left, right) => createBinaryExpression(left, operator, right)); 13323 const getPrefixUnaryCreateFunction = memoizeOne((operator) => (operand) => createPrefixUnaryExpression(operator, operand)); 13324 const getPostfixUnaryCreateFunction = memoizeOne((operator) => (operand) => createPostfixUnaryExpression(operand, operator)); 13325 const getJSDocPrimaryTypeCreateFunction = memoizeOne((kind) => () => createJSDocPrimaryTypeWorker(kind)); 13326 const getJSDocUnaryTypeCreateFunction = memoizeOne((kind) => (type) => createJSDocUnaryTypeWorker(kind, type)); 13327 const getJSDocUnaryTypeUpdateFunction = memoizeOne((kind) => (node, type) => updateJSDocUnaryTypeWorker(kind, node, type)); 13328 const getJSDocPrePostfixUnaryTypeCreateFunction = memoizeOne((kind) => (type, postfix) => createJSDocPrePostfixUnaryTypeWorker(kind, type, postfix)); 13329 const getJSDocPrePostfixUnaryTypeUpdateFunction = memoizeOne((kind) => (node, type) => updateJSDocPrePostfixUnaryTypeWorker(kind, node, type)); 13330 const getJSDocSimpleTagCreateFunction = memoizeOne((kind) => (tagName, comment) => createJSDocSimpleTagWorker(kind, tagName, comment)); 13331 const getJSDocSimpleTagUpdateFunction = memoizeOne((kind) => (node, tagName, comment) => updateJSDocSimpleTagWorker(kind, node, tagName, comment)); 13332 const getJSDocTypeLikeTagCreateFunction = memoizeOne((kind) => (tagName, typeExpression, comment) => createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment)); 13333 const getJSDocTypeLikeTagUpdateFunction = memoizeOne((kind) => (node, tagName, typeExpression, comment) => updateJSDocTypeLikeTagWorker(kind, node, tagName, typeExpression, comment)); 13334 const factory2 = { 13335 get parenthesizer() { 13336 return parenthesizerRules(); 13337 }, 13338 get converters() { 13339 return converters(); 13340 }, 13341 baseFactory: baseFactory2, 13342 flags, 13343 createNodeArray, 13344 createNumericLiteral, 13345 createBigIntLiteral, 13346 createStringLiteral, 13347 createStringLiteralFromNode, 13348 createRegularExpressionLiteral, 13349 createLiteralLikeNode, 13350 createIdentifier, 13351 updateIdentifier, 13352 createTempVariable, 13353 createLoopVariable, 13354 createUniqueName, 13355 getGeneratedNameForNode, 13356 createPrivateIdentifier, 13357 createUniquePrivateName, 13358 getGeneratedPrivateNameForNode, 13359 createToken, 13360 createSuper, 13361 createThis, 13362 createNull, 13363 createTrue, 13364 createFalse, 13365 createModifier, 13366 createModifiersFromModifierFlags, 13367 createQualifiedName, 13368 updateQualifiedName, 13369 createComputedPropertyName, 13370 updateComputedPropertyName, 13371 createTypeParameterDeclaration, 13372 updateTypeParameterDeclaration, 13373 createParameterDeclaration, 13374 updateParameterDeclaration, 13375 createDecorator, 13376 updateDecorator, 13377 createPropertySignature, 13378 updatePropertySignature, 13379 createPropertyDeclaration, 13380 updatePropertyDeclaration, 13381 createAnnotationPropertyDeclaration, 13382 updateAnnotationPropertyDeclaration, 13383 createMethodSignature, 13384 updateMethodSignature, 13385 createMethodDeclaration, 13386 updateMethodDeclaration, 13387 createConstructorDeclaration, 13388 updateConstructorDeclaration, 13389 createGetAccessorDeclaration, 13390 updateGetAccessorDeclaration, 13391 createSetAccessorDeclaration, 13392 updateSetAccessorDeclaration, 13393 createCallSignature, 13394 updateCallSignature, 13395 createConstructSignature, 13396 updateConstructSignature, 13397 createIndexSignature, 13398 updateIndexSignature, 13399 createClassStaticBlockDeclaration, 13400 updateClassStaticBlockDeclaration, 13401 createTemplateLiteralTypeSpan, 13402 updateTemplateLiteralTypeSpan, 13403 createKeywordTypeNode, 13404 createTypePredicateNode, 13405 updateTypePredicateNode, 13406 createTypeReferenceNode, 13407 updateTypeReferenceNode, 13408 createFunctionTypeNode, 13409 updateFunctionTypeNode, 13410 createConstructorTypeNode, 13411 updateConstructorTypeNode, 13412 createTypeQueryNode, 13413 updateTypeQueryNode, 13414 createTypeLiteralNode, 13415 updateTypeLiteralNode, 13416 createArrayTypeNode, 13417 updateArrayTypeNode, 13418 createTupleTypeNode, 13419 updateTupleTypeNode, 13420 createNamedTupleMember, 13421 updateNamedTupleMember, 13422 createOptionalTypeNode, 13423 updateOptionalTypeNode, 13424 createRestTypeNode, 13425 updateRestTypeNode, 13426 createUnionTypeNode, 13427 updateUnionTypeNode, 13428 createIntersectionTypeNode, 13429 updateIntersectionTypeNode, 13430 createConditionalTypeNode, 13431 updateConditionalTypeNode, 13432 createInferTypeNode, 13433 updateInferTypeNode, 13434 createImportTypeNode, 13435 updateImportTypeNode, 13436 createParenthesizedType, 13437 updateParenthesizedType, 13438 createThisTypeNode, 13439 createTypeOperatorNode, 13440 updateTypeOperatorNode, 13441 createIndexedAccessTypeNode, 13442 updateIndexedAccessTypeNode, 13443 createMappedTypeNode, 13444 updateMappedTypeNode, 13445 createLiteralTypeNode, 13446 updateLiteralTypeNode, 13447 createTemplateLiteralType, 13448 updateTemplateLiteralType, 13449 createObjectBindingPattern, 13450 updateObjectBindingPattern, 13451 createArrayBindingPattern, 13452 updateArrayBindingPattern, 13453 createBindingElement, 13454 updateBindingElement, 13455 createArrayLiteralExpression, 13456 updateArrayLiteralExpression, 13457 createObjectLiteralExpression, 13458 updateObjectLiteralExpression, 13459 createPropertyAccessExpression: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, name) => setEmitFlags(createPropertyAccessExpression(expression, name), 131072 /* NoIndentation */) : createPropertyAccessExpression, 13460 updatePropertyAccessExpression, 13461 createPropertyAccessChain: flags & 4 /* NoIndentationOnFreshPropertyAccess */ ? (expression, questionDotToken, name) => setEmitFlags(createPropertyAccessChain(expression, questionDotToken, name), 131072 /* NoIndentation */) : createPropertyAccessChain, 13462 updatePropertyAccessChain, 13463 createElementAccessExpression, 13464 updateElementAccessExpression, 13465 createElementAccessChain, 13466 updateElementAccessChain, 13467 createCallExpression, 13468 updateCallExpression, 13469 createCallChain, 13470 updateCallChain, 13471 createNewExpression, 13472 updateNewExpression, 13473 createTaggedTemplateExpression, 13474 updateTaggedTemplateExpression, 13475 createTypeAssertion, 13476 updateTypeAssertion, 13477 createParenthesizedExpression, 13478 updateParenthesizedExpression, 13479 createFunctionExpression, 13480 updateFunctionExpression, 13481 createEtsComponentExpression, 13482 updateEtsComponentExpression, 13483 createArrowFunction, 13484 updateArrowFunction, 13485 createDeleteExpression, 13486 updateDeleteExpression, 13487 createTypeOfExpression, 13488 updateTypeOfExpression, 13489 createVoidExpression, 13490 updateVoidExpression, 13491 createAwaitExpression, 13492 updateAwaitExpression, 13493 createPrefixUnaryExpression, 13494 updatePrefixUnaryExpression, 13495 createPostfixUnaryExpression, 13496 updatePostfixUnaryExpression, 13497 createBinaryExpression, 13498 updateBinaryExpression, 13499 createConditionalExpression, 13500 updateConditionalExpression, 13501 createTemplateExpression, 13502 updateTemplateExpression, 13503 createTemplateHead, 13504 createTemplateMiddle, 13505 createTemplateTail, 13506 createNoSubstitutionTemplateLiteral, 13507 createTemplateLiteralLikeNode, 13508 createYieldExpression, 13509 updateYieldExpression, 13510 createSpreadElement, 13511 updateSpreadElement, 13512 createClassExpression, 13513 updateClassExpression, 13514 createOmittedExpression, 13515 createExpressionWithTypeArguments, 13516 updateExpressionWithTypeArguments, 13517 createAsExpression, 13518 updateAsExpression, 13519 createNonNullExpression, 13520 updateNonNullExpression, 13521 createSatisfiesExpression, 13522 updateSatisfiesExpression, 13523 createNonNullChain, 13524 updateNonNullChain, 13525 createMetaProperty, 13526 updateMetaProperty, 13527 createTemplateSpan, 13528 updateTemplateSpan, 13529 createSemicolonClassElement, 13530 createBlock, 13531 updateBlock, 13532 createVariableStatement, 13533 updateVariableStatement, 13534 createEmptyStatement, 13535 createExpressionStatement, 13536 updateExpressionStatement, 13537 createIfStatement, 13538 updateIfStatement, 13539 createDoStatement, 13540 updateDoStatement, 13541 createWhileStatement, 13542 updateWhileStatement, 13543 createForStatement, 13544 updateForStatement, 13545 createForInStatement, 13546 updateForInStatement, 13547 createForOfStatement, 13548 updateForOfStatement, 13549 createContinueStatement, 13550 updateContinueStatement, 13551 createBreakStatement, 13552 updateBreakStatement, 13553 createReturnStatement, 13554 updateReturnStatement, 13555 createWithStatement, 13556 updateWithStatement, 13557 createSwitchStatement, 13558 updateSwitchStatement, 13559 createLabeledStatement, 13560 updateLabeledStatement, 13561 createThrowStatement, 13562 updateThrowStatement, 13563 createTryStatement, 13564 updateTryStatement, 13565 createDebuggerStatement, 13566 createVariableDeclaration, 13567 updateVariableDeclaration, 13568 createVariableDeclarationList, 13569 updateVariableDeclarationList, 13570 createFunctionDeclaration, 13571 updateFunctionDeclaration, 13572 createClassDeclaration, 13573 updateClassDeclaration, 13574 createStructDeclaration, 13575 updateStructDeclaration, 13576 createAnnotationDeclaration, 13577 updateAnnotationDeclaration, 13578 createInterfaceDeclaration, 13579 updateInterfaceDeclaration, 13580 createTypeAliasDeclaration, 13581 updateTypeAliasDeclaration, 13582 createEnumDeclaration, 13583 updateEnumDeclaration, 13584 createModuleDeclaration, 13585 updateModuleDeclaration, 13586 createModuleBlock, 13587 updateModuleBlock, 13588 createCaseBlock, 13589 updateCaseBlock, 13590 createNamespaceExportDeclaration, 13591 updateNamespaceExportDeclaration, 13592 createImportEqualsDeclaration, 13593 updateImportEqualsDeclaration, 13594 createImportDeclaration, 13595 updateImportDeclaration, 13596 createImportClause, 13597 updateImportClause, 13598 createAssertClause, 13599 updateAssertClause, 13600 createAssertEntry, 13601 updateAssertEntry, 13602 createImportTypeAssertionContainer, 13603 updateImportTypeAssertionContainer, 13604 createNamespaceImport, 13605 updateNamespaceImport, 13606 createNamespaceExport, 13607 updateNamespaceExport, 13608 createNamedImports, 13609 updateNamedImports, 13610 createImportSpecifier, 13611 updateImportSpecifier, 13612 createExportAssignment, 13613 updateExportAssignment, 13614 createExportDeclaration, 13615 updateExportDeclaration, 13616 createNamedExports, 13617 updateNamedExports, 13618 createExportSpecifier, 13619 updateExportSpecifier, 13620 createMissingDeclaration, 13621 createExternalModuleReference, 13622 updateExternalModuleReference, 13623 get createJSDocAllType() { 13624 return getJSDocPrimaryTypeCreateFunction(321 /* JSDocAllType */); 13625 }, 13626 get createJSDocUnknownType() { 13627 return getJSDocPrimaryTypeCreateFunction(322 /* JSDocUnknownType */); 13628 }, 13629 get createJSDocNonNullableType() { 13630 return getJSDocPrePostfixUnaryTypeCreateFunction(324 /* JSDocNonNullableType */); 13631 }, 13632 get updateJSDocNonNullableType() { 13633 return getJSDocPrePostfixUnaryTypeUpdateFunction(324 /* JSDocNonNullableType */); 13634 }, 13635 get createJSDocNullableType() { 13636 return getJSDocPrePostfixUnaryTypeCreateFunction(323 /* JSDocNullableType */); 13637 }, 13638 get updateJSDocNullableType() { 13639 return getJSDocPrePostfixUnaryTypeUpdateFunction(323 /* JSDocNullableType */); 13640 }, 13641 get createJSDocOptionalType() { 13642 return getJSDocUnaryTypeCreateFunction(325 /* JSDocOptionalType */); 13643 }, 13644 get updateJSDocOptionalType() { 13645 return getJSDocUnaryTypeUpdateFunction(325 /* JSDocOptionalType */); 13646 }, 13647 get createJSDocVariadicType() { 13648 return getJSDocUnaryTypeCreateFunction(327 /* JSDocVariadicType */); 13649 }, 13650 get updateJSDocVariadicType() { 13651 return getJSDocUnaryTypeUpdateFunction(327 /* JSDocVariadicType */); 13652 }, 13653 get createJSDocNamepathType() { 13654 return getJSDocUnaryTypeCreateFunction(328 /* JSDocNamepathType */); 13655 }, 13656 get updateJSDocNamepathType() { 13657 return getJSDocUnaryTypeUpdateFunction(328 /* JSDocNamepathType */); 13658 }, 13659 createJSDocFunctionType, 13660 updateJSDocFunctionType, 13661 createJSDocTypeLiteral, 13662 updateJSDocTypeLiteral, 13663 createJSDocTypeExpression, 13664 updateJSDocTypeExpression, 13665 createJSDocSignature, 13666 updateJSDocSignature, 13667 createJSDocTemplateTag, 13668 updateJSDocTemplateTag, 13669 createJSDocTypedefTag, 13670 updateJSDocTypedefTag, 13671 createJSDocParameterTag, 13672 updateJSDocParameterTag, 13673 createJSDocPropertyTag, 13674 updateJSDocPropertyTag, 13675 createJSDocCallbackTag, 13676 updateJSDocCallbackTag, 13677 createJSDocAugmentsTag, 13678 updateJSDocAugmentsTag, 13679 createJSDocImplementsTag, 13680 updateJSDocImplementsTag, 13681 createJSDocSeeTag, 13682 updateJSDocSeeTag, 13683 createJSDocNameReference, 13684 updateJSDocNameReference, 13685 createJSDocMemberName, 13686 updateJSDocMemberName, 13687 createJSDocLink, 13688 updateJSDocLink, 13689 createJSDocLinkCode, 13690 updateJSDocLinkCode, 13691 createJSDocLinkPlain, 13692 updateJSDocLinkPlain, 13693 get createJSDocTypeTag() { 13694 return getJSDocTypeLikeTagCreateFunction(352 /* JSDocTypeTag */); 13695 }, 13696 get updateJSDocTypeTag() { 13697 return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocTypeTag */); 13698 }, 13699 get createJSDocReturnTag() { 13700 return getJSDocTypeLikeTagCreateFunction(350 /* JSDocReturnTag */); 13701 }, 13702 get updateJSDocReturnTag() { 13703 return getJSDocTypeLikeTagUpdateFunction(350 /* JSDocReturnTag */); 13704 }, 13705 get createJSDocThisTag() { 13706 return getJSDocTypeLikeTagCreateFunction(351 /* JSDocThisTag */); 13707 }, 13708 get updateJSDocThisTag() { 13709 return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocThisTag */); 13710 }, 13711 get createJSDocEnumTag() { 13712 return getJSDocTypeLikeTagCreateFunction(348 /* JSDocEnumTag */); 13713 }, 13714 get updateJSDocEnumTag() { 13715 return getJSDocTypeLikeTagUpdateFunction(348 /* JSDocEnumTag */); 13716 }, 13717 get createJSDocAuthorTag() { 13718 return getJSDocSimpleTagCreateFunction(339 /* JSDocAuthorTag */); 13719 }, 13720 get updateJSDocAuthorTag() { 13721 return getJSDocSimpleTagUpdateFunction(339 /* JSDocAuthorTag */); 13722 }, 13723 get createJSDocClassTag() { 13724 return getJSDocSimpleTagCreateFunction(341 /* JSDocClassTag */); 13725 }, 13726 get updateJSDocClassTag() { 13727 return getJSDocSimpleTagUpdateFunction(341 /* JSDocClassTag */); 13728 }, 13729 get createJSDocPublicTag() { 13730 return getJSDocSimpleTagCreateFunction(342 /* JSDocPublicTag */); 13731 }, 13732 get updateJSDocPublicTag() { 13733 return getJSDocSimpleTagUpdateFunction(342 /* JSDocPublicTag */); 13734 }, 13735 get createJSDocPrivateTag() { 13736 return getJSDocSimpleTagCreateFunction(343 /* JSDocPrivateTag */); 13737 }, 13738 get updateJSDocPrivateTag() { 13739 return getJSDocSimpleTagUpdateFunction(343 /* JSDocPrivateTag */); 13740 }, 13741 get createJSDocProtectedTag() { 13742 return getJSDocSimpleTagCreateFunction(344 /* JSDocProtectedTag */); 13743 }, 13744 get updateJSDocProtectedTag() { 13745 return getJSDocSimpleTagUpdateFunction(344 /* JSDocProtectedTag */); 13746 }, 13747 get createJSDocReadonlyTag() { 13748 return getJSDocSimpleTagCreateFunction(345 /* JSDocReadonlyTag */); 13749 }, 13750 get updateJSDocReadonlyTag() { 13751 return getJSDocSimpleTagUpdateFunction(345 /* JSDocReadonlyTag */); 13752 }, 13753 get createJSDocOverrideTag() { 13754 return getJSDocSimpleTagCreateFunction(346 /* JSDocOverrideTag */); 13755 }, 13756 get updateJSDocOverrideTag() { 13757 return getJSDocSimpleTagUpdateFunction(346 /* JSDocOverrideTag */); 13758 }, 13759 get createJSDocDeprecatedTag() { 13760 return getJSDocSimpleTagCreateFunction(340 /* JSDocDeprecatedTag */); 13761 }, 13762 get updateJSDocDeprecatedTag() { 13763 return getJSDocSimpleTagUpdateFunction(340 /* JSDocDeprecatedTag */); 13764 }, 13765 createJSDocUnknownTag, 13766 updateJSDocUnknownTag, 13767 createJSDocText, 13768 updateJSDocText, 13769 createJSDocComment, 13770 updateJSDocComment, 13771 createJsxElement, 13772 updateJsxElement, 13773 createJsxSelfClosingElement, 13774 updateJsxSelfClosingElement, 13775 createJsxOpeningElement, 13776 updateJsxOpeningElement, 13777 createJsxClosingElement, 13778 updateJsxClosingElement, 13779 createJsxFragment, 13780 createJsxText, 13781 updateJsxText, 13782 createJsxOpeningFragment, 13783 createJsxJsxClosingFragment, 13784 updateJsxFragment, 13785 createJsxAttribute, 13786 updateJsxAttribute, 13787 createJsxAttributes, 13788 updateJsxAttributes, 13789 createJsxSpreadAttribute, 13790 updateJsxSpreadAttribute, 13791 createJsxExpression, 13792 updateJsxExpression, 13793 createCaseClause, 13794 updateCaseClause, 13795 createDefaultClause, 13796 updateDefaultClause, 13797 createHeritageClause, 13798 updateHeritageClause, 13799 createCatchClause, 13800 updateCatchClause, 13801 createPropertyAssignment, 13802 updatePropertyAssignment, 13803 createShorthandPropertyAssignment, 13804 updateShorthandPropertyAssignment, 13805 createSpreadAssignment, 13806 updateSpreadAssignment, 13807 createEnumMember, 13808 updateEnumMember, 13809 createSourceFile: createSourceFile2, 13810 updateSourceFile, 13811 createBundle, 13812 updateBundle, 13813 createUnparsedSource, 13814 createUnparsedPrologue, 13815 createUnparsedPrepend, 13816 createUnparsedTextLike, 13817 createUnparsedSyntheticReference, 13818 createInputFiles: createInputFiles2, 13819 createSyntheticExpression, 13820 createSyntaxList, 13821 createNotEmittedStatement, 13822 createPartiallyEmittedExpression, 13823 updatePartiallyEmittedExpression, 13824 createCommaListExpression, 13825 updateCommaListExpression, 13826 createEndOfDeclarationMarker, 13827 createMergeDeclarationMarker, 13828 createSyntheticReferenceExpression, 13829 updateSyntheticReferenceExpression, 13830 cloneNode, 13831 get createComma() { 13832 return getBinaryCreateFunction(27 /* CommaToken */); 13833 }, 13834 get createAssignment() { 13835 return getBinaryCreateFunction(63 /* EqualsToken */); 13836 }, 13837 get createLogicalOr() { 13838 return getBinaryCreateFunction(56 /* BarBarToken */); 13839 }, 13840 get createLogicalAnd() { 13841 return getBinaryCreateFunction(55 /* AmpersandAmpersandToken */); 13842 }, 13843 get createBitwiseOr() { 13844 return getBinaryCreateFunction(51 /* BarToken */); 13845 }, 13846 get createBitwiseXor() { 13847 return getBinaryCreateFunction(52 /* CaretToken */); 13848 }, 13849 get createBitwiseAnd() { 13850 return getBinaryCreateFunction(50 /* AmpersandToken */); 13851 }, 13852 get createStrictEquality() { 13853 return getBinaryCreateFunction(36 /* EqualsEqualsEqualsToken */); 13854 }, 13855 get createStrictInequality() { 13856 return getBinaryCreateFunction(37 /* ExclamationEqualsEqualsToken */); 13857 }, 13858 get createEquality() { 13859 return getBinaryCreateFunction(34 /* EqualsEqualsToken */); 13860 }, 13861 get createInequality() { 13862 return getBinaryCreateFunction(35 /* ExclamationEqualsToken */); 13863 }, 13864 get createLessThan() { 13865 return getBinaryCreateFunction(29 /* LessThanToken */); 13866 }, 13867 get createLessThanEquals() { 13868 return getBinaryCreateFunction(32 /* LessThanEqualsToken */); 13869 }, 13870 get createGreaterThan() { 13871 return getBinaryCreateFunction(31 /* GreaterThanToken */); 13872 }, 13873 get createGreaterThanEquals() { 13874 return getBinaryCreateFunction(33 /* GreaterThanEqualsToken */); 13875 }, 13876 get createLeftShift() { 13877 return getBinaryCreateFunction(47 /* LessThanLessThanToken */); 13878 }, 13879 get createRightShift() { 13880 return getBinaryCreateFunction(48 /* GreaterThanGreaterThanToken */); 13881 }, 13882 get createUnsignedRightShift() { 13883 return getBinaryCreateFunction(49 /* GreaterThanGreaterThanGreaterThanToken */); 13884 }, 13885 get createAdd() { 13886 return getBinaryCreateFunction(39 /* PlusToken */); 13887 }, 13888 get createSubtract() { 13889 return getBinaryCreateFunction(40 /* MinusToken */); 13890 }, 13891 get createMultiply() { 13892 return getBinaryCreateFunction(41 /* AsteriskToken */); 13893 }, 13894 get createDivide() { 13895 return getBinaryCreateFunction(43 /* SlashToken */); 13896 }, 13897 get createModulo() { 13898 return getBinaryCreateFunction(44 /* PercentToken */); 13899 }, 13900 get createExponent() { 13901 return getBinaryCreateFunction(42 /* AsteriskAsteriskToken */); 13902 }, 13903 get createPrefixPlus() { 13904 return getPrefixUnaryCreateFunction(39 /* PlusToken */); 13905 }, 13906 get createPrefixMinus() { 13907 return getPrefixUnaryCreateFunction(40 /* MinusToken */); 13908 }, 13909 get createPrefixIncrement() { 13910 return getPrefixUnaryCreateFunction(45 /* PlusPlusToken */); 13911 }, 13912 get createPrefixDecrement() { 13913 return getPrefixUnaryCreateFunction(46 /* MinusMinusToken */); 13914 }, 13915 get createBitwiseNot() { 13916 return getPrefixUnaryCreateFunction(54 /* TildeToken */); 13917 }, 13918 get createLogicalNot() { 13919 return getPrefixUnaryCreateFunction(53 /* ExclamationToken */); 13920 }, 13921 get createPostfixIncrement() { 13922 return getPostfixUnaryCreateFunction(45 /* PlusPlusToken */); 13923 }, 13924 get createPostfixDecrement() { 13925 return getPostfixUnaryCreateFunction(46 /* MinusMinusToken */); 13926 }, 13927 createImmediatelyInvokedFunctionExpression, 13928 createImmediatelyInvokedArrowFunction, 13929 createVoidZero, 13930 createExportDefault, 13931 createExternalModuleExport, 13932 createTypeCheck, 13933 createMethodCall, 13934 createGlobalMethodCall, 13935 createFunctionBindCall, 13936 createFunctionCallCall, 13937 createFunctionApplyCall, 13938 createArraySliceCall, 13939 createArrayConcatCall, 13940 createObjectDefinePropertyCall, 13941 createReflectGetCall, 13942 createReflectSetCall, 13943 createPropertyDescriptor, 13944 createCallBinding, 13945 createAssignmentTargetWrapper, 13946 inlineExpressions, 13947 getInternalName, 13948 getLocalName, 13949 getExportName, 13950 getDeclarationName, 13951 getNamespaceMemberName, 13952 getExternalModuleOrNamespaceExportName, 13953 restoreOuterExpressions, 13954 restoreEnclosingLabel, 13955 createUseStrictPrologue, 13956 copyPrologue, 13957 copyStandardPrologue, 13958 copyCustomPrologue, 13959 ensureUseStrict, 13960 liftToBlock, 13961 mergeLexicalEnvironment, 13962 updateModifiers 13963 }; 13964 forEach(nodeFactoryPatchers, (fn) => fn(factory2)); 13965 return factory2; 13966 function createNodeArray(elements, hasTrailingComma) { 13967 if (elements === void 0 || elements === emptyArray) { 13968 elements = []; 13969 } else if (isNodeArray(elements)) { 13970 if (hasTrailingComma === void 0 || elements.hasTrailingComma === hasTrailingComma) { 13971 if (elements.transformFlags === void 0) { 13972 aggregateChildrenFlags(elements); 13973 } 13974 Debug.attachNodeArrayDebugInfo(elements); 13975 return elements; 13976 } 13977 const array2 = elements.slice(); 13978 array2.pos = elements.pos; 13979 array2.end = elements.end; 13980 array2.hasTrailingComma = hasTrailingComma; 13981 array2.transformFlags = elements.transformFlags; 13982 Debug.attachNodeArrayDebugInfo(array2); 13983 return array2; 13984 } 13985 const length2 = elements.length; 13986 const array = length2 >= 1 && length2 <= 4 ? elements.slice() : elements; 13987 setTextRangePosEnd(array, -1, -1); 13988 array.hasTrailingComma = !!hasTrailingComma; 13989 aggregateChildrenFlags(array); 13990 Debug.attachNodeArrayDebugInfo(array); 13991 return array; 13992 } 13993 function createBaseNode(kind) { 13994 return baseFactory2.createBaseNode(kind); 13995 } 13996 function createBaseDeclaration(kind) { 13997 const node = createBaseNode(kind); 13998 node.symbol = void 0; 13999 node.localSymbol = void 0; 14000 node.locals = void 0; 14001 node.nextContainer = void 0; 14002 return node; 14003 } 14004 function createBaseNamedDeclaration(kind, modifiers, name) { 14005 const node = createBaseDeclaration(kind); 14006 name = asName(name); 14007 node.name = name; 14008 if (canHaveModifiers(node)) { 14009 node.modifiers = asNodeArray(modifiers); 14010 node.transformFlags |= propagateChildrenFlags(node.modifiers); 14011 } 14012 if (name) { 14013 switch (node.kind) { 14014 case 174 /* MethodDeclaration */: 14015 case 177 /* GetAccessor */: 14016 case 178 /* SetAccessor */: 14017 case 171 /* PropertyDeclaration */: 14018 case 172 /* AnnotationPropertyDeclaration */: 14019 case 305 /* PropertyAssignment */: 14020 if (isIdentifier(name)) { 14021 node.transformFlags |= propagateIdentifierNameFlags(name); 14022 break; 14023 } 14024 default: 14025 node.transformFlags |= propagateChildFlags(name); 14026 break; 14027 } 14028 } 14029 return node; 14030 } 14031 function createBaseGenericNamedDeclaration(kind, modifiers, name, typeParameters) { 14032 const node = createBaseNamedDeclaration( 14033 kind, 14034 modifiers, 14035 name 14036 ); 14037 node.typeParameters = asNodeArray(typeParameters); 14038 node.transformFlags |= propagateChildrenFlags(node.typeParameters); 14039 if (typeParameters) 14040 node.transformFlags |= 1 /* ContainsTypeScript */; 14041 return node; 14042 } 14043 function createBaseSignatureDeclaration(kind, modifiers, name, typeParameters, parameters, type) { 14044 const node = createBaseGenericNamedDeclaration( 14045 kind, 14046 modifiers, 14047 name, 14048 typeParameters 14049 ); 14050 node.parameters = createNodeArray(parameters); 14051 node.type = type; 14052 node.transformFlags |= propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type); 14053 if (type) 14054 node.transformFlags |= 1 /* ContainsTypeScript */; 14055 node.typeArguments = void 0; 14056 return node; 14057 } 14058 function finishUpdateBaseSignatureDeclaration(updated, original) { 14059 if (updated !== original) { 14060 updated.typeArguments = original.typeArguments; 14061 } 14062 return update(updated, original); 14063 } 14064 function createBaseFunctionLikeDeclaration(kind, modifiers, name, typeParameters, parameters, type, body) { 14065 const node = createBaseSignatureDeclaration( 14066 kind, 14067 modifiers, 14068 name, 14069 typeParameters, 14070 parameters, 14071 type 14072 ); 14073 node.body = body; 14074 node.transformFlags |= propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */; 14075 if (!body) 14076 node.transformFlags |= 1 /* ContainsTypeScript */; 14077 return node; 14078 } 14079 function createBaseInterfaceOrClassLikeDeclaration(kind, modifiers, name, typeParameters, heritageClauses) { 14080 const node = createBaseGenericNamedDeclaration( 14081 kind, 14082 modifiers, 14083 name, 14084 typeParameters 14085 ); 14086 node.heritageClauses = asNodeArray(heritageClauses); 14087 node.transformFlags |= propagateChildrenFlags(node.heritageClauses); 14088 return node; 14089 } 14090 function createBaseClassLikeDeclaration(kind, modifiers, name, typeParameters, heritageClauses, members) { 14091 const node = createBaseInterfaceOrClassLikeDeclaration( 14092 kind, 14093 modifiers, 14094 name, 14095 typeParameters, 14096 heritageClauses 14097 ); 14098 node.members = createNodeArray(members); 14099 node.transformFlags |= propagateChildrenFlags(node.members); 14100 return node; 14101 } 14102 function createBaseBindingLikeDeclaration(kind, modifiers, name, initializer) { 14103 const node = createBaseNamedDeclaration( 14104 kind, 14105 modifiers, 14106 name 14107 ); 14108 node.initializer = initializer; 14109 node.transformFlags |= propagateChildFlags(node.initializer); 14110 return node; 14111 } 14112 function createBaseVariableLikeDeclaration(kind, modifiers, name, type, initializer) { 14113 const node = createBaseBindingLikeDeclaration( 14114 kind, 14115 modifiers, 14116 name, 14117 initializer 14118 ); 14119 node.type = type; 14120 node.transformFlags |= propagateChildFlags(type); 14121 if (type) 14122 node.transformFlags |= 1 /* ContainsTypeScript */; 14123 return node; 14124 } 14125 function createBaseLiteral(kind, text) { 14126 const node = createBaseToken(kind); 14127 node.text = text; 14128 return node; 14129 } 14130 function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) { 14131 const node = createBaseLiteral(8 /* NumericLiteral */, typeof value === "number" ? value + "" : value); 14132 node.numericLiteralFlags = numericLiteralFlags; 14133 if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */) 14134 node.transformFlags |= 1024 /* ContainsES2015 */; 14135 return node; 14136 } 14137 function createBigIntLiteral(value) { 14138 const node = createBaseLiteral(9 /* BigIntLiteral */, typeof value === "string" ? value : pseudoBigIntToString(value) + "n"); 14139 node.transformFlags |= 4 /* ContainsESNext */; 14140 return node; 14141 } 14142 function createBaseStringLiteral(text, isSingleQuote) { 14143 const node = createBaseLiteral(10 /* StringLiteral */, text); 14144 node.singleQuote = isSingleQuote; 14145 return node; 14146 } 14147 function createStringLiteral(text, isSingleQuote, hasExtendedUnicodeEscape) { 14148 const node = createBaseStringLiteral(text, isSingleQuote); 14149 node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape; 14150 if (hasExtendedUnicodeEscape) 14151 node.transformFlags |= 1024 /* ContainsES2015 */; 14152 return node; 14153 } 14154 function createStringLiteralFromNode(sourceNode) { 14155 const node = createBaseStringLiteral(getTextOfIdentifierOrLiteral(sourceNode), void 0); 14156 node.textSourceNode = sourceNode; 14157 return node; 14158 } 14159 function createRegularExpressionLiteral(text) { 14160 const node = createBaseLiteral(13 /* RegularExpressionLiteral */, text); 14161 return node; 14162 } 14163 function createLiteralLikeNode(kind, text) { 14164 switch (kind) { 14165 case 8 /* NumericLiteral */: 14166 return createNumericLiteral(text, 0); 14167 case 9 /* BigIntLiteral */: 14168 return createBigIntLiteral(text); 14169 case 10 /* StringLiteral */: 14170 return createStringLiteral(text, void 0); 14171 case 11 /* JsxText */: 14172 return createJsxText(text, false); 14173 case 12 /* JsxTextAllWhiteSpaces */: 14174 return createJsxText(text, true); 14175 case 13 /* RegularExpressionLiteral */: 14176 return createRegularExpressionLiteral(text); 14177 case 14 /* NoSubstitutionTemplateLiteral */: 14178 return createTemplateLiteralLikeNode(kind, text, void 0, 0); 14179 } 14180 } 14181 function createBaseIdentifier(text, originalKeywordKind) { 14182 if (originalKeywordKind === void 0 && text) { 14183 originalKeywordKind = stringToToken(text); 14184 } 14185 if (originalKeywordKind === 79 /* Identifier */) { 14186 originalKeywordKind = void 0; 14187 } 14188 const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */); 14189 node.originalKeywordKind = originalKeywordKind; 14190 node.escapedText = escapeLeadingUnderscores(text); 14191 return node; 14192 } 14193 function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) { 14194 const node = createBaseIdentifier(text, void 0); 14195 node.autoGenerateFlags = autoGenerateFlags; 14196 node.autoGenerateId = nextAutoGenerateId; 14197 node.autoGeneratePrefix = prefix; 14198 node.autoGenerateSuffix = suffix; 14199 nextAutoGenerateId++; 14200 return node; 14201 } 14202 function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) { 14203 const node = createBaseIdentifier(text, originalKeywordKind); 14204 if (typeArguments) { 14205 node.typeArguments = createNodeArray(typeArguments); 14206 } 14207 if (node.originalKeywordKind === 134 /* AwaitKeyword */) { 14208 node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */; 14209 } 14210 if (hasExtendedUnicodeEscape) { 14211 node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape; 14212 node.transformFlags |= 1024 /* ContainsES2015 */; 14213 } 14214 return node; 14215 } 14216 function updateIdentifier(node, typeArguments) { 14217 return node.typeArguments !== typeArguments ? update(createIdentifier(idText(node), typeArguments), node) : node; 14218 } 14219 function createTempVariable(recordTempVariable, reservedInNestedScopes, prefix, suffix) { 14220 let flags2 = 1 /* Auto */; 14221 if (reservedInNestedScopes) 14222 flags2 |= 8 /* ReservedInNestedScopes */; 14223 const name = createBaseGeneratedIdentifier("", flags2, prefix, suffix); 14224 if (recordTempVariable) { 14225 recordTempVariable(name); 14226 } 14227 return name; 14228 } 14229 function createLoopVariable(reservedInNestedScopes) { 14230 let flags2 = 2 /* Loop */; 14231 if (reservedInNestedScopes) 14232 flags2 |= 8 /* ReservedInNestedScopes */; 14233 return createBaseGeneratedIdentifier("", flags2, void 0, void 0); 14234 } 14235 function createUniqueName(text, flags2 = 0 /* None */, prefix, suffix) { 14236 Debug.assert(!(flags2 & 7 /* KindMask */), "Argument out of range: flags"); 14237 Debug.assert((flags2 & (16 /* Optimistic */ | 32 /* FileLevel */)) !== 32 /* FileLevel */, "GeneratedIdentifierFlags.FileLevel cannot be set without also setting GeneratedIdentifierFlags.Optimistic"); 14238 return createBaseGeneratedIdentifier(text, 3 /* Unique */ | flags2, prefix, suffix); 14239 } 14240 function getGeneratedNameForNode(node, flags2 = 0, prefix, suffix) { 14241 Debug.assert(!(flags2 & 7 /* KindMask */), "Argument out of range: flags"); 14242 const text = !node ? "" : isMemberName(node) ? formatGeneratedName(false, prefix, node, suffix, idText) : `generated@${getNodeId(node)}`; 14243 if (prefix || suffix) 14244 flags2 |= 16 /* Optimistic */; 14245 const name = createBaseGeneratedIdentifier(text, 4 /* Node */ | flags2, prefix, suffix); 14246 name.original = node; 14247 return name; 14248 } 14249 function createBasePrivateIdentifier(text) { 14250 const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */); 14251 node.escapedText = escapeLeadingUnderscores(text); 14252 node.transformFlags |= 16777216 /* ContainsClassFields */; 14253 return node; 14254 } 14255 function createPrivateIdentifier(text) { 14256 if (!startsWith(text, "#")) 14257 Debug.fail("First character of private identifier must be #: " + text); 14258 return createBasePrivateIdentifier(text); 14259 } 14260 function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) { 14261 const node = createBasePrivateIdentifier(text); 14262 node.autoGenerateFlags = autoGenerateFlags; 14263 node.autoGenerateId = nextAutoGenerateId; 14264 node.autoGeneratePrefix = prefix; 14265 node.autoGenerateSuffix = suffix; 14266 nextAutoGenerateId++; 14267 return node; 14268 } 14269 function createUniquePrivateName(text, prefix, suffix) { 14270 if (text && !startsWith(text, "#")) 14271 Debug.fail("First character of private identifier must be #: " + text); 14272 const autoGenerateFlags = 8 /* ReservedInNestedScopes */ | (text ? 3 /* Unique */ : 1 /* Auto */); 14273 return createBaseGeneratedPrivateIdentifier(text != null ? text : "", autoGenerateFlags, prefix, suffix); 14274 } 14275 function getGeneratedPrivateNameForNode(node, prefix, suffix) { 14276 const text = isMemberName(node) ? formatGeneratedName(true, prefix, node, suffix, idText) : `#generated@${getNodeId(node)}`; 14277 const flags2 = prefix || suffix ? 16 /* Optimistic */ : 0 /* None */; 14278 const name = createBaseGeneratedPrivateIdentifier(text, 4 /* Node */ | flags2, prefix, suffix); 14279 name.original = node; 14280 return name; 14281 } 14282 function createBaseToken(kind) { 14283 return baseFactory2.createBaseTokenNode(kind); 14284 } 14285 function createToken(token) { 14286 Debug.assert(token >= 0 /* FirstToken */ && token <= 164 /* LastToken */, "Invalid token"); 14287 Debug.assert(token <= 14 /* FirstTemplateToken */ || token >= 17 /* LastTemplateToken */, "Invalid token. Use 'createTemplateLiteralLikeNode' to create template literals."); 14288 Debug.assert(token <= 8 /* FirstLiteralToken */ || token >= 14 /* LastLiteralToken */, "Invalid token. Use 'createLiteralLikeNode' to create literals."); 14289 Debug.assert(token !== 79 /* Identifier */, "Invalid token. Use 'createIdentifier' to create identifiers"); 14290 const node = createBaseToken(token); 14291 let transformFlags = 0 /* None */; 14292 switch (token) { 14293 case 133 /* AsyncKeyword */: 14294 transformFlags = 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */; 14295 break; 14296 case 124 /* PublicKeyword */: 14297 case 122 /* PrivateKeyword */: 14298 case 123 /* ProtectedKeyword */: 14299 case 147 /* ReadonlyKeyword */: 14300 case 127 /* AbstractKeyword */: 14301 case 137 /* DeclareKeyword */: 14302 case 86 /* ConstKeyword */: 14303 case 132 /* AnyKeyword */: 14304 case 149 /* NumberKeyword */: 14305 case 162 /* BigIntKeyword */: 14306 case 145 /* NeverKeyword */: 14307 case 150 /* ObjectKeyword */: 14308 case 102 /* InKeyword */: 14309 case 146 /* OutKeyword */: 14310 case 163 /* OverrideKeyword */: 14311 case 153 /* StringKeyword */: 14312 case 135 /* BooleanKeyword */: 14313 case 154 /* SymbolKeyword */: 14314 case 115 /* VoidKeyword */: 14315 case 159 /* UnknownKeyword */: 14316 case 157 /* UndefinedKeyword */: 14317 transformFlags = 1 /* ContainsTypeScript */; 14318 break; 14319 case 107 /* SuperKeyword */: 14320 transformFlags = 1024 /* ContainsES2015 */ | 134217728 /* ContainsLexicalSuper */; 14321 break; 14322 case 125 /* StaticKeyword */: 14323 transformFlags = 1024 /* ContainsES2015 */; 14324 break; 14325 case 128 /* AccessorKeyword */: 14326 transformFlags = 16777216 /* ContainsClassFields */; 14327 break; 14328 case 109 /* ThisKeyword */: 14329 transformFlags = 16384 /* ContainsLexicalThis */; 14330 break; 14331 } 14332 if (transformFlags) { 14333 node.transformFlags |= transformFlags; 14334 } 14335 return node; 14336 } 14337 function createSuper() { 14338 return createToken(107 /* SuperKeyword */); 14339 } 14340 function createThis() { 14341 return createToken(109 /* ThisKeyword */); 14342 } 14343 function createNull() { 14344 return createToken(105 /* NullKeyword */); 14345 } 14346 function createTrue() { 14347 return createToken(111 /* TrueKeyword */); 14348 } 14349 function createFalse() { 14350 return createToken(96 /* FalseKeyword */); 14351 } 14352 function createModifier(kind) { 14353 return createToken(kind); 14354 } 14355 function createModifiersFromModifierFlags(flags2) { 14356 const result = []; 14357 if (flags2 & 1 /* Export */) 14358 result.push(createModifier(94 /* ExportKeyword */)); 14359 if (flags2 & 2 /* Ambient */) 14360 result.push(createModifier(137 /* DeclareKeyword */)); 14361 if (flags2 & 1024 /* Default */) 14362 result.push(createModifier(89 /* DefaultKeyword */)); 14363 if (flags2 & 2048 /* Const */) 14364 result.push(createModifier(86 /* ConstKeyword */)); 14365 if (flags2 & 4 /* Public */) 14366 result.push(createModifier(124 /* PublicKeyword */)); 14367 if (flags2 & 8 /* Private */) 14368 result.push(createModifier(122 /* PrivateKeyword */)); 14369 if (flags2 & 16 /* Protected */) 14370 result.push(createModifier(123 /* ProtectedKeyword */)); 14371 if (flags2 & 256 /* Abstract */) 14372 result.push(createModifier(127 /* AbstractKeyword */)); 14373 if (flags2 & 32 /* Static */) 14374 result.push(createModifier(125 /* StaticKeyword */)); 14375 if (flags2 & 16384 /* Override */) 14376 result.push(createModifier(163 /* OverrideKeyword */)); 14377 if (flags2 & 64 /* Readonly */) 14378 result.push(createModifier(147 /* ReadonlyKeyword */)); 14379 if (flags2 & 128 /* Accessor */) 14380 result.push(createModifier(128 /* AccessorKeyword */)); 14381 if (flags2 & 512 /* Async */) 14382 result.push(createModifier(133 /* AsyncKeyword */)); 14383 if (flags2 & 32768 /* In */) 14384 result.push(createModifier(102 /* InKeyword */)); 14385 if (flags2 & 65536 /* Out */) 14386 result.push(createModifier(146 /* OutKeyword */)); 14387 return result.length ? result : void 0; 14388 } 14389 function createQualifiedName(left, right) { 14390 const node = createBaseNode(165 /* QualifiedName */); 14391 node.left = left; 14392 node.right = asName(right); 14393 node.transformFlags |= propagateChildFlags(node.left) | propagateIdentifierNameFlags(node.right); 14394 return node; 14395 } 14396 function updateQualifiedName(node, left, right) { 14397 return node.left !== left || node.right !== right ? update(createQualifiedName(left, right), node) : node; 14398 } 14399 function createComputedPropertyName(expression) { 14400 const node = createBaseNode(166 /* ComputedPropertyName */); 14401 node.expression = parenthesizerRules().parenthesizeExpressionOfComputedPropertyName(expression); 14402 node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 131072 /* ContainsComputedPropertyName */; 14403 return node; 14404 } 14405 function updateComputedPropertyName(node, expression) { 14406 return node.expression !== expression ? update(createComputedPropertyName(expression), node) : node; 14407 } 14408 function createTypeParameterDeclaration(modifiers, name, constraint, defaultType) { 14409 const node = createBaseNamedDeclaration( 14410 167 /* TypeParameter */, 14411 modifiers, 14412 name 14413 ); 14414 node.constraint = constraint; 14415 node.default = defaultType; 14416 node.transformFlags = 1 /* ContainsTypeScript */; 14417 return node; 14418 } 14419 function updateTypeParameterDeclaration(node, modifiers, name, constraint, defaultType) { 14420 return node.modifiers !== modifiers || node.name !== name || node.constraint !== constraint || node.default !== defaultType ? update(createTypeParameterDeclaration(modifiers, name, constraint, defaultType), node) : node; 14421 } 14422 function createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) { 14423 const node = createBaseVariableLikeDeclaration( 14424 168 /* Parameter */, 14425 modifiers, 14426 name, 14427 type, 14428 initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer) 14429 ); 14430 node.dotDotDotToken = dotDotDotToken; 14431 node.questionToken = questionToken; 14432 if (isThisIdentifier(node.name)) { 14433 node.transformFlags = 1 /* ContainsTypeScript */; 14434 } else { 14435 node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.questionToken); 14436 if (questionToken) 14437 node.transformFlags |= 1 /* ContainsTypeScript */; 14438 if (modifiersToFlags(node.modifiers) & 16476 /* ParameterPropertyModifier */) 14439 node.transformFlags |= 8192 /* ContainsTypeScriptClassSyntax */; 14440 if (initializer || dotDotDotToken) 14441 node.transformFlags |= 1024 /* ContainsES2015 */; 14442 } 14443 return node; 14444 } 14445 function updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) { 14446 return node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type || node.initializer !== initializer ? update(createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer), node) : node; 14447 } 14448 function createDecorator(expression, annotationDeclaration) { 14449 const node = createBaseNode(169 /* Decorator */); 14450 node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false); 14451 node.annotationDeclaration = annotationDeclaration; 14452 node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */ | 8192 /* ContainsTypeScriptClassSyntax */ | 33554432 /* ContainsDecorators */; 14453 return node; 14454 } 14455 function updateDecorator(node, expression, annotationDeclaration) { 14456 return node.expression !== expression || node.annotationDeclaration !== annotationDeclaration ? update(createDecorator(expression, annotationDeclaration), node) : node; 14457 } 14458 function createPropertySignature(modifiers, name, questionToken, type) { 14459 const node = createBaseNamedDeclaration( 14460 170 /* PropertySignature */, 14461 modifiers, 14462 name 14463 ); 14464 node.type = type; 14465 node.questionToken = questionToken; 14466 node.transformFlags = 1 /* ContainsTypeScript */; 14467 node.initializer = void 0; 14468 return node; 14469 } 14470 function updatePropertySignature(node, modifiers, name, questionToken, type) { 14471 return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.type !== type ? finishUpdatePropertySignature(createPropertySignature(modifiers, name, questionToken, type), node) : node; 14472 } 14473 function finishUpdatePropertySignature(updated, original) { 14474 if (updated !== original) { 14475 updated.initializer = original.initializer; 14476 } 14477 return update(updated, original); 14478 } 14479 function createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer) { 14480 const node = createBaseVariableLikeDeclaration( 14481 171 /* PropertyDeclaration */, 14482 modifiers, 14483 name, 14484 type, 14485 initializer 14486 ); 14487 node.questionToken = questionOrExclamationToken && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0; 14488 node.exclamationToken = questionOrExclamationToken && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0; 14489 node.transformFlags |= propagateChildFlags(node.questionToken) | propagateChildFlags(node.exclamationToken) | 16777216 /* ContainsClassFields */; 14490 if (isComputedPropertyName(node.name) || hasStaticModifier(node) && node.initializer) { 14491 node.transformFlags |= 8192 /* ContainsTypeScriptClassSyntax */; 14492 } 14493 if (questionOrExclamationToken || modifiersToFlags(node.modifiers) & 2 /* Ambient */) { 14494 node.transformFlags |= 1 /* ContainsTypeScript */; 14495 } 14496 return node; 14497 } 14498 function updatePropertyDeclaration(node, modifiers, name, questionOrExclamationToken, type, initializer) { 14499 return node.modifiers !== modifiers || node.name !== name || node.questionToken !== (questionOrExclamationToken !== void 0 && isQuestionToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.exclamationToken !== (questionOrExclamationToken !== void 0 && isExclamationToken(questionOrExclamationToken) ? questionOrExclamationToken : void 0) || node.type !== type || node.initializer !== initializer ? update(createPropertyDeclaration(modifiers, name, questionOrExclamationToken, type, initializer), node) : node; 14500 } 14501 function createAnnotationPropertyDeclaration(name, type, initializer) { 14502 const node = createBaseVariableLikeDeclaration( 14503 172 /* AnnotationPropertyDeclaration */, 14504 void 0, 14505 name, 14506 type, 14507 initializer 14508 ); 14509 node.transformFlags |= 1 /* ContainsTypeScript */; 14510 return node; 14511 } 14512 function updateAnnotationPropertyDeclaration(node, name, type, initializer) { 14513 return node.name !== name || node.type !== type || node.initializer !== initializer ? update(createAnnotationPropertyDeclaration(name, type, initializer), node) : node; 14514 } 14515 function createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type) { 14516 const node = createBaseSignatureDeclaration( 14517 173 /* MethodSignature */, 14518 modifiers, 14519 name, 14520 typeParameters, 14521 parameters, 14522 type 14523 ); 14524 node.questionToken = questionToken; 14525 node.transformFlags = 1 /* ContainsTypeScript */; 14526 return node; 14527 } 14528 function updateMethodSignature(node, modifiers, name, questionToken, typeParameters, parameters, type) { 14529 return node.modifiers !== modifiers || node.name !== name || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type), node) : node; 14530 } 14531 function createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { 14532 const node = createBaseFunctionLikeDeclaration( 14533 174 /* MethodDeclaration */, 14534 modifiers, 14535 name, 14536 typeParameters, 14537 parameters, 14538 type, 14539 body 14540 ); 14541 node.asteriskToken = asteriskToken; 14542 node.questionToken = questionToken; 14543 node.transformFlags |= propagateChildFlags(node.asteriskToken) | propagateChildFlags(node.questionToken) | 1024 /* ContainsES2015 */; 14544 if (questionToken) { 14545 node.transformFlags |= 1 /* ContainsTypeScript */; 14546 } 14547 if (modifiersToFlags(node.modifiers) & 512 /* Async */) { 14548 if (asteriskToken) { 14549 node.transformFlags |= 128 /* ContainsES2018 */; 14550 } else { 14551 node.transformFlags |= 256 /* ContainsES2017 */; 14552 } 14553 } else if (asteriskToken) { 14554 node.transformFlags |= 2048 /* ContainsGenerator */; 14555 } 14556 node.exclamationToken = void 0; 14557 return node; 14558 } 14559 function updateMethodDeclaration(node, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { 14560 return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name || node.questionToken !== questionToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateMethodDeclaration(createMethodDeclaration(modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body), node) : node; 14561 } 14562 function finishUpdateMethodDeclaration(updated, original) { 14563 if (updated !== original) { 14564 updated.exclamationToken = original.exclamationToken; 14565 } 14566 return update(updated, original); 14567 } 14568 function createClassStaticBlockDeclaration(body) { 14569 const node = createBaseGenericNamedDeclaration( 14570 175 /* ClassStaticBlockDeclaration */, 14571 void 0, 14572 void 0, 14573 void 0 14574 ); 14575 node.body = body; 14576 node.transformFlags = propagateChildFlags(body) | 16777216 /* ContainsClassFields */; 14577 node.illegalDecorators = void 0; 14578 node.modifiers = void 0; 14579 return node; 14580 } 14581 function updateClassStaticBlockDeclaration(node, body) { 14582 return node.body !== body ? finishUpdateClassStaticBlockDeclaration(createClassStaticBlockDeclaration(body), node) : node; 14583 } 14584 function finishUpdateClassStaticBlockDeclaration(updated, original) { 14585 if (updated !== original) { 14586 updated.illegalDecorators = original.illegalDecorators; 14587 updated.modifiers = original.modifiers; 14588 } 14589 return update(updated, original); 14590 } 14591 function createConstructorDeclaration(modifiers, parameters, body) { 14592 const node = createBaseFunctionLikeDeclaration( 14593 176 /* Constructor */, 14594 modifiers, 14595 void 0, 14596 void 0, 14597 parameters, 14598 void 0, 14599 body 14600 ); 14601 node.transformFlags |= 1024 /* ContainsES2015 */; 14602 node.illegalDecorators = void 0; 14603 node.typeParameters = void 0; 14604 node.type = void 0; 14605 return node; 14606 } 14607 function updateConstructorDeclaration(node, modifiers, parameters, body) { 14608 return node.modifiers !== modifiers || node.parameters !== parameters || node.body !== body ? finishUpdateConstructorDeclaration(createConstructorDeclaration(modifiers, parameters, body), node) : node; 14609 } 14610 function finishUpdateConstructorDeclaration(updated, original) { 14611 if (updated !== original) { 14612 updated.illegalDecorators = original.illegalDecorators; 14613 updated.typeParameters = original.typeParameters; 14614 updated.type = original.type; 14615 } 14616 return finishUpdateBaseSignatureDeclaration(updated, original); 14617 } 14618 function createGetAccessorDeclaration(modifiers, name, parameters, type, body) { 14619 const node = createBaseFunctionLikeDeclaration( 14620 177 /* GetAccessor */, 14621 modifiers, 14622 name, 14623 void 0, 14624 parameters, 14625 type, 14626 body 14627 ); 14628 node.typeParameters = void 0; 14629 return node; 14630 } 14631 function updateGetAccessorDeclaration(node, modifiers, name, parameters, type, body) { 14632 return node.modifiers !== modifiers || node.name !== name || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateGetAccessorDeclaration(createGetAccessorDeclaration(modifiers, name, parameters, type, body), node) : node; 14633 } 14634 function finishUpdateGetAccessorDeclaration(updated, original) { 14635 if (updated !== original) { 14636 updated.typeParameters = original.typeParameters; 14637 } 14638 return finishUpdateBaseSignatureDeclaration(updated, original); 14639 } 14640 function createSetAccessorDeclaration(modifiers, name, parameters, body) { 14641 const node = createBaseFunctionLikeDeclaration( 14642 178 /* SetAccessor */, 14643 modifiers, 14644 name, 14645 void 0, 14646 parameters, 14647 void 0, 14648 body 14649 ); 14650 node.typeParameters = void 0; 14651 node.type = void 0; 14652 return node; 14653 } 14654 function updateSetAccessorDeclaration(node, modifiers, name, parameters, body) { 14655 return node.modifiers !== modifiers || node.name !== name || node.parameters !== parameters || node.body !== body ? finishUpdateSetAccessorDeclaration(createSetAccessorDeclaration(modifiers, name, parameters, body), node) : node; 14656 } 14657 function finishUpdateSetAccessorDeclaration(updated, original) { 14658 if (updated !== original) { 14659 updated.typeParameters = original.typeParameters; 14660 updated.type = original.type; 14661 } 14662 return finishUpdateBaseSignatureDeclaration(updated, original); 14663 } 14664 function createCallSignature(typeParameters, parameters, type) { 14665 const node = createBaseSignatureDeclaration( 14666 179 /* CallSignature */, 14667 void 0, 14668 void 0, 14669 typeParameters, 14670 parameters, 14671 type 14672 ); 14673 node.transformFlags = 1 /* ContainsTypeScript */; 14674 return node; 14675 } 14676 function updateCallSignature(node, typeParameters, parameters, type) { 14677 return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createCallSignature(typeParameters, parameters, type), node) : node; 14678 } 14679 function createConstructSignature(typeParameters, parameters, type) { 14680 const node = createBaseSignatureDeclaration( 14681 180 /* ConstructSignature */, 14682 void 0, 14683 void 0, 14684 typeParameters, 14685 parameters, 14686 type 14687 ); 14688 node.transformFlags = 1 /* ContainsTypeScript */; 14689 return node; 14690 } 14691 function updateConstructSignature(node, typeParameters, parameters, type) { 14692 return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructSignature(typeParameters, parameters, type), node) : node; 14693 } 14694 function createIndexSignature(modifiers, parameters, type) { 14695 const node = createBaseSignatureDeclaration( 14696 181 /* IndexSignature */, 14697 modifiers, 14698 void 0, 14699 void 0, 14700 parameters, 14701 type 14702 ); 14703 node.transformFlags = 1 /* ContainsTypeScript */; 14704 return node; 14705 } 14706 function updateIndexSignature(node, modifiers, parameters, type) { 14707 return node.parameters !== parameters || node.type !== type || node.modifiers !== modifiers ? finishUpdateBaseSignatureDeclaration(createIndexSignature(modifiers, parameters, type), node) : node; 14708 } 14709 function createTemplateLiteralTypeSpan(type, literal) { 14710 const node = createBaseNode(204 /* TemplateLiteralTypeSpan */); 14711 node.type = type; 14712 node.literal = literal; 14713 node.transformFlags = 1 /* ContainsTypeScript */; 14714 return node; 14715 } 14716 function updateTemplateLiteralTypeSpan(node, type, literal) { 14717 return node.type !== type || node.literal !== literal ? update(createTemplateLiteralTypeSpan(type, literal), node) : node; 14718 } 14719 function createKeywordTypeNode(kind) { 14720 return createToken(kind); 14721 } 14722 function createTypePredicateNode(assertsModifier, parameterName, type) { 14723 const node = createBaseNode(182 /* TypePredicate */); 14724 node.assertsModifier = assertsModifier; 14725 node.parameterName = asName(parameterName); 14726 node.type = type; 14727 node.transformFlags = 1 /* ContainsTypeScript */; 14728 return node; 14729 } 14730 function updateTypePredicateNode(node, assertsModifier, parameterName, type) { 14731 return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? update(createTypePredicateNode(assertsModifier, parameterName, type), node) : node; 14732 } 14733 function createTypeReferenceNode(typeName, typeArguments) { 14734 const node = createBaseNode(183 /* TypeReference */); 14735 node.typeName = asName(typeName); 14736 node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(createNodeArray(typeArguments)); 14737 node.transformFlags = 1 /* ContainsTypeScript */; 14738 return node; 14739 } 14740 function updateTypeReferenceNode(node, typeName, typeArguments) { 14741 return node.typeName !== typeName || node.typeArguments !== typeArguments ? update(createTypeReferenceNode(typeName, typeArguments), node) : node; 14742 } 14743 function createFunctionTypeNode(typeParameters, parameters, type) { 14744 const node = createBaseSignatureDeclaration( 14745 184 /* FunctionType */, 14746 void 0, 14747 void 0, 14748 typeParameters, 14749 parameters, 14750 type 14751 ); 14752 node.transformFlags = 1 /* ContainsTypeScript */; 14753 node.modifiers = void 0; 14754 return node; 14755 } 14756 function updateFunctionTypeNode(node, typeParameters, parameters, type) { 14757 return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateFunctionTypeNode(createFunctionTypeNode(typeParameters, parameters, type), node) : node; 14758 } 14759 function finishUpdateFunctionTypeNode(updated, original) { 14760 if (updated !== original) { 14761 updated.modifiers = original.modifiers; 14762 } 14763 return finishUpdateBaseSignatureDeclaration(updated, original); 14764 } 14765 function createConstructorTypeNode(...args) { 14766 return args.length === 4 ? createConstructorTypeNode1(...args) : args.length === 3 ? createConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified."); 14767 } 14768 function createConstructorTypeNode1(modifiers, typeParameters, parameters, type) { 14769 const node = createBaseSignatureDeclaration( 14770 185 /* ConstructorType */, 14771 modifiers, 14772 void 0, 14773 typeParameters, 14774 parameters, 14775 type 14776 ); 14777 node.transformFlags = 1 /* ContainsTypeScript */; 14778 return node; 14779 } 14780 function createConstructorTypeNode2(typeParameters, parameters, type) { 14781 return createConstructorTypeNode1(void 0, typeParameters, parameters, type); 14782 } 14783 function updateConstructorTypeNode(...args) { 14784 return args.length === 5 ? updateConstructorTypeNode1(...args) : args.length === 4 ? updateConstructorTypeNode2(...args) : Debug.fail("Incorrect number of arguments specified."); 14785 } 14786 function updateConstructorTypeNode1(node, modifiers, typeParameters, parameters, type) { 14787 return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? finishUpdateBaseSignatureDeclaration(createConstructorTypeNode(modifiers, typeParameters, parameters, type), node) : node; 14788 } 14789 function updateConstructorTypeNode2(node, typeParameters, parameters, type) { 14790 return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type); 14791 } 14792 function createTypeQueryNode(exprName, typeArguments) { 14793 const node = createBaseNode(186 /* TypeQuery */); 14794 node.exprName = exprName; 14795 node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); 14796 node.transformFlags = 1 /* ContainsTypeScript */; 14797 return node; 14798 } 14799 function updateTypeQueryNode(node, exprName, typeArguments) { 14800 return node.exprName !== exprName || node.typeArguments !== typeArguments ? update(createTypeQueryNode(exprName, typeArguments), node) : node; 14801 } 14802 function createTypeLiteralNode(members) { 14803 const node = createBaseNode(187 /* TypeLiteral */); 14804 node.members = createNodeArray(members); 14805 node.transformFlags = 1 /* ContainsTypeScript */; 14806 return node; 14807 } 14808 function updateTypeLiteralNode(node, members) { 14809 return node.members !== members ? update(createTypeLiteralNode(members), node) : node; 14810 } 14811 function createArrayTypeNode(elementType) { 14812 const node = createBaseNode(188 /* ArrayType */); 14813 node.elementType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(elementType); 14814 node.transformFlags = 1 /* ContainsTypeScript */; 14815 return node; 14816 } 14817 function updateArrayTypeNode(node, elementType) { 14818 return node.elementType !== elementType ? update(createArrayTypeNode(elementType), node) : node; 14819 } 14820 function createTupleTypeNode(elements) { 14821 const node = createBaseNode(189 /* TupleType */); 14822 node.elements = createNodeArray(parenthesizerRules().parenthesizeElementTypesOfTupleType(elements)); 14823 node.transformFlags = 1 /* ContainsTypeScript */; 14824 return node; 14825 } 14826 function updateTupleTypeNode(node, elements) { 14827 return node.elements !== elements ? update(createTupleTypeNode(elements), node) : node; 14828 } 14829 function createNamedTupleMember(dotDotDotToken, name, questionToken, type) { 14830 const node = createBaseNode(202 /* NamedTupleMember */); 14831 node.dotDotDotToken = dotDotDotToken; 14832 node.name = name; 14833 node.questionToken = questionToken; 14834 node.type = type; 14835 node.transformFlags = 1 /* ContainsTypeScript */; 14836 return node; 14837 } 14838 function updateNamedTupleMember(node, dotDotDotToken, name, questionToken, type) { 14839 return node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type ? update(createNamedTupleMember(dotDotDotToken, name, questionToken, type), node) : node; 14840 } 14841 function createOptionalTypeNode(type) { 14842 const node = createBaseNode(190 /* OptionalType */); 14843 node.type = parenthesizerRules().parenthesizeTypeOfOptionalType(type); 14844 node.transformFlags = 1 /* ContainsTypeScript */; 14845 return node; 14846 } 14847 function updateOptionalTypeNode(node, type) { 14848 return node.type !== type ? update(createOptionalTypeNode(type), node) : node; 14849 } 14850 function createRestTypeNode(type) { 14851 const node = createBaseNode(191 /* RestType */); 14852 node.type = type; 14853 node.transformFlags = 1 /* ContainsTypeScript */; 14854 return node; 14855 } 14856 function updateRestTypeNode(node, type) { 14857 return node.type !== type ? update(createRestTypeNode(type), node) : node; 14858 } 14859 function createUnionOrIntersectionTypeNode(kind, types, parenthesize) { 14860 const node = createBaseNode(kind); 14861 node.types = factory2.createNodeArray(parenthesize(types)); 14862 node.transformFlags = 1 /* ContainsTypeScript */; 14863 return node; 14864 } 14865 function updateUnionOrIntersectionTypeNode(node, types, parenthesize) { 14866 return node.types !== types ? update(createUnionOrIntersectionTypeNode(node.kind, types, parenthesize), node) : node; 14867 } 14868 function createUnionTypeNode(types) { 14869 return createUnionOrIntersectionTypeNode(192 /* UnionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); 14870 } 14871 function updateUnionTypeNode(node, types) { 14872 return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfUnionType); 14873 } 14874 function createIntersectionTypeNode(types) { 14875 return createUnionOrIntersectionTypeNode(193 /* IntersectionType */, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); 14876 } 14877 function updateIntersectionTypeNode(node, types) { 14878 return updateUnionOrIntersectionTypeNode(node, types, parenthesizerRules().parenthesizeConstituentTypesOfIntersectionType); 14879 } 14880 function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { 14881 const node = createBaseNode(194 /* ConditionalType */); 14882 node.checkType = parenthesizerRules().parenthesizeCheckTypeOfConditionalType(checkType); 14883 node.extendsType = parenthesizerRules().parenthesizeExtendsTypeOfConditionalType(extendsType); 14884 node.trueType = trueType; 14885 node.falseType = falseType; 14886 node.transformFlags = 1 /* ContainsTypeScript */; 14887 return node; 14888 } 14889 function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) { 14890 return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? update(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) : node; 14891 } 14892 function createInferTypeNode(typeParameter) { 14893 const node = createBaseNode(195 /* InferType */); 14894 node.typeParameter = typeParameter; 14895 node.transformFlags = 1 /* ContainsTypeScript */; 14896 return node; 14897 } 14898 function updateInferTypeNode(node, typeParameter) { 14899 return node.typeParameter !== typeParameter ? update(createInferTypeNode(typeParameter), node) : node; 14900 } 14901 function createTemplateLiteralType(head, templateSpans) { 14902 const node = createBaseNode(203 /* TemplateLiteralType */); 14903 node.head = head; 14904 node.templateSpans = createNodeArray(templateSpans); 14905 node.transformFlags = 1 /* ContainsTypeScript */; 14906 return node; 14907 } 14908 function updateTemplateLiteralType(node, head, templateSpans) { 14909 return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node; 14910 } 14911 function createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf = false) { 14912 const node = createBaseNode(205 /* ImportType */); 14913 node.argument = argument; 14914 node.assertions = assertions; 14915 node.qualifier = qualifier; 14916 node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); 14917 node.isTypeOf = isTypeOf; 14918 node.transformFlags = 1 /* ContainsTypeScript */; 14919 return node; 14920 } 14921 function updateImportTypeNode(node, argument, assertions, qualifier, typeArguments, isTypeOf = node.isTypeOf) { 14922 return node.argument !== argument || node.assertions !== assertions || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf), node) : node; 14923 } 14924 function createParenthesizedType(type) { 14925 const node = createBaseNode(196 /* ParenthesizedType */); 14926 node.type = type; 14927 node.transformFlags = 1 /* ContainsTypeScript */; 14928 return node; 14929 } 14930 function updateParenthesizedType(node, type) { 14931 return node.type !== type ? update(createParenthesizedType(type), node) : node; 14932 } 14933 function createThisTypeNode() { 14934 const node = createBaseNode(197 /* ThisType */); 14935 node.transformFlags = 1 /* ContainsTypeScript */; 14936 return node; 14937 } 14938 function createTypeOperatorNode(operator, type) { 14939 const node = createBaseNode(198 /* TypeOperator */); 14940 node.operator = operator; 14941 node.type = operator === 147 /* ReadonlyKeyword */ ? parenthesizerRules().parenthesizeOperandOfReadonlyTypeOperator(type) : parenthesizerRules().parenthesizeOperandOfTypeOperator(type); 14942 node.transformFlags = 1 /* ContainsTypeScript */; 14943 return node; 14944 } 14945 function updateTypeOperatorNode(node, type) { 14946 return node.type !== type ? update(createTypeOperatorNode(node.operator, type), node) : node; 14947 } 14948 function createIndexedAccessTypeNode(objectType, indexType) { 14949 const node = createBaseNode(199 /* IndexedAccessType */); 14950 node.objectType = parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(objectType); 14951 node.indexType = indexType; 14952 node.transformFlags = 1 /* ContainsTypeScript */; 14953 return node; 14954 } 14955 function updateIndexedAccessTypeNode(node, objectType, indexType) { 14956 return node.objectType !== objectType || node.indexType !== indexType ? update(createIndexedAccessTypeNode(objectType, indexType), node) : node; 14957 } 14958 function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members) { 14959 const node = createBaseNode(200 /* MappedType */); 14960 node.readonlyToken = readonlyToken; 14961 node.typeParameter = typeParameter; 14962 node.nameType = nameType; 14963 node.questionToken = questionToken; 14964 node.type = type; 14965 node.members = members && createNodeArray(members); 14966 node.transformFlags = 1 /* ContainsTypeScript */; 14967 return node; 14968 } 14969 function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type, members) { 14970 return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type || node.members !== members ? update(createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), node) : node; 14971 } 14972 function createLiteralTypeNode(literal) { 14973 const node = createBaseNode(201 /* LiteralType */); 14974 node.literal = literal; 14975 node.transformFlags = 1 /* ContainsTypeScript */; 14976 return node; 14977 } 14978 function updateLiteralTypeNode(node, literal) { 14979 return node.literal !== literal ? update(createLiteralTypeNode(literal), node) : node; 14980 } 14981 function createObjectBindingPattern(elements) { 14982 const node = createBaseNode(206 /* ObjectBindingPattern */); 14983 node.elements = createNodeArray(elements); 14984 node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */; 14985 if (node.transformFlags & 32768 /* ContainsRestOrSpread */) { 14986 node.transformFlags |= 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */; 14987 } 14988 return node; 14989 } 14990 function updateObjectBindingPattern(node, elements) { 14991 return node.elements !== elements ? update(createObjectBindingPattern(elements), node) : node; 14992 } 14993 function createArrayBindingPattern(elements) { 14994 const node = createBaseNode(207 /* ArrayBindingPattern */); 14995 node.elements = createNodeArray(elements); 14996 node.transformFlags |= propagateChildrenFlags(node.elements) | 1024 /* ContainsES2015 */ | 524288 /* ContainsBindingPattern */; 14997 return node; 14998 } 14999 function updateArrayBindingPattern(node, elements) { 15000 return node.elements !== elements ? update(createArrayBindingPattern(elements), node) : node; 15001 } 15002 function createBindingElement(dotDotDotToken, propertyName, name, initializer) { 15003 const node = createBaseBindingLikeDeclaration( 15004 208 /* BindingElement */, 15005 void 0, 15006 name, 15007 initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer) 15008 ); 15009 node.propertyName = asName(propertyName); 15010 node.dotDotDotToken = dotDotDotToken; 15011 node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | 1024 /* ContainsES2015 */; 15012 if (node.propertyName) { 15013 node.transformFlags |= isIdentifier(node.propertyName) ? propagateIdentifierNameFlags(node.propertyName) : propagateChildFlags(node.propertyName); 15014 } 15015 if (dotDotDotToken) 15016 node.transformFlags |= 32768 /* ContainsRestOrSpread */; 15017 return node; 15018 } 15019 function updateBindingElement(node, dotDotDotToken, propertyName, name, initializer) { 15020 return node.propertyName !== propertyName || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.initializer !== initializer ? update(createBindingElement(dotDotDotToken, propertyName, name, initializer), node) : node; 15021 } 15022 function createBaseExpression(kind) { 15023 const node = createBaseNode(kind); 15024 return node; 15025 } 15026 function createArrayLiteralExpression(elements, multiLine) { 15027 const node = createBaseExpression(209 /* ArrayLiteralExpression */); 15028 const lastElement = elements && lastOrUndefined(elements); 15029 const elementsArray = createNodeArray(elements, lastElement && isOmittedExpression(lastElement) ? true : void 0); 15030 node.elements = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(elementsArray); 15031 node.multiLine = multiLine; 15032 node.transformFlags |= propagateChildrenFlags(node.elements); 15033 return node; 15034 } 15035 function updateArrayLiteralExpression(node, elements) { 15036 return node.elements !== elements ? update(createArrayLiteralExpression(elements, node.multiLine), node) : node; 15037 } 15038 function createObjectLiteralExpression(properties, multiLine) { 15039 const node = createBaseExpression(210 /* ObjectLiteralExpression */); 15040 node.properties = createNodeArray(properties); 15041 node.multiLine = multiLine; 15042 node.transformFlags |= propagateChildrenFlags(node.properties); 15043 return node; 15044 } 15045 function updateObjectLiteralExpression(node, properties) { 15046 return node.properties !== properties ? update(createObjectLiteralExpression(properties, node.multiLine), node) : node; 15047 } 15048 function createPropertyAccessExpression(expression, name) { 15049 const node = createBaseExpression(211 /* PropertyAccessExpression */); 15050 node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false); 15051 node.name = asName(name); 15052 node.transformFlags = propagateChildFlags(node.expression) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */); 15053 if (isSuperKeyword(expression)) { 15054 node.transformFlags |= 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */; 15055 } 15056 return node; 15057 } 15058 function updatePropertyAccessExpression(node, expression, name) { 15059 if (isPropertyAccessChain(node)) { 15060 return updatePropertyAccessChain(node, expression, node.questionDotToken, cast(name, isIdentifier)); 15061 } 15062 return node.expression !== expression || node.name !== name ? update(createPropertyAccessExpression(expression, name), node) : node; 15063 } 15064 function createPropertyAccessChain(expression, questionDotToken, name) { 15065 const node = createBaseExpression(211 /* PropertyAccessExpression */); 15066 node.flags |= 32 /* OptionalChain */; 15067 node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true); 15068 node.questionDotToken = questionDotToken; 15069 node.name = asName(name); 15070 node.transformFlags |= 32 /* ContainsES2020 */ | propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */); 15071 return node; 15072 } 15073 function updatePropertyAccessChain(node, expression, questionDotToken, name) { 15074 Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a PropertyAccessExpression using updatePropertyAccessChain. Use updatePropertyAccess instead."); 15075 return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? update(createPropertyAccessChain(expression, questionDotToken, name), node) : node; 15076 } 15077 function createElementAccessExpression(expression, index) { 15078 const node = createBaseExpression(212 /* ElementAccessExpression */); 15079 node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false); 15080 node.argumentExpression = asExpression(index); 15081 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.argumentExpression); 15082 if (isSuperKeyword(expression)) { 15083 node.transformFlags |= 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */; 15084 } 15085 return node; 15086 } 15087 function updateElementAccessExpression(node, expression, argumentExpression) { 15088 if (isElementAccessChain(node)) { 15089 return updateElementAccessChain(node, expression, node.questionDotToken, argumentExpression); 15090 } 15091 return node.expression !== expression || node.argumentExpression !== argumentExpression ? update(createElementAccessExpression(expression, argumentExpression), node) : node; 15092 } 15093 function createElementAccessChain(expression, questionDotToken, index) { 15094 const node = createBaseExpression(212 /* ElementAccessExpression */); 15095 node.flags |= 32 /* OptionalChain */; 15096 node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true); 15097 node.questionDotToken = questionDotToken; 15098 node.argumentExpression = asExpression(index); 15099 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression) | 32 /* ContainsES2020 */; 15100 return node; 15101 } 15102 function updateElementAccessChain(node, expression, questionDotToken, argumentExpression) { 15103 Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a ElementAccessExpression using updateElementAccessChain. Use updateElementAccess instead."); 15104 return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? update(createElementAccessChain(expression, questionDotToken, argumentExpression), node) : node; 15105 } 15106 function createCallExpression(expression, typeArguments, argumentsArray) { 15107 const node = createBaseExpression(213 /* CallExpression */); 15108 node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false); 15109 node.typeArguments = asNodeArray(typeArguments); 15110 node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)); 15111 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments); 15112 if (node.typeArguments) { 15113 node.transformFlags |= 1 /* ContainsTypeScript */; 15114 } 15115 if (isImportKeyword(node.expression)) { 15116 node.transformFlags |= 8388608 /* ContainsDynamicImport */; 15117 } else if (isSuperProperty(node.expression)) { 15118 node.transformFlags |= 16384 /* ContainsLexicalThis */; 15119 } 15120 return node; 15121 } 15122 function updateCallExpression(node, expression, typeArguments, argumentsArray) { 15123 if (isCallChain(node)) { 15124 return updateCallChain(node, expression, node.questionDotToken, typeArguments, argumentsArray); 15125 } 15126 return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallExpression(expression, typeArguments, argumentsArray), node) : node; 15127 } 15128 function createCallChain(expression, questionDotToken, typeArguments, argumentsArray) { 15129 const node = createBaseExpression(213 /* CallExpression */); 15130 node.flags |= 32 /* OptionalChain */; 15131 node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true); 15132 node.questionDotToken = questionDotToken; 15133 node.typeArguments = asNodeArray(typeArguments); 15134 node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)); 15135 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments) | 32 /* ContainsES2020 */; 15136 if (node.typeArguments) { 15137 node.transformFlags |= 1 /* ContainsTypeScript */; 15138 } 15139 if (isSuperProperty(node.expression)) { 15140 node.transformFlags |= 16384 /* ContainsLexicalThis */; 15141 } 15142 return node; 15143 } 15144 function updateCallChain(node, expression, questionDotToken, typeArguments, argumentsArray) { 15145 Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a CallExpression using updateCallChain. Use updateCall instead."); 15146 return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createCallChain(expression, questionDotToken, typeArguments, argumentsArray), node) : node; 15147 } 15148 function createNewExpression(expression, typeArguments, argumentsArray) { 15149 const node = createBaseExpression(214 /* NewExpression */); 15150 node.expression = parenthesizerRules().parenthesizeExpressionOfNew(expression); 15151 node.typeArguments = asNodeArray(typeArguments); 15152 node.arguments = argumentsArray ? parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(argumentsArray) : void 0; 15153 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | propagateChildrenFlags(node.arguments) | 32 /* ContainsES2020 */; 15154 if (node.typeArguments) { 15155 node.transformFlags |= 1 /* ContainsTypeScript */; 15156 } 15157 return node; 15158 } 15159 function updateNewExpression(node, expression, typeArguments, argumentsArray) { 15160 return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== argumentsArray ? update(createNewExpression(expression, typeArguments, argumentsArray), node) : node; 15161 } 15162 function createTaggedTemplateExpression(tag, typeArguments, template) { 15163 const node = createBaseExpression(215 /* TaggedTemplateExpression */); 15164 node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag, false); 15165 node.typeArguments = asNodeArray(typeArguments); 15166 node.template = template; 15167 node.transformFlags |= propagateChildFlags(node.tag) | propagateChildrenFlags(node.typeArguments) | propagateChildFlags(node.template) | 1024 /* ContainsES2015 */; 15168 if (node.typeArguments) { 15169 node.transformFlags |= 1 /* ContainsTypeScript */; 15170 } 15171 if (hasInvalidEscape(node.template)) { 15172 node.transformFlags |= 128 /* ContainsES2018 */; 15173 } 15174 return node; 15175 } 15176 function updateTaggedTemplateExpression(node, tag, typeArguments, template) { 15177 return node.tag !== tag || node.typeArguments !== typeArguments || node.template !== template ? update(createTaggedTemplateExpression(tag, typeArguments, template), node) : node; 15178 } 15179 function createTypeAssertion(type, expression) { 15180 const node = createBaseExpression(216 /* TypeAssertionExpression */); 15181 node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); 15182 node.type = type; 15183 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; 15184 return node; 15185 } 15186 function updateTypeAssertion(node, type, expression) { 15187 return node.type !== type || node.expression !== expression ? update(createTypeAssertion(type, expression), node) : node; 15188 } 15189 function createParenthesizedExpression(expression) { 15190 const node = createBaseExpression(217 /* ParenthesizedExpression */); 15191 node.expression = expression; 15192 node.transformFlags = propagateChildFlags(node.expression); 15193 return node; 15194 } 15195 function updateParenthesizedExpression(node, expression) { 15196 return node.expression !== expression ? update(createParenthesizedExpression(expression), node) : node; 15197 } 15198 function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { 15199 const node = createBaseFunctionLikeDeclaration( 15200 218 /* FunctionExpression */, 15201 modifiers, 15202 name, 15203 typeParameters, 15204 parameters, 15205 type, 15206 body 15207 ); 15208 node.asteriskToken = asteriskToken; 15209 node.transformFlags |= propagateChildFlags(node.asteriskToken); 15210 if (node.typeParameters) { 15211 node.transformFlags |= 1 /* ContainsTypeScript */; 15212 } 15213 if (modifiersToFlags(node.modifiers) & 512 /* Async */) { 15214 if (node.asteriskToken) { 15215 node.transformFlags |= 128 /* ContainsES2018 */; 15216 } else { 15217 node.transformFlags |= 256 /* ContainsES2017 */; 15218 } 15219 } else if (node.asteriskToken) { 15220 node.transformFlags |= 2048 /* ContainsGenerator */; 15221 } 15222 return node; 15223 } 15224 function updateFunctionExpression(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { 15225 return node.name !== name || node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateBaseSignatureDeclaration(createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; 15226 } 15227 function createEtsComponentExpression(name, argumentsArray, body) { 15228 const node = createBaseExpression(220 /* EtsComponentExpression */); 15229 node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(name); 15230 node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray)); 15231 node.body = body; 15232 return node; 15233 } 15234 function updateEtsComponentExpression(node, name, argumentsArray, body) { 15235 return node.expression !== name || node.arguments !== argumentsArray || node.body !== body ? createEtsComponentExpression(name, argumentsArray, body) : node; 15236 } 15237 function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { 15238 const node = createBaseFunctionLikeDeclaration( 15239 219 /* ArrowFunction */, 15240 modifiers, 15241 void 0, 15242 typeParameters, 15243 parameters, 15244 type, 15245 parenthesizerRules().parenthesizeConciseBodyOfArrowFunction(body) 15246 ); 15247 node.equalsGreaterThanToken = equalsGreaterThanToken != null ? equalsGreaterThanToken : createToken(38 /* EqualsGreaterThanToken */); 15248 node.transformFlags |= propagateChildFlags(node.equalsGreaterThanToken) | 1024 /* ContainsES2015 */; 15249 if (modifiersToFlags(node.modifiers) & 512 /* Async */) { 15250 node.transformFlags |= 256 /* ContainsES2017 */ | 16384 /* ContainsLexicalThis */; 15251 } 15252 return node; 15253 } 15254 function updateArrowFunction(node, modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { 15255 return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? finishUpdateBaseSignatureDeclaration(createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body), node) : node; 15256 } 15257 function createDeleteExpression(expression) { 15258 const node = createBaseExpression(221 /* DeleteExpression */); 15259 node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); 15260 node.transformFlags |= propagateChildFlags(node.expression); 15261 return node; 15262 } 15263 function updateDeleteExpression(node, expression) { 15264 return node.expression !== expression ? update(createDeleteExpression(expression), node) : node; 15265 } 15266 function createTypeOfExpression(expression) { 15267 const node = createBaseExpression(222 /* TypeOfExpression */); 15268 node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); 15269 node.transformFlags |= propagateChildFlags(node.expression); 15270 return node; 15271 } 15272 function updateTypeOfExpression(node, expression) { 15273 return node.expression !== expression ? update(createTypeOfExpression(expression), node) : node; 15274 } 15275 function createVoidExpression(expression) { 15276 const node = createBaseExpression(223 /* VoidExpression */); 15277 node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); 15278 node.transformFlags |= propagateChildFlags(node.expression); 15279 return node; 15280 } 15281 function updateVoidExpression(node, expression) { 15282 return node.expression !== expression ? update(createVoidExpression(expression), node) : node; 15283 } 15284 function createAwaitExpression(expression) { 15285 const node = createBaseExpression(224 /* AwaitExpression */); 15286 node.expression = parenthesizerRules().parenthesizeOperandOfPrefixUnary(expression); 15287 node.transformFlags |= propagateChildFlags(node.expression) | 256 /* ContainsES2017 */ | 128 /* ContainsES2018 */ | 2097152 /* ContainsAwait */; 15288 return node; 15289 } 15290 function updateAwaitExpression(node, expression) { 15291 return node.expression !== expression ? update(createAwaitExpression(expression), node) : node; 15292 } 15293 function createPrefixUnaryExpression(operator, operand) { 15294 const node = createBaseExpression(225 /* PrefixUnaryExpression */); 15295 node.operator = operator; 15296 node.operand = parenthesizerRules().parenthesizeOperandOfPrefixUnary(operand); 15297 node.transformFlags |= propagateChildFlags(node.operand); 15298 if ((operator === 45 /* PlusPlusToken */ || operator === 46 /* MinusMinusToken */) && isIdentifier(node.operand) && !isGeneratedIdentifier(node.operand) && !isLocalName(node.operand)) { 15299 node.transformFlags |= 268435456 /* ContainsUpdateExpressionForIdentifier */; 15300 } 15301 return node; 15302 } 15303 function updatePrefixUnaryExpression(node, operand) { 15304 return node.operand !== operand ? update(createPrefixUnaryExpression(node.operator, operand), node) : node; 15305 } 15306 function createPostfixUnaryExpression(operand, operator) { 15307 const node = createBaseExpression(226 /* PostfixUnaryExpression */); 15308 node.operator = operator; 15309 node.operand = parenthesizerRules().parenthesizeOperandOfPostfixUnary(operand); 15310 node.transformFlags |= propagateChildFlags(node.operand); 15311 if (isIdentifier(node.operand) && !isGeneratedIdentifier(node.operand) && !isLocalName(node.operand)) { 15312 node.transformFlags |= 268435456 /* ContainsUpdateExpressionForIdentifier */; 15313 } 15314 return node; 15315 } 15316 function updatePostfixUnaryExpression(node, operand) { 15317 return node.operand !== operand ? update(createPostfixUnaryExpression(operand, node.operator), node) : node; 15318 } 15319 function createBinaryExpression(left, operator, right) { 15320 const node = createBaseExpression(227 /* BinaryExpression */); 15321 const operatorToken = asToken(operator); 15322 const operatorKind = operatorToken.kind; 15323 node.left = parenthesizerRules().parenthesizeLeftSideOfBinary(operatorKind, left); 15324 node.operatorToken = operatorToken; 15325 node.right = parenthesizerRules().parenthesizeRightSideOfBinary(operatorKind, node.left, right); 15326 node.transformFlags |= propagateChildFlags(node.left) | propagateChildFlags(node.operatorToken) | propagateChildFlags(node.right); 15327 if (operatorKind === 60 /* QuestionQuestionToken */) { 15328 node.transformFlags |= 32 /* ContainsES2020 */; 15329 } else if (operatorKind === 63 /* EqualsToken */) { 15330 if (isObjectLiteralExpression(node.left)) { 15331 node.transformFlags |= 1024 /* ContainsES2015 */ | 128 /* ContainsES2018 */ | 4096 /* ContainsDestructuringAssignment */ | propagateAssignmentPatternFlags(node.left); 15332 } else if (isArrayLiteralExpression(node.left)) { 15333 node.transformFlags |= 1024 /* ContainsES2015 */ | 4096 /* ContainsDestructuringAssignment */ | propagateAssignmentPatternFlags(node.left); 15334 } 15335 } else if (operatorKind === 42 /* AsteriskAsteriskToken */ || operatorKind === 67 /* AsteriskAsteriskEqualsToken */) { 15336 node.transformFlags |= 512 /* ContainsES2016 */; 15337 } else if (isLogicalOrCoalescingAssignmentOperator(operatorKind)) { 15338 node.transformFlags |= 16 /* ContainsES2021 */; 15339 } 15340 if (operatorKind === 102 /* InKeyword */ && isPrivateIdentifier(node.left)) { 15341 node.transformFlags |= 536870912 /* ContainsPrivateIdentifierInExpression */; 15342 } 15343 return node; 15344 } 15345 function propagateAssignmentPatternFlags(node) { 15346 if (node.transformFlags & 65536 /* ContainsObjectRestOrSpread */) 15347 return 65536 /* ContainsObjectRestOrSpread */; 15348 if (node.transformFlags & 128 /* ContainsES2018 */) { 15349 for (const element of getElementsOfBindingOrAssignmentPattern(node)) { 15350 const target = getTargetOfBindingOrAssignmentElement(element); 15351 if (target && isAssignmentPattern(target)) { 15352 if (target.transformFlags & 65536 /* ContainsObjectRestOrSpread */) { 15353 return 65536 /* ContainsObjectRestOrSpread */; 15354 } 15355 if (target.transformFlags & 128 /* ContainsES2018 */) { 15356 const flags2 = propagateAssignmentPatternFlags(target); 15357 if (flags2) 15358 return flags2; 15359 } 15360 } 15361 } 15362 } 15363 return 0 /* None */; 15364 } 15365 function updateBinaryExpression(node, left, operator, right) { 15366 return node.left !== left || node.operatorToken !== operator || node.right !== right ? update(createBinaryExpression(left, operator, right), node) : node; 15367 } 15368 function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) { 15369 const node = createBaseExpression(228 /* ConditionalExpression */); 15370 node.condition = parenthesizerRules().parenthesizeConditionOfConditionalExpression(condition); 15371 node.questionToken = questionToken != null ? questionToken : createToken(57 /* QuestionToken */); 15372 node.whenTrue = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenTrue); 15373 node.colonToken = colonToken != null ? colonToken : createToken(58 /* ColonToken */); 15374 node.whenFalse = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenFalse); 15375 node.transformFlags |= propagateChildFlags(node.condition) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.whenTrue) | propagateChildFlags(node.colonToken) | propagateChildFlags(node.whenFalse); 15376 return node; 15377 } 15378 function updateConditionalExpression(node, condition, questionToken, whenTrue, colonToken, whenFalse) { 15379 return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue || node.colonToken !== colonToken || node.whenFalse !== whenFalse ? update(createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse), node) : node; 15380 } 15381 function createTemplateExpression(head, templateSpans) { 15382 const node = createBaseExpression(229 /* TemplateExpression */); 15383 node.head = head; 15384 node.templateSpans = createNodeArray(templateSpans); 15385 node.transformFlags |= propagateChildFlags(node.head) | propagateChildrenFlags(node.templateSpans) | 1024 /* ContainsES2015 */; 15386 return node; 15387 } 15388 function updateTemplateExpression(node, head, templateSpans) { 15389 return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateExpression(head, templateSpans), node) : node; 15390 } 15391 function createTemplateLiteralLikeNodeChecked(kind, text, rawText, templateFlags = 0 /* None */) { 15392 Debug.assert(!(templateFlags & ~2048 /* TemplateLiteralLikeFlags */), "Unsupported template flags."); 15393 let cooked = void 0; 15394 if (rawText !== void 0 && rawText !== text) { 15395 cooked = getCookedText(kind, rawText); 15396 if (typeof cooked === "object") { 15397 return Debug.fail("Invalid raw text"); 15398 } 15399 } 15400 if (text === void 0) { 15401 if (cooked === void 0) { 15402 return Debug.fail("Arguments 'text' and 'rawText' may not both be undefined."); 15403 } 15404 text = cooked; 15405 } else if (cooked !== void 0) { 15406 Debug.assert(text === cooked, "Expected argument 'text' to be the normalized (i.e. 'cooked') version of argument 'rawText'."); 15407 } 15408 return createTemplateLiteralLikeNode(kind, text, rawText, templateFlags); 15409 } 15410 function createTemplateLiteralLikeNode(kind, text, rawText, templateFlags) { 15411 const node = createBaseToken(kind); 15412 node.text = text; 15413 node.rawText = rawText; 15414 node.templateFlags = templateFlags & 2048 /* TemplateLiteralLikeFlags */; 15415 node.transformFlags |= 1024 /* ContainsES2015 */; 15416 if (node.templateFlags) { 15417 node.transformFlags |= 128 /* ContainsES2018 */; 15418 } 15419 return node; 15420 } 15421 function createTemplateHead(text, rawText, templateFlags) { 15422 return createTemplateLiteralLikeNodeChecked(15 /* TemplateHead */, text, rawText, templateFlags); 15423 } 15424 function createTemplateMiddle(text, rawText, templateFlags) { 15425 return createTemplateLiteralLikeNodeChecked(16 /* TemplateMiddle */, text, rawText, templateFlags); 15426 } 15427 function createTemplateTail(text, rawText, templateFlags) { 15428 return createTemplateLiteralLikeNodeChecked(17 /* TemplateTail */, text, rawText, templateFlags); 15429 } 15430 function createNoSubstitutionTemplateLiteral(text, rawText, templateFlags) { 15431 return createTemplateLiteralLikeNodeChecked(14 /* NoSubstitutionTemplateLiteral */, text, rawText, templateFlags); 15432 } 15433 function createYieldExpression(asteriskToken, expression) { 15434 Debug.assert(!asteriskToken || !!expression, "A `YieldExpression` with an asteriskToken must have an expression."); 15435 const node = createBaseExpression(230 /* YieldExpression */); 15436 node.expression = expression && parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); 15437 node.asteriskToken = asteriskToken; 15438 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.asteriskToken) | 1024 /* ContainsES2015 */ | 128 /* ContainsES2018 */ | 1048576 /* ContainsYield */; 15439 return node; 15440 } 15441 function updateYieldExpression(node, asteriskToken, expression) { 15442 return node.expression !== expression || node.asteriskToken !== asteriskToken ? update(createYieldExpression(asteriskToken, expression), node) : node; 15443 } 15444 function createSpreadElement(expression) { 15445 const node = createBaseExpression(231 /* SpreadElement */); 15446 node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); 15447 node.transformFlags |= propagateChildFlags(node.expression) | 1024 /* ContainsES2015 */ | 32768 /* ContainsRestOrSpread */; 15448 return node; 15449 } 15450 function updateSpreadElement(node, expression) { 15451 return node.expression !== expression ? update(createSpreadElement(expression), node) : node; 15452 } 15453 function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { 15454 const node = createBaseClassLikeDeclaration( 15455 232 /* ClassExpression */, 15456 modifiers, 15457 name, 15458 typeParameters, 15459 heritageClauses, 15460 members 15461 ); 15462 node.transformFlags |= 1024 /* ContainsES2015 */; 15463 return node; 15464 } 15465 function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) { 15466 return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassExpression(modifiers, name, typeParameters, heritageClauses, members), node) : node; 15467 } 15468 function createOmittedExpression() { 15469 return createBaseExpression(233 /* OmittedExpression */); 15470 } 15471 function createExpressionWithTypeArguments(expression, typeArguments) { 15472 const node = createBaseNode(234 /* ExpressionWithTypeArguments */); 15473 node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false); 15474 node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); 15475 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.typeArguments) | 1024 /* ContainsES2015 */; 15476 return node; 15477 } 15478 function updateExpressionWithTypeArguments(node, expression, typeArguments) { 15479 return node.expression !== expression || node.typeArguments !== typeArguments ? update(createExpressionWithTypeArguments(expression, typeArguments), node) : node; 15480 } 15481 function createAsExpression(expression, type) { 15482 const node = createBaseExpression(235 /* AsExpression */); 15483 node.expression = expression; 15484 node.type = type; 15485 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; 15486 return node; 15487 } 15488 function updateAsExpression(node, expression, type) { 15489 return node.expression !== expression || node.type !== type ? update(createAsExpression(expression, type), node) : node; 15490 } 15491 function createNonNullExpression(expression) { 15492 const node = createBaseExpression(236 /* NonNullExpression */); 15493 node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false); 15494 node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; 15495 return node; 15496 } 15497 function updateNonNullExpression(node, expression) { 15498 if (isNonNullChain(node)) { 15499 return updateNonNullChain(node, expression); 15500 } 15501 return node.expression !== expression ? update(createNonNullExpression(expression), node) : node; 15502 } 15503 function createSatisfiesExpression(expression, type) { 15504 const node = createBaseExpression(239 /* SatisfiesExpression */); 15505 node.expression = expression; 15506 node.type = type; 15507 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.type) | 1 /* ContainsTypeScript */; 15508 return node; 15509 } 15510 function updateSatisfiesExpression(node, expression, type) { 15511 return node.expression !== expression || node.type !== type ? update(createSatisfiesExpression(expression, type), node) : node; 15512 } 15513 function createNonNullChain(expression) { 15514 const node = createBaseExpression(236 /* NonNullExpression */); 15515 node.flags |= 32 /* OptionalChain */; 15516 node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, true); 15517 node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; 15518 return node; 15519 } 15520 function updateNonNullChain(node, expression) { 15521 Debug.assert(!!(node.flags & 32 /* OptionalChain */), "Cannot update a NonNullExpression using updateNonNullChain. Use updateNonNullExpression instead."); 15522 return node.expression !== expression ? update(createNonNullChain(expression), node) : node; 15523 } 15524 function createMetaProperty(keywordToken, name) { 15525 const node = createBaseExpression(237 /* MetaProperty */); 15526 node.keywordToken = keywordToken; 15527 node.name = name; 15528 node.transformFlags |= propagateChildFlags(node.name); 15529 switch (keywordToken) { 15530 case 104 /* NewKeyword */: 15531 node.transformFlags |= 1024 /* ContainsES2015 */; 15532 break; 15533 case 101 /* ImportKeyword */: 15534 node.transformFlags |= 4 /* ContainsESNext */; 15535 break; 15536 default: 15537 return Debug.assertNever(keywordToken); 15538 } 15539 return node; 15540 } 15541 function updateMetaProperty(node, name) { 15542 return node.name !== name ? update(createMetaProperty(node.keywordToken, name), node) : node; 15543 } 15544 function createTemplateSpan(expression, literal) { 15545 const node = createBaseNode(240 /* TemplateSpan */); 15546 node.expression = expression; 15547 node.literal = literal; 15548 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.literal) | 1024 /* ContainsES2015 */; 15549 return node; 15550 } 15551 function updateTemplateSpan(node, expression, literal) { 15552 return node.expression !== expression || node.literal !== literal ? update(createTemplateSpan(expression, literal), node) : node; 15553 } 15554 function createSemicolonClassElement() { 15555 const node = createBaseNode(241 /* SemicolonClassElement */); 15556 node.transformFlags |= 1024 /* ContainsES2015 */; 15557 return node; 15558 } 15559 function createBlock(statements, multiLine) { 15560 const node = createBaseNode(242 /* Block */); 15561 node.statements = createNodeArray(statements); 15562 node.multiLine = multiLine; 15563 node.transformFlags |= propagateChildrenFlags(node.statements); 15564 return node; 15565 } 15566 function updateBlock(node, statements) { 15567 return node.statements !== statements ? update(createBlock(statements, node.multiLine), node) : node; 15568 } 15569 function createVariableStatement(modifiers, declarationList) { 15570 const node = createBaseDeclaration(244 /* VariableStatement */); 15571 node.modifiers = asNodeArray(modifiers); 15572 node.declarationList = isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; 15573 node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.declarationList); 15574 if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) { 15575 node.transformFlags = 1 /* ContainsTypeScript */; 15576 } 15577 return node; 15578 } 15579 function updateVariableStatement(node, modifiers, declarationList) { 15580 return node.modifiers !== modifiers || node.declarationList !== declarationList ? update(createVariableStatement(modifiers, declarationList), node) : node; 15581 } 15582 function createEmptyStatement() { 15583 return createBaseNode(243 /* EmptyStatement */); 15584 } 15585 function createExpressionStatement(expression) { 15586 const node = createBaseNode(245 /* ExpressionStatement */); 15587 node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression); 15588 node.transformFlags |= propagateChildFlags(node.expression); 15589 return node; 15590 } 15591 function updateExpressionStatement(node, expression) { 15592 return node.expression !== expression ? update(createExpressionStatement(expression), node) : node; 15593 } 15594 function createIfStatement(expression, thenStatement, elseStatement) { 15595 const node = createBaseNode(246 /* IfStatement */); 15596 node.expression = expression; 15597 node.thenStatement = asEmbeddedStatement(thenStatement); 15598 node.elseStatement = asEmbeddedStatement(elseStatement); 15599 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thenStatement) | propagateChildFlags(node.elseStatement); 15600 return node; 15601 } 15602 function updateIfStatement(node, expression, thenStatement, elseStatement) { 15603 return node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement ? update(createIfStatement(expression, thenStatement, elseStatement), node) : node; 15604 } 15605 function createDoStatement(statement, expression) { 15606 const node = createBaseNode(247 /* DoStatement */); 15607 node.statement = asEmbeddedStatement(statement); 15608 node.expression = expression; 15609 node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression); 15610 return node; 15611 } 15612 function updateDoStatement(node, statement, expression) { 15613 return node.statement !== statement || node.expression !== expression ? update(createDoStatement(statement, expression), node) : node; 15614 } 15615 function createWhileStatement(expression, statement) { 15616 const node = createBaseNode(248 /* WhileStatement */); 15617 node.expression = expression; 15618 node.statement = asEmbeddedStatement(statement); 15619 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); 15620 return node; 15621 } 15622 function updateWhileStatement(node, expression, statement) { 15623 return node.expression !== expression || node.statement !== statement ? update(createWhileStatement(expression, statement), node) : node; 15624 } 15625 function createForStatement(initializer, condition, incrementor, statement) { 15626 const node = createBaseNode(249 /* ForStatement */); 15627 node.initializer = initializer; 15628 node.condition = condition; 15629 node.incrementor = incrementor; 15630 node.statement = asEmbeddedStatement(statement); 15631 node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.condition) | propagateChildFlags(node.incrementor) | propagateChildFlags(node.statement); 15632 return node; 15633 } 15634 function updateForStatement(node, initializer, condition, incrementor, statement) { 15635 return node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement ? update(createForStatement(initializer, condition, incrementor, statement), node) : node; 15636 } 15637 function createForInStatement(initializer, expression, statement) { 15638 const node = createBaseNode(250 /* ForInStatement */); 15639 node.initializer = initializer; 15640 node.expression = expression; 15641 node.statement = asEmbeddedStatement(statement); 15642 node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement); 15643 return node; 15644 } 15645 function updateForInStatement(node, initializer, expression, statement) { 15646 return node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForInStatement(initializer, expression, statement), node) : node; 15647 } 15648 function createForOfStatement(awaitModifier, initializer, expression, statement) { 15649 const node = createBaseNode(251 /* ForOfStatement */); 15650 node.awaitModifier = awaitModifier; 15651 node.initializer = initializer; 15652 node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); 15653 node.statement = asEmbeddedStatement(statement); 15654 node.transformFlags |= propagateChildFlags(node.awaitModifier) | propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement) | 1024 /* ContainsES2015 */; 15655 if (awaitModifier) 15656 node.transformFlags |= 128 /* ContainsES2018 */; 15657 return node; 15658 } 15659 function updateForOfStatement(node, awaitModifier, initializer, expression, statement) { 15660 return node.awaitModifier !== awaitModifier || node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? update(createForOfStatement(awaitModifier, initializer, expression, statement), node) : node; 15661 } 15662 function createContinueStatement(label) { 15663 const node = createBaseNode(252 /* ContinueStatement */); 15664 node.label = asName(label); 15665 node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; 15666 return node; 15667 } 15668 function updateContinueStatement(node, label) { 15669 return node.label !== label ? update(createContinueStatement(label), node) : node; 15670 } 15671 function createBreakStatement(label) { 15672 const node = createBaseNode(253 /* BreakStatement */); 15673 node.label = asName(label); 15674 node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; 15675 return node; 15676 } 15677 function updateBreakStatement(node, label) { 15678 return node.label !== label ? update(createBreakStatement(label), node) : node; 15679 } 15680 function createReturnStatement(expression) { 15681 const node = createBaseNode(254 /* ReturnStatement */); 15682 node.expression = expression; 15683 node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */; 15684 return node; 15685 } 15686 function updateReturnStatement(node, expression) { 15687 return node.expression !== expression ? update(createReturnStatement(expression), node) : node; 15688 } 15689 function createWithStatement(expression, statement) { 15690 const node = createBaseNode(255 /* WithStatement */); 15691 node.expression = expression; 15692 node.statement = asEmbeddedStatement(statement); 15693 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement); 15694 return node; 15695 } 15696 function updateWithStatement(node, expression, statement) { 15697 return node.expression !== expression || node.statement !== statement ? update(createWithStatement(expression, statement), node) : node; 15698 } 15699 function createSwitchStatement(expression, caseBlock) { 15700 const node = createBaseNode(256 /* SwitchStatement */); 15701 node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); 15702 node.caseBlock = caseBlock; 15703 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock); 15704 return node; 15705 } 15706 function updateSwitchStatement(node, expression, caseBlock) { 15707 return node.expression !== expression || node.caseBlock !== caseBlock ? update(createSwitchStatement(expression, caseBlock), node) : node; 15708 } 15709 function createLabeledStatement(label, statement) { 15710 const node = createBaseNode(257 /* LabeledStatement */); 15711 node.label = asName(label); 15712 node.statement = asEmbeddedStatement(statement); 15713 node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement); 15714 return node; 15715 } 15716 function updateLabeledStatement(node, label, statement) { 15717 return node.label !== label || node.statement !== statement ? update(createLabeledStatement(label, statement), node) : node; 15718 } 15719 function createThrowStatement(expression) { 15720 const node = createBaseNode(258 /* ThrowStatement */); 15721 node.expression = expression; 15722 node.transformFlags |= propagateChildFlags(node.expression); 15723 return node; 15724 } 15725 function updateThrowStatement(node, expression) { 15726 return node.expression !== expression ? update(createThrowStatement(expression), node) : node; 15727 } 15728 function createTryStatement(tryBlock, catchClause, finallyBlock) { 15729 const node = createBaseNode(259 /* TryStatement */); 15730 node.tryBlock = tryBlock; 15731 node.catchClause = catchClause; 15732 node.finallyBlock = finallyBlock; 15733 node.transformFlags |= propagateChildFlags(node.tryBlock) | propagateChildFlags(node.catchClause) | propagateChildFlags(node.finallyBlock); 15734 return node; 15735 } 15736 function updateTryStatement(node, tryBlock, catchClause, finallyBlock) { 15737 return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? update(createTryStatement(tryBlock, catchClause, finallyBlock), node) : node; 15738 } 15739 function createDebuggerStatement() { 15740 return createBaseNode(260 /* DebuggerStatement */); 15741 } 15742 function createVariableDeclaration(name, exclamationToken, type, initializer) { 15743 const node = createBaseVariableLikeDeclaration( 15744 261 /* VariableDeclaration */, 15745 void 0, 15746 name, 15747 type, 15748 initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer) 15749 ); 15750 node.exclamationToken = exclamationToken; 15751 node.transformFlags |= propagateChildFlags(node.exclamationToken); 15752 if (exclamationToken) { 15753 node.transformFlags |= 1 /* ContainsTypeScript */; 15754 } 15755 return node; 15756 } 15757 function updateVariableDeclaration(node, name, exclamationToken, type, initializer) { 15758 return node.name !== name || node.type !== type || node.exclamationToken !== exclamationToken || node.initializer !== initializer ? update(createVariableDeclaration(name, exclamationToken, type, initializer), node) : node; 15759 } 15760 function createVariableDeclarationList(declarations, flags2 = 0 /* None */) { 15761 const node = createBaseNode(262 /* VariableDeclarationList */); 15762 node.flags |= flags2 & 3 /* BlockScoped */; 15763 node.declarations = createNodeArray(declarations); 15764 node.transformFlags |= propagateChildrenFlags(node.declarations) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; 15765 if (flags2 & 3 /* BlockScoped */) { 15766 node.transformFlags |= 1024 /* ContainsES2015 */ | 262144 /* ContainsBlockScopedBinding */; 15767 } 15768 return node; 15769 } 15770 function updateVariableDeclarationList(node, declarations) { 15771 return node.declarations !== declarations ? update(createVariableDeclarationList(declarations, node.flags), node) : node; 15772 } 15773 function createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { 15774 const node = createBaseFunctionLikeDeclaration( 15775 263 /* FunctionDeclaration */, 15776 modifiers, 15777 name, 15778 typeParameters, 15779 parameters, 15780 type, 15781 body 15782 ); 15783 node.asteriskToken = asteriskToken; 15784 if (!node.body || modifiersToFlags(node.modifiers) & 2 /* Ambient */) { 15785 node.transformFlags = 1 /* ContainsTypeScript */; 15786 } else { 15787 node.transformFlags |= propagateChildFlags(node.asteriskToken) | 4194304 /* ContainsHoistedDeclarationOrCompletion */; 15788 if (modifiersToFlags(node.modifiers) & 512 /* Async */) { 15789 if (node.asteriskToken) { 15790 node.transformFlags |= 128 /* ContainsES2018 */; 15791 } else { 15792 node.transformFlags |= 256 /* ContainsES2017 */; 15793 } 15794 } else if (node.asteriskToken) { 15795 node.transformFlags |= 2048 /* ContainsGenerator */; 15796 } 15797 } 15798 node.illegalDecorators = void 0; 15799 return node; 15800 } 15801 function updateFunctionDeclaration(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { 15802 return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? finishUpdateFunctionDeclaration(createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body), node) : node; 15803 } 15804 function finishUpdateFunctionDeclaration(updated, original) { 15805 if (updated !== original) { 15806 updated.illegalDecorators = original.illegalDecorators; 15807 } 15808 return finishUpdateBaseSignatureDeclaration(updated, original); 15809 } 15810 function createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) { 15811 const node = createBaseClassLikeDeclaration( 15812 264 /* ClassDeclaration */, 15813 modifiers, 15814 name, 15815 typeParameters, 15816 heritageClauses, 15817 members 15818 ); 15819 if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) { 15820 node.transformFlags = 1 /* ContainsTypeScript */; 15821 } else { 15822 node.transformFlags |= 1024 /* ContainsES2015 */; 15823 if (node.transformFlags & 8192 /* ContainsTypeScriptClassSyntax */) { 15824 node.transformFlags |= 1 /* ContainsTypeScript */; 15825 } 15826 } 15827 return node; 15828 } 15829 function updateClassDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) { 15830 return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; 15831 } 15832 function createStructDeclaration(modifiers, name, typeParameters, heritageClauses, members) { 15833 const node = createBaseClassLikeDeclaration( 15834 265 /* StructDeclaration */, 15835 modifiers, 15836 name, 15837 typeParameters, 15838 heritageClauses, 15839 members 15840 ); 15841 if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) { 15842 node.transformFlags = 1 /* ContainsTypeScript */; 15843 } else { 15844 node.transformFlags |= 1024 /* ContainsES2015 */; 15845 if (node.transformFlags & 8192 /* ContainsTypeScriptClassSyntax */) { 15846 node.transformFlags |= 1 /* ContainsTypeScript */; 15847 } 15848 } 15849 return node; 15850 } 15851 function updateStructDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) { 15852 return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? update(createStructDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; 15853 } 15854 function createAnnotationDeclaration(modifiers, name, members) { 15855 const node = createBaseNamedDeclaration( 15856 266 /* AnnotationDeclaration */, 15857 modifiers, 15858 name 15859 ); 15860 node.members = createNodeArray(members); 15861 node.transformFlags |= propagateChildrenFlags(node.members); 15862 if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) { 15863 node.transformFlags = 1 /* ContainsTypeScript */; 15864 } else { 15865 node.transformFlags |= 1024 /* ContainsES2015 */; 15866 node.transformFlags |= 1 /* ContainsTypeScript */; 15867 } 15868 return node; 15869 } 15870 function updateAnnotationDeclaration(node, modifiers, name, members) { 15871 return node.modifiers !== modifiers || node.name !== name || node.members !== members ? update(createAnnotationDeclaration(modifiers, name, members), node) : node; 15872 } 15873 function createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members) { 15874 const node = createBaseInterfaceOrClassLikeDeclaration( 15875 267 /* InterfaceDeclaration */, 15876 modifiers, 15877 name, 15878 typeParameters, 15879 heritageClauses 15880 ); 15881 node.members = createNodeArray(members); 15882 node.transformFlags = 1 /* ContainsTypeScript */; 15883 node.illegalDecorators = void 0; 15884 return node; 15885 } 15886 function updateInterfaceDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) { 15887 return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? finishUpdateInterfaceDeclaration(createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members), node) : node; 15888 } 15889 function finishUpdateInterfaceDeclaration(updated, original) { 15890 if (updated !== original) { 15891 updated.illegalDecorators = original.illegalDecorators; 15892 } 15893 return update(updated, original); 15894 } 15895 function createTypeAliasDeclaration(modifiers, name, typeParameters, type) { 15896 const node = createBaseGenericNamedDeclaration( 15897 268 /* TypeAliasDeclaration */, 15898 modifiers, 15899 name, 15900 typeParameters 15901 ); 15902 node.type = type; 15903 node.transformFlags = 1 /* ContainsTypeScript */; 15904 node.illegalDecorators = void 0; 15905 return node; 15906 } 15907 function updateTypeAliasDeclaration(node, modifiers, name, typeParameters, type) { 15908 return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.type !== type ? finishUpdateTypeAliasDeclaration(createTypeAliasDeclaration(modifiers, name, typeParameters, type), node) : node; 15909 } 15910 function finishUpdateTypeAliasDeclaration(updated, original) { 15911 if (updated !== original) { 15912 updated.illegalDecorators = original.illegalDecorators; 15913 } 15914 return update(updated, original); 15915 } 15916 function createEnumDeclaration(modifiers, name, members) { 15917 const node = createBaseNamedDeclaration( 15918 269 /* EnumDeclaration */, 15919 modifiers, 15920 name 15921 ); 15922 node.members = createNodeArray(members); 15923 node.transformFlags |= propagateChildrenFlags(node.members) | 1 /* ContainsTypeScript */; 15924 node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; 15925 node.illegalDecorators = void 0; 15926 return node; 15927 } 15928 function updateEnumDeclaration(node, modifiers, name, members) { 15929 return node.modifiers !== modifiers || node.name !== name || node.members !== members ? finishUpdateEnumDeclaration(createEnumDeclaration(modifiers, name, members), node) : node; 15930 } 15931 function finishUpdateEnumDeclaration(updated, original) { 15932 if (updated !== original) { 15933 updated.illegalDecorators = original.illegalDecorators; 15934 } 15935 return update(updated, original); 15936 } 15937 function createModuleDeclaration(modifiers, name, body, flags2 = 0 /* None */) { 15938 const node = createBaseDeclaration(270 /* ModuleDeclaration */); 15939 node.modifiers = asNodeArray(modifiers); 15940 node.flags |= flags2 & (16 /* Namespace */ | 4 /* NestedNamespace */ | 1024 /* GlobalAugmentation */); 15941 node.name = name; 15942 node.body = body; 15943 if (modifiersToFlags(node.modifiers) & 2 /* Ambient */) { 15944 node.transformFlags = 1 /* ContainsTypeScript */; 15945 } else { 15946 node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.name) | propagateChildFlags(node.body) | 1 /* ContainsTypeScript */; 15947 } 15948 node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; 15949 node.illegalDecorators = void 0; 15950 return node; 15951 } 15952 function updateModuleDeclaration(node, modifiers, name, body) { 15953 return node.modifiers !== modifiers || node.name !== name || node.body !== body ? finishUpdateModuleDeclaration(createModuleDeclaration(modifiers, name, body, node.flags), node) : node; 15954 } 15955 function finishUpdateModuleDeclaration(updated, original) { 15956 if (updated !== original) { 15957 updated.illegalDecorators = original.illegalDecorators; 15958 } 15959 return update(updated, original); 15960 } 15961 function createModuleBlock(statements) { 15962 const node = createBaseNode(271 /* ModuleBlock */); 15963 node.statements = createNodeArray(statements); 15964 node.transformFlags |= propagateChildrenFlags(node.statements); 15965 return node; 15966 } 15967 function updateModuleBlock(node, statements) { 15968 return node.statements !== statements ? update(createModuleBlock(statements), node) : node; 15969 } 15970 function createCaseBlock(clauses) { 15971 const node = createBaseNode(272 /* CaseBlock */); 15972 node.clauses = createNodeArray(clauses); 15973 node.transformFlags |= propagateChildrenFlags(node.clauses); 15974 return node; 15975 } 15976 function updateCaseBlock(node, clauses) { 15977 return node.clauses !== clauses ? update(createCaseBlock(clauses), node) : node; 15978 } 15979 function createNamespaceExportDeclaration(name) { 15980 const node = createBaseNamedDeclaration( 15981 273 /* NamespaceExportDeclaration */, 15982 void 0, 15983 name 15984 ); 15985 node.transformFlags = 1 /* ContainsTypeScript */; 15986 node.illegalDecorators = void 0; 15987 node.modifiers = void 0; 15988 return node; 15989 } 15990 function updateNamespaceExportDeclaration(node, name) { 15991 return node.name !== name ? finishUpdateNamespaceExportDeclaration(createNamespaceExportDeclaration(name), node) : node; 15992 } 15993 function finishUpdateNamespaceExportDeclaration(updated, original) { 15994 if (updated !== original) { 15995 updated.illegalDecorators = original.illegalDecorators; 15996 updated.modifiers = original.modifiers; 15997 } 15998 return update(updated, original); 15999 } 16000 function createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference) { 16001 const node = createBaseNamedDeclaration( 16002 274 /* ImportEqualsDeclaration */, 16003 modifiers, 16004 name 16005 ); 16006 node.isTypeOnly = isTypeOnly; 16007 node.moduleReference = moduleReference; 16008 node.transformFlags |= propagateChildFlags(node.moduleReference); 16009 if (!isExternalModuleReference(node.moduleReference)) 16010 node.transformFlags |= 1 /* ContainsTypeScript */; 16011 node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; 16012 node.illegalDecorators = void 0; 16013 return node; 16014 } 16015 function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) { 16016 return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? finishUpdateImportEqualsDeclaration(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node; 16017 } 16018 function finishUpdateImportEqualsDeclaration(updated, original) { 16019 if (updated !== original) { 16020 updated.illegalDecorators = original.illegalDecorators; 16021 } 16022 return update(updated, original); 16023 } 16024 function createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause) { 16025 const node = createBaseDeclaration(275 /* ImportDeclaration */); 16026 node.modifiers = asNodeArray(modifiers); 16027 node.importClause = importClause; 16028 node.moduleSpecifier = moduleSpecifier; 16029 node.assertClause = assertClause; 16030 node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier); 16031 node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; 16032 node.illegalDecorators = void 0; 16033 return node; 16034 } 16035 function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) { 16036 return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateImportDeclaration(createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause), node) : node; 16037 } 16038 function finishUpdateImportDeclaration(updated, original) { 16039 if (updated !== original) { 16040 updated.illegalDecorators = original.illegalDecorators; 16041 } 16042 return update(updated, original); 16043 } 16044 function createImportClause(isTypeOnly, name, namedBindings) { 16045 const node = createBaseNode(276 /* ImportClause */); 16046 node.isTypeOnly = isTypeOnly; 16047 node.name = name; 16048 node.namedBindings = namedBindings; 16049 node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.namedBindings); 16050 if (isTypeOnly) { 16051 node.transformFlags |= 1 /* ContainsTypeScript */; 16052 } 16053 node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; 16054 node.isLazy = void 0; 16055 return node; 16056 } 16057 function updateImportClause(node, isTypeOnly, name, namedBindings) { 16058 return node.isTypeOnly !== isTypeOnly || node.name !== name || node.namedBindings !== namedBindings ? finishUpdateImportClause(createImportClause(isTypeOnly, name, namedBindings), node) : node; 16059 } 16060 function finishUpdateImportClause(updated, original) { 16061 if (updated !== original) { 16062 updated.isLazy = original.isLazy; 16063 } 16064 return update(updated, original); 16065 } 16066 function createAssertClause(elements, multiLine) { 16067 const node = createBaseNode(302 /* AssertClause */); 16068 node.elements = createNodeArray(elements); 16069 node.multiLine = multiLine; 16070 node.transformFlags |= 4 /* ContainsESNext */; 16071 return node; 16072 } 16073 function updateAssertClause(node, elements, multiLine) { 16074 return node.elements !== elements || node.multiLine !== multiLine ? update(createAssertClause(elements, multiLine), node) : node; 16075 } 16076 function createAssertEntry(name, value) { 16077 const node = createBaseNode(303 /* AssertEntry */); 16078 node.name = name; 16079 node.value = value; 16080 node.transformFlags |= 4 /* ContainsESNext */; 16081 return node; 16082 } 16083 function updateAssertEntry(node, name, value) { 16084 return node.name !== name || node.value !== value ? update(createAssertEntry(name, value), node) : node; 16085 } 16086 function createImportTypeAssertionContainer(clause, multiLine) { 16087 const node = createBaseNode(304 /* ImportTypeAssertionContainer */); 16088 node.assertClause = clause; 16089 node.multiLine = multiLine; 16090 return node; 16091 } 16092 function updateImportTypeAssertionContainer(node, clause, multiLine) { 16093 return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node; 16094 } 16095 function createNamespaceImport(name) { 16096 const node = createBaseNode(277 /* NamespaceImport */); 16097 node.name = name; 16098 node.transformFlags |= propagateChildFlags(node.name); 16099 node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; 16100 return node; 16101 } 16102 function updateNamespaceImport(node, name) { 16103 return node.name !== name ? update(createNamespaceImport(name), node) : node; 16104 } 16105 function createNamespaceExport(name) { 16106 const node = createBaseNode(283 /* NamespaceExport */); 16107 node.name = name; 16108 node.transformFlags |= propagateChildFlags(node.name) | 4 /* ContainsESNext */; 16109 node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; 16110 return node; 16111 } 16112 function updateNamespaceExport(node, name) { 16113 return node.name !== name ? update(createNamespaceExport(name), node) : node; 16114 } 16115 function createNamedImports(elements) { 16116 const node = createBaseNode(278 /* NamedImports */); 16117 node.elements = createNodeArray(elements); 16118 node.transformFlags |= propagateChildrenFlags(node.elements); 16119 node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; 16120 return node; 16121 } 16122 function updateNamedImports(node, elements) { 16123 return node.elements !== elements ? update(createNamedImports(elements), node) : node; 16124 } 16125 function createImportSpecifier(isTypeOnly, propertyName, name) { 16126 const node = createBaseNode(279 /* ImportSpecifier */); 16127 node.isTypeOnly = isTypeOnly; 16128 node.propertyName = propertyName; 16129 node.name = name; 16130 node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name); 16131 node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; 16132 return node; 16133 } 16134 function updateImportSpecifier(node, isTypeOnly, propertyName, name) { 16135 return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createImportSpecifier(isTypeOnly, propertyName, name), node) : node; 16136 } 16137 function createExportAssignment(modifiers, isExportEquals, expression) { 16138 const node = createBaseDeclaration(280 /* ExportAssignment */); 16139 node.modifiers = asNodeArray(modifiers); 16140 node.isExportEquals = isExportEquals; 16141 node.expression = isExportEquals ? parenthesizerRules().parenthesizeRightSideOfBinary(63 /* EqualsToken */, void 0, expression) : parenthesizerRules().parenthesizeExpressionOfExportDefault(expression); 16142 node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.expression); 16143 node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; 16144 node.illegalDecorators = void 0; 16145 return node; 16146 } 16147 function updateExportAssignment(node, modifiers, expression) { 16148 return node.modifiers !== modifiers || node.expression !== expression ? finishUpdateExportAssignment(createExportAssignment(modifiers, node.isExportEquals, expression), node) : node; 16149 } 16150 function finishUpdateExportAssignment(updated, original) { 16151 if (updated !== original) { 16152 updated.illegalDecorators = original.illegalDecorators; 16153 } 16154 return update(updated, original); 16155 } 16156 function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { 16157 const node = createBaseDeclaration(281 /* ExportDeclaration */); 16158 node.modifiers = asNodeArray(modifiers); 16159 node.isTypeOnly = isTypeOnly; 16160 node.exportClause = exportClause; 16161 node.moduleSpecifier = moduleSpecifier; 16162 node.assertClause = assertClause; 16163 node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier); 16164 node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; 16165 node.illegalDecorators = void 0; 16166 return node; 16167 } 16168 function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) { 16169 return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause), node) : node; 16170 } 16171 function finishUpdateExportDeclaration(updated, original) { 16172 if (updated !== original) { 16173 updated.illegalDecorators = original.illegalDecorators; 16174 } 16175 return update(updated, original); 16176 } 16177 function createNamedExports(elements) { 16178 const node = createBaseNode(282 /* NamedExports */); 16179 node.elements = createNodeArray(elements); 16180 node.transformFlags |= propagateChildrenFlags(node.elements); 16181 node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; 16182 return node; 16183 } 16184 function updateNamedExports(node, elements) { 16185 return node.elements !== elements ? update(createNamedExports(elements), node) : node; 16186 } 16187 function createExportSpecifier(isTypeOnly, propertyName, name) { 16188 const node = createBaseNode(284 /* ExportSpecifier */); 16189 node.isTypeOnly = isTypeOnly; 16190 node.propertyName = asName(propertyName); 16191 node.name = asName(name); 16192 node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name); 16193 node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; 16194 return node; 16195 } 16196 function updateExportSpecifier(node, isTypeOnly, propertyName, name) { 16197 return node.isTypeOnly !== isTypeOnly || node.propertyName !== propertyName || node.name !== name ? update(createExportSpecifier(isTypeOnly, propertyName, name), node) : node; 16198 } 16199 function createMissingDeclaration() { 16200 const node = createBaseDeclaration(285 /* MissingDeclaration */); 16201 return node; 16202 } 16203 function createExternalModuleReference(expression) { 16204 const node = createBaseNode(286 /* ExternalModuleReference */); 16205 node.expression = expression; 16206 node.transformFlags |= propagateChildFlags(node.expression); 16207 node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */; 16208 return node; 16209 } 16210 function updateExternalModuleReference(node, expression) { 16211 return node.expression !== expression ? update(createExternalModuleReference(expression), node) : node; 16212 } 16213 function createJSDocPrimaryTypeWorker(kind) { 16214 return createBaseNode(kind); 16215 } 16216 function createJSDocPrePostfixUnaryTypeWorker(kind, type, postfix = false) { 16217 const node = createJSDocUnaryTypeWorker( 16218 kind, 16219 postfix ? type && parenthesizerRules().parenthesizeNonArrayTypeOfPostfixType(type) : type 16220 ); 16221 node.postfix = postfix; 16222 return node; 16223 } 16224 function createJSDocUnaryTypeWorker(kind, type) { 16225 const node = createBaseNode(kind); 16226 node.type = type; 16227 return node; 16228 } 16229 function updateJSDocPrePostfixUnaryTypeWorker(kind, node, type) { 16230 return node.type !== type ? update(createJSDocPrePostfixUnaryTypeWorker(kind, type, node.postfix), node) : node; 16231 } 16232 function updateJSDocUnaryTypeWorker(kind, node, type) { 16233 return node.type !== type ? update(createJSDocUnaryTypeWorker(kind, type), node) : node; 16234 } 16235 function createJSDocFunctionType(parameters, type) { 16236 const node = createBaseSignatureDeclaration( 16237 326 /* JSDocFunctionType */, 16238 void 0, 16239 void 0, 16240 void 0, 16241 parameters, 16242 type 16243 ); 16244 return node; 16245 } 16246 function updateJSDocFunctionType(node, parameters, type) { 16247 return node.parameters !== parameters || node.type !== type ? update(createJSDocFunctionType(parameters, type), node) : node; 16248 } 16249 function createJSDocTypeLiteral(propertyTags, isArrayType = false) { 16250 const node = createBaseNode(331 /* JSDocTypeLiteral */); 16251 node.jsDocPropertyTags = asNodeArray(propertyTags); 16252 node.isArrayType = isArrayType; 16253 return node; 16254 } 16255 function updateJSDocTypeLiteral(node, propertyTags, isArrayType) { 16256 return node.jsDocPropertyTags !== propertyTags || node.isArrayType !== isArrayType ? update(createJSDocTypeLiteral(propertyTags, isArrayType), node) : node; 16257 } 16258 function createJSDocTypeExpression(type) { 16259 const node = createBaseNode(318 /* JSDocTypeExpression */); 16260 node.type = type; 16261 return node; 16262 } 16263 function updateJSDocTypeExpression(node, type) { 16264 return node.type !== type ? update(createJSDocTypeExpression(type), node) : node; 16265 } 16266 function createJSDocSignature(typeParameters, parameters, type) { 16267 const node = createBaseNode(332 /* JSDocSignature */); 16268 node.typeParameters = asNodeArray(typeParameters); 16269 node.parameters = createNodeArray(parameters); 16270 node.type = type; 16271 return node; 16272 } 16273 function updateJSDocSignature(node, typeParameters, parameters, type) { 16274 return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? update(createJSDocSignature(typeParameters, parameters, type), node) : node; 16275 } 16276 function getDefaultTagName(node) { 16277 const defaultTagName = getDefaultTagNameForKind(node.kind); 16278 return node.tagName.escapedText === escapeLeadingUnderscores(defaultTagName) ? node.tagName : createIdentifier(defaultTagName); 16279 } 16280 function createBaseJSDocTag(kind, tagName, comment) { 16281 const node = createBaseNode(kind); 16282 node.tagName = tagName; 16283 node.comment = comment; 16284 return node; 16285 } 16286 function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) { 16287 const node = createBaseJSDocTag(353 /* JSDocTemplateTag */, tagName != null ? tagName : createIdentifier("template"), comment); 16288 node.constraint = constraint; 16289 node.typeParameters = createNodeArray(typeParameters); 16290 return node; 16291 } 16292 function updateJSDocTemplateTag(node, tagName = getDefaultTagName(node), constraint, typeParameters, comment) { 16293 return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? update(createJSDocTemplateTag(tagName, constraint, typeParameters, comment), node) : node; 16294 } 16295 function createJSDocTypedefTag(tagName, typeExpression, fullName, comment) { 16296 const node = createBaseJSDocTag(354 /* JSDocTypedefTag */, tagName != null ? tagName : createIdentifier("typedef"), comment); 16297 node.typeExpression = typeExpression; 16298 node.fullName = fullName; 16299 node.name = getJSDocTypeAliasName(fullName); 16300 return node; 16301 } 16302 function updateJSDocTypedefTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) { 16303 return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocTypedefTag(tagName, typeExpression, fullName, comment), node) : node; 16304 } 16305 function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { 16306 const node = createBaseJSDocTag(349 /* JSDocParameterTag */, tagName != null ? tagName : createIdentifier("param"), comment); 16307 node.typeExpression = typeExpression; 16308 node.name = name; 16309 node.isNameFirst = !!isNameFirst; 16310 node.isBracketed = isBracketed; 16311 return node; 16312 } 16313 function updateJSDocParameterTag(node, tagName = getDefaultTagName(node), name, isBracketed, typeExpression, isNameFirst, comment) { 16314 return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; 16315 } 16316 function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) { 16317 const node = createBaseJSDocTag(356 /* JSDocPropertyTag */, tagName != null ? tagName : createIdentifier("prop"), comment); 16318 node.typeExpression = typeExpression; 16319 node.name = name; 16320 node.isNameFirst = !!isNameFirst; 16321 node.isBracketed = isBracketed; 16322 return node; 16323 } 16324 function updateJSDocPropertyTag(node, tagName = getDefaultTagName(node), name, isBracketed, typeExpression, isNameFirst, comment) { 16325 return node.tagName !== tagName || node.name !== name || node.isBracketed !== isBracketed || node.typeExpression !== typeExpression || node.isNameFirst !== isNameFirst || node.comment !== comment ? update(createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment), node) : node; 16326 } 16327 function createJSDocCallbackTag(tagName, typeExpression, fullName, comment) { 16328 const node = createBaseJSDocTag(347 /* JSDocCallbackTag */, tagName != null ? tagName : createIdentifier("callback"), comment); 16329 node.typeExpression = typeExpression; 16330 node.fullName = fullName; 16331 node.name = getJSDocTypeAliasName(fullName); 16332 return node; 16333 } 16334 function updateJSDocCallbackTag(node, tagName = getDefaultTagName(node), typeExpression, fullName, comment) { 16335 return node.tagName !== tagName || node.typeExpression !== typeExpression || node.fullName !== fullName || node.comment !== comment ? update(createJSDocCallbackTag(tagName, typeExpression, fullName, comment), node) : node; 16336 } 16337 function createJSDocAugmentsTag(tagName, className, comment) { 16338 const node = createBaseJSDocTag(337 /* JSDocAugmentsTag */, tagName != null ? tagName : createIdentifier("augments"), comment); 16339 node.class = className; 16340 return node; 16341 } 16342 function updateJSDocAugmentsTag(node, tagName = getDefaultTagName(node), className, comment) { 16343 return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocAugmentsTag(tagName, className, comment), node) : node; 16344 } 16345 function createJSDocImplementsTag(tagName, className, comment) { 16346 const node = createBaseJSDocTag(338 /* JSDocImplementsTag */, tagName != null ? tagName : createIdentifier("implements"), comment); 16347 node.class = className; 16348 return node; 16349 } 16350 function createJSDocSeeTag(tagName, name, comment) { 16351 const node = createBaseJSDocTag(355 /* JSDocSeeTag */, tagName != null ? tagName : createIdentifier("see"), comment); 16352 node.name = name; 16353 return node; 16354 } 16355 function updateJSDocSeeTag(node, tagName, name, comment) { 16356 return node.tagName !== tagName || node.name !== name || node.comment !== comment ? update(createJSDocSeeTag(tagName, name, comment), node) : node; 16357 } 16358 function createJSDocNameReference(name) { 16359 const node = createBaseNode(319 /* JSDocNameReference */); 16360 node.name = name; 16361 return node; 16362 } 16363 function updateJSDocNameReference(node, name) { 16364 return node.name !== name ? update(createJSDocNameReference(name), node) : node; 16365 } 16366 function createJSDocMemberName(left, right) { 16367 const node = createBaseNode(320 /* JSDocMemberName */); 16368 node.left = left; 16369 node.right = right; 16370 node.transformFlags |= propagateChildFlags(node.left) | propagateChildFlags(node.right); 16371 return node; 16372 } 16373 function updateJSDocMemberName(node, left, right) { 16374 return node.left !== left || node.right !== right ? update(createJSDocMemberName(left, right), node) : node; 16375 } 16376 function createJSDocLink(name, text) { 16377 const node = createBaseNode(333 /* JSDocLink */); 16378 node.name = name; 16379 node.text = text; 16380 return node; 16381 } 16382 function updateJSDocLink(node, name, text) { 16383 return node.name !== name ? update(createJSDocLink(name, text), node) : node; 16384 } 16385 function createJSDocLinkCode(name, text) { 16386 const node = createBaseNode(334 /* JSDocLinkCode */); 16387 node.name = name; 16388 node.text = text; 16389 return node; 16390 } 16391 function updateJSDocLinkCode(node, name, text) { 16392 return node.name !== name ? update(createJSDocLinkCode(name, text), node) : node; 16393 } 16394 function createJSDocLinkPlain(name, text) { 16395 const node = createBaseNode(335 /* JSDocLinkPlain */); 16396 node.name = name; 16397 node.text = text; 16398 return node; 16399 } 16400 function updateJSDocLinkPlain(node, name, text) { 16401 return node.name !== name ? update(createJSDocLinkPlain(name, text), node) : node; 16402 } 16403 function updateJSDocImplementsTag(node, tagName = getDefaultTagName(node), className, comment) { 16404 return node.tagName !== tagName || node.class !== className || node.comment !== comment ? update(createJSDocImplementsTag(tagName, className, comment), node) : node; 16405 } 16406 function createJSDocSimpleTagWorker(kind, tagName, comment) { 16407 const node = createBaseJSDocTag(kind, tagName != null ? tagName : createIdentifier(getDefaultTagNameForKind(kind)), comment); 16408 return node; 16409 } 16410 function updateJSDocSimpleTagWorker(kind, node, tagName = getDefaultTagName(node), comment) { 16411 return node.tagName !== tagName || node.comment !== comment ? update(createJSDocSimpleTagWorker(kind, tagName, comment), node) : node; 16412 } 16413 function createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment) { 16414 const node = createBaseJSDocTag(kind, tagName != null ? tagName : createIdentifier(getDefaultTagNameForKind(kind)), comment); 16415 node.typeExpression = typeExpression; 16416 return node; 16417 } 16418 function updateJSDocTypeLikeTagWorker(kind, node, tagName = getDefaultTagName(node), typeExpression, comment) { 16419 return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocTypeLikeTagWorker(kind, tagName, typeExpression, comment), node) : node; 16420 } 16421 function createJSDocUnknownTag(tagName, comment) { 16422 const node = createBaseJSDocTag(336 /* JSDocTag */, tagName, comment); 16423 return node; 16424 } 16425 function updateJSDocUnknownTag(node, tagName, comment) { 16426 return node.tagName !== tagName || node.comment !== comment ? update(createJSDocUnknownTag(tagName, comment), node) : node; 16427 } 16428 function createJSDocText(text) { 16429 const node = createBaseNode(330 /* JSDocText */); 16430 node.text = text; 16431 return node; 16432 } 16433 function updateJSDocText(node, text) { 16434 return node.text !== text ? update(createJSDocText(text), node) : node; 16435 } 16436 function createJSDocComment(comment, tags) { 16437 const node = createBaseNode(329 /* JSDoc */); 16438 node.comment = comment; 16439 node.tags = asNodeArray(tags); 16440 return node; 16441 } 16442 function updateJSDocComment(node, comment, tags) { 16443 return node.comment !== comment || node.tags !== tags ? update(createJSDocComment(comment, tags), node) : node; 16444 } 16445 function createJsxElement(openingElement, children, closingElement) { 16446 const node = createBaseNode(287 /* JsxElement */); 16447 node.openingElement = openingElement; 16448 node.children = createNodeArray(children); 16449 node.closingElement = closingElement; 16450 node.transformFlags |= propagateChildFlags(node.openingElement) | propagateChildrenFlags(node.children) | propagateChildFlags(node.closingElement) | 2 /* ContainsJsx */; 16451 return node; 16452 } 16453 function updateJsxElement(node, openingElement, children, closingElement) { 16454 return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? update(createJsxElement(openingElement, children, closingElement), node) : node; 16455 } 16456 function createJsxSelfClosingElement(tagName, typeArguments, attributes) { 16457 const node = createBaseNode(288 /* JsxSelfClosingElement */); 16458 node.tagName = tagName; 16459 node.typeArguments = asNodeArray(typeArguments); 16460 node.attributes = attributes; 16461 node.transformFlags |= propagateChildFlags(node.tagName) | propagateChildrenFlags(node.typeArguments) | propagateChildFlags(node.attributes) | 2 /* ContainsJsx */; 16462 if (node.typeArguments) { 16463 node.transformFlags |= 1 /* ContainsTypeScript */; 16464 } 16465 return node; 16466 } 16467 function updateJsxSelfClosingElement(node, tagName, typeArguments, attributes) { 16468 return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxSelfClosingElement(tagName, typeArguments, attributes), node) : node; 16469 } 16470 function createJsxOpeningElement(tagName, typeArguments, attributes) { 16471 const node = createBaseNode(289 /* JsxOpeningElement */); 16472 node.tagName = tagName; 16473 node.typeArguments = asNodeArray(typeArguments); 16474 node.attributes = attributes; 16475 node.transformFlags |= propagateChildFlags(node.tagName) | propagateChildrenFlags(node.typeArguments) | propagateChildFlags(node.attributes) | 2 /* ContainsJsx */; 16476 if (typeArguments) { 16477 node.transformFlags |= 1 /* ContainsTypeScript */; 16478 } 16479 return node; 16480 } 16481 function updateJsxOpeningElement(node, tagName, typeArguments, attributes) { 16482 return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? update(createJsxOpeningElement(tagName, typeArguments, attributes), node) : node; 16483 } 16484 function createJsxClosingElement(tagName) { 16485 const node = createBaseNode(290 /* JsxClosingElement */); 16486 node.tagName = tagName; 16487 node.transformFlags |= propagateChildFlags(node.tagName) | 2 /* ContainsJsx */; 16488 return node; 16489 } 16490 function updateJsxClosingElement(node, tagName) { 16491 return node.tagName !== tagName ? update(createJsxClosingElement(tagName), node) : node; 16492 } 16493 function createJsxFragment(openingFragment, children, closingFragment) { 16494 const node = createBaseNode(291 /* JsxFragment */); 16495 node.openingFragment = openingFragment; 16496 node.children = createNodeArray(children); 16497 node.closingFragment = closingFragment; 16498 node.transformFlags |= propagateChildFlags(node.openingFragment) | propagateChildrenFlags(node.children) | propagateChildFlags(node.closingFragment) | 2 /* ContainsJsx */; 16499 return node; 16500 } 16501 function updateJsxFragment(node, openingFragment, children, closingFragment) { 16502 return node.openingFragment !== openingFragment || node.children !== children || node.closingFragment !== closingFragment ? update(createJsxFragment(openingFragment, children, closingFragment), node) : node; 16503 } 16504 function createJsxText(text, containsOnlyTriviaWhiteSpaces) { 16505 const node = createBaseNode(11 /* JsxText */); 16506 node.text = text; 16507 node.containsOnlyTriviaWhiteSpaces = !!containsOnlyTriviaWhiteSpaces; 16508 node.transformFlags |= 2 /* ContainsJsx */; 16509 return node; 16510 } 16511 function updateJsxText(node, text, containsOnlyTriviaWhiteSpaces) { 16512 return node.text !== text || node.containsOnlyTriviaWhiteSpaces !== containsOnlyTriviaWhiteSpaces ? update(createJsxText(text, containsOnlyTriviaWhiteSpaces), node) : node; 16513 } 16514 function createJsxOpeningFragment() { 16515 const node = createBaseNode(292 /* JsxOpeningFragment */); 16516 node.transformFlags |= 2 /* ContainsJsx */; 16517 return node; 16518 } 16519 function createJsxJsxClosingFragment() { 16520 const node = createBaseNode(293 /* JsxClosingFragment */); 16521 node.transformFlags |= 2 /* ContainsJsx */; 16522 return node; 16523 } 16524 function createJsxAttribute(name, initializer) { 16525 const node = createBaseNode(294 /* JsxAttribute */); 16526 node.name = name; 16527 node.initializer = initializer; 16528 node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 2 /* ContainsJsx */; 16529 return node; 16530 } 16531 function updateJsxAttribute(node, name, initializer) { 16532 return node.name !== name || node.initializer !== initializer ? update(createJsxAttribute(name, initializer), node) : node; 16533 } 16534 function createJsxAttributes(properties) { 16535 const node = createBaseNode(295 /* JsxAttributes */); 16536 node.properties = createNodeArray(properties); 16537 node.transformFlags |= propagateChildrenFlags(node.properties) | 2 /* ContainsJsx */; 16538 return node; 16539 } 16540 function updateJsxAttributes(node, properties) { 16541 return node.properties !== properties ? update(createJsxAttributes(properties), node) : node; 16542 } 16543 function createJsxSpreadAttribute(expression) { 16544 const node = createBaseNode(296 /* JsxSpreadAttribute */); 16545 node.expression = expression; 16546 node.transformFlags |= propagateChildFlags(node.expression) | 2 /* ContainsJsx */; 16547 return node; 16548 } 16549 function updateJsxSpreadAttribute(node, expression) { 16550 return node.expression !== expression ? update(createJsxSpreadAttribute(expression), node) : node; 16551 } 16552 function createJsxExpression(dotDotDotToken, expression) { 16553 const node = createBaseNode(297 /* JsxExpression */); 16554 node.dotDotDotToken = dotDotDotToken; 16555 node.expression = expression; 16556 node.transformFlags |= propagateChildFlags(node.dotDotDotToken) | propagateChildFlags(node.expression) | 2 /* ContainsJsx */; 16557 return node; 16558 } 16559 function updateJsxExpression(node, expression) { 16560 return node.expression !== expression ? update(createJsxExpression(node.dotDotDotToken, expression), node) : node; 16561 } 16562 function createCaseClause(expression, statements) { 16563 const node = createBaseNode(298 /* CaseClause */); 16564 node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); 16565 node.statements = createNodeArray(statements); 16566 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements); 16567 return node; 16568 } 16569 function updateCaseClause(node, expression, statements) { 16570 return node.expression !== expression || node.statements !== statements ? update(createCaseClause(expression, statements), node) : node; 16571 } 16572 function createDefaultClause(statements) { 16573 const node = createBaseNode(299 /* DefaultClause */); 16574 node.statements = createNodeArray(statements); 16575 node.transformFlags = propagateChildrenFlags(node.statements); 16576 return node; 16577 } 16578 function updateDefaultClause(node, statements) { 16579 return node.statements !== statements ? update(createDefaultClause(statements), node) : node; 16580 } 16581 function createHeritageClause(token, types) { 16582 const node = createBaseNode(300 /* HeritageClause */); 16583 node.token = token; 16584 node.types = createNodeArray(types); 16585 node.transformFlags |= propagateChildrenFlags(node.types); 16586 switch (token) { 16587 case 95 /* ExtendsKeyword */: 16588 node.transformFlags |= 1024 /* ContainsES2015 */; 16589 break; 16590 case 118 /* ImplementsKeyword */: 16591 node.transformFlags |= 1 /* ContainsTypeScript */; 16592 break; 16593 default: 16594 return Debug.assertNever(token); 16595 } 16596 return node; 16597 } 16598 function updateHeritageClause(node, types) { 16599 return node.types !== types ? update(createHeritageClause(node.token, types), node) : node; 16600 } 16601 function createCatchClause(variableDeclaration, block) { 16602 const node = createBaseNode(301 /* CatchClause */); 16603 if (typeof variableDeclaration === "string" || variableDeclaration && !isVariableDeclaration(variableDeclaration)) { 16604 variableDeclaration = createVariableDeclaration( 16605 variableDeclaration, 16606 void 0, 16607 void 0, 16608 void 0 16609 ); 16610 } 16611 node.variableDeclaration = variableDeclaration; 16612 node.block = block; 16613 node.transformFlags |= propagateChildFlags(node.variableDeclaration) | propagateChildFlags(node.block); 16614 if (!variableDeclaration) 16615 node.transformFlags |= 64 /* ContainsES2019 */; 16616 return node; 16617 } 16618 function updateCatchClause(node, variableDeclaration, block) { 16619 return node.variableDeclaration !== variableDeclaration || node.block !== block ? update(createCatchClause(variableDeclaration, block), node) : node; 16620 } 16621 function createPropertyAssignment(name, initializer) { 16622 const node = createBaseNamedDeclaration( 16623 305 /* PropertyAssignment */, 16624 void 0, 16625 name 16626 ); 16627 node.initializer = parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); 16628 node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer); 16629 node.illegalDecorators = void 0; 16630 node.modifiers = void 0; 16631 node.questionToken = void 0; 16632 node.exclamationToken = void 0; 16633 return node; 16634 } 16635 function updatePropertyAssignment(node, name, initializer) { 16636 return node.name !== name || node.initializer !== initializer ? finishUpdatePropertyAssignment(createPropertyAssignment(name, initializer), node) : node; 16637 } 16638 function finishUpdatePropertyAssignment(updated, original) { 16639 if (updated !== original) { 16640 updated.illegalDecorators = original.illegalDecorators; 16641 updated.modifiers = original.modifiers; 16642 updated.questionToken = original.questionToken; 16643 updated.exclamationToken = original.exclamationToken; 16644 } 16645 return update(updated, original); 16646 } 16647 function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { 16648 const node = createBaseNamedDeclaration( 16649 306 /* ShorthandPropertyAssignment */, 16650 void 0, 16651 name 16652 ); 16653 node.objectAssignmentInitializer = objectAssignmentInitializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(objectAssignmentInitializer); 16654 node.transformFlags |= propagateChildFlags(node.objectAssignmentInitializer) | 1024 /* ContainsES2015 */; 16655 node.equalsToken = void 0; 16656 node.illegalDecorators = void 0; 16657 node.modifiers = void 0; 16658 node.questionToken = void 0; 16659 node.exclamationToken = void 0; 16660 return node; 16661 } 16662 function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) { 16663 return node.name !== name || node.objectAssignmentInitializer !== objectAssignmentInitializer ? finishUpdateShorthandPropertyAssignment(createShorthandPropertyAssignment(name, objectAssignmentInitializer), node) : node; 16664 } 16665 function finishUpdateShorthandPropertyAssignment(updated, original) { 16666 if (updated !== original) { 16667 updated.equalsToken = original.equalsToken; 16668 updated.illegalDecorators = original.illegalDecorators; 16669 updated.modifiers = original.modifiers; 16670 updated.questionToken = original.questionToken; 16671 updated.exclamationToken = original.exclamationToken; 16672 } 16673 return update(updated, original); 16674 } 16675 function createSpreadAssignment(expression) { 16676 const node = createBaseNode(307 /* SpreadAssignment */); 16677 node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression); 16678 node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */; 16679 return node; 16680 } 16681 function updateSpreadAssignment(node, expression) { 16682 return node.expression !== expression ? update(createSpreadAssignment(expression), node) : node; 16683 } 16684 function createEnumMember(name, initializer) { 16685 const node = createBaseNode(308 /* EnumMember */); 16686 node.name = asName(name); 16687 node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer); 16688 node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */; 16689 return node; 16690 } 16691 function updateEnumMember(node, name, initializer) { 16692 return node.name !== name || node.initializer !== initializer ? update(createEnumMember(name, initializer), node) : node; 16693 } 16694 function createSourceFile2(statements, endOfFileToken, flags2) { 16695 const node = baseFactory2.createBaseSourceFileNode(314 /* SourceFile */); 16696 node.statements = createNodeArray(statements); 16697 node.endOfFileToken = endOfFileToken; 16698 node.flags |= flags2; 16699 node.fileName = ""; 16700 node.text = ""; 16701 node.languageVersion = 0; 16702 node.languageVariant = 0; 16703 node.scriptKind = 0; 16704 node.isDeclarationFile = false; 16705 node.hasNoDefaultLib = false; 16706 node.transformFlags |= propagateChildrenFlags(node.statements) | propagateChildFlags(node.endOfFileToken); 16707 return node; 16708 } 16709 function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) { 16710 const node = source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory2.createBaseSourceFileNode(314 /* SourceFile */); 16711 for (const p in source) { 16712 if (p === "emitNode" || hasProperty(node, p) || !hasProperty(source, p)) 16713 continue; 16714 node[p] = source[p]; 16715 } 16716 node.flags |= source.flags; 16717 node.statements = createNodeArray(statements); 16718 node.endOfFileToken = source.endOfFileToken; 16719 node.isDeclarationFile = isDeclarationFile; 16720 node.referencedFiles = referencedFiles; 16721 node.typeReferenceDirectives = typeReferences; 16722 node.hasNoDefaultLib = hasNoDefaultLib; 16723 node.libReferenceDirectives = libReferences; 16724 node.transformFlags = propagateChildrenFlags(node.statements) | propagateChildFlags(node.endOfFileToken); 16725 node.impliedNodeFormat = source.impliedNodeFormat; 16726 return node; 16727 } 16728 function updateSourceFile(node, statements, isDeclarationFile = node.isDeclarationFile, referencedFiles = node.referencedFiles, typeReferenceDirectives = node.typeReferenceDirectives, hasNoDefaultLib = node.hasNoDefaultLib, libReferenceDirectives = node.libReferenceDirectives) { 16729 return node.statements !== statements || node.isDeclarationFile !== isDeclarationFile || node.referencedFiles !== referencedFiles || node.typeReferenceDirectives !== typeReferenceDirectives || node.hasNoDefaultLib !== hasNoDefaultLib || node.libReferenceDirectives !== libReferenceDirectives ? update(cloneSourceFileWithChanges(node, statements, isDeclarationFile, referencedFiles, typeReferenceDirectives, hasNoDefaultLib, libReferenceDirectives), node) : node; 16730 } 16731 function createBundle(sourceFiles, prepends = emptyArray) { 16732 const node = createBaseNode(315 /* Bundle */); 16733 node.prepends = prepends; 16734 node.sourceFiles = sourceFiles; 16735 return node; 16736 } 16737 function updateBundle(node, sourceFiles, prepends = emptyArray) { 16738 return node.sourceFiles !== sourceFiles || node.prepends !== prepends ? update(createBundle(sourceFiles, prepends), node) : node; 16739 } 16740 function createUnparsedSource(prologues, syntheticReferences, texts) { 16741 const node = createBaseNode(316 /* UnparsedSource */); 16742 node.prologues = prologues; 16743 node.syntheticReferences = syntheticReferences; 16744 node.texts = texts; 16745 node.fileName = ""; 16746 node.text = ""; 16747 node.referencedFiles = emptyArray; 16748 node.libReferenceDirectives = emptyArray; 16749 node.getLineAndCharacterOfPosition = (pos) => getLineAndCharacterOfPosition(node, pos); 16750 return node; 16751 } 16752 function createBaseUnparsedNode(kind, data) { 16753 const node = createBaseNode(kind); 16754 node.data = data; 16755 return node; 16756 } 16757 function createUnparsedPrologue(data) { 16758 return createBaseUnparsedNode(309 /* UnparsedPrologue */, data); 16759 } 16760 function createUnparsedPrepend(data, texts) { 16761 const node = createBaseUnparsedNode(310 /* UnparsedPrepend */, data); 16762 node.texts = texts; 16763 return node; 16764 } 16765 function createUnparsedTextLike(data, internal) { 16766 return createBaseUnparsedNode(internal ? 312 /* UnparsedInternalText */ : 311 /* UnparsedText */, data); 16767 } 16768 function createUnparsedSyntheticReference(section) { 16769 const node = createBaseNode(313 /* UnparsedSyntheticReference */); 16770 node.data = section.data; 16771 node.section = section; 16772 return node; 16773 } 16774 function createInputFiles2() { 16775 const node = createBaseNode(317 /* InputFiles */); 16776 node.javascriptText = ""; 16777 node.declarationText = ""; 16778 return node; 16779 } 16780 function createSyntheticExpression(type, isSpread = false, tupleNameSource) { 16781 const node = createBaseNode(238 /* SyntheticExpression */); 16782 node.type = type; 16783 node.isSpread = isSpread; 16784 node.tupleNameSource = tupleNameSource; 16785 return node; 16786 } 16787 function createSyntaxList(children) { 16788 const node = createBaseNode(357 /* SyntaxList */); 16789 node._children = children; 16790 return node; 16791 } 16792 function createNotEmittedStatement(original) { 16793 const node = createBaseNode(358 /* NotEmittedStatement */); 16794 node.original = original; 16795 setTextRange(node, original); 16796 return node; 16797 } 16798 function createPartiallyEmittedExpression(expression, original) { 16799 const node = createBaseNode(359 /* PartiallyEmittedExpression */); 16800 node.expression = expression; 16801 node.original = original; 16802 node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */; 16803 setTextRange(node, original); 16804 return node; 16805 } 16806 function updatePartiallyEmittedExpression(node, expression) { 16807 return node.expression !== expression ? update(createPartiallyEmittedExpression(expression, node.original), node) : node; 16808 } 16809 function flattenCommaElements(node) { 16810 if (nodeIsSynthesized(node) && !isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { 16811 if (isCommaListExpression(node)) { 16812 return node.elements; 16813 } 16814 if (isBinaryExpression(node) && isCommaToken(node.operatorToken)) { 16815 return [node.left, node.right]; 16816 } 16817 } 16818 return node; 16819 } 16820 function createCommaListExpression(elements) { 16821 const node = createBaseNode(360 /* CommaListExpression */); 16822 node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements)); 16823 node.transformFlags |= propagateChildrenFlags(node.elements); 16824 return node; 16825 } 16826 function updateCommaListExpression(node, elements) { 16827 return node.elements !== elements ? update(createCommaListExpression(elements), node) : node; 16828 } 16829 function createEndOfDeclarationMarker(original) { 16830 const node = createBaseNode(362 /* EndOfDeclarationMarker */); 16831 node.emitNode = {}; 16832 node.original = original; 16833 return node; 16834 } 16835 function createMergeDeclarationMarker(original) { 16836 const node = createBaseNode(361 /* MergeDeclarationMarker */); 16837 node.emitNode = {}; 16838 node.original = original; 16839 return node; 16840 } 16841 function createSyntheticReferenceExpression(expression, thisArg) { 16842 const node = createBaseNode(363 /* SyntheticReferenceExpression */); 16843 node.expression = expression; 16844 node.thisArg = thisArg; 16845 node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg); 16846 return node; 16847 } 16848 function updateSyntheticReferenceExpression(node, expression, thisArg) { 16849 return node.expression !== expression || node.thisArg !== thisArg ? update(createSyntheticReferenceExpression(expression, thisArg), node) : node; 16850 } 16851 function cloneNode(node) { 16852 if (node === void 0) { 16853 return node; 16854 } 16855 const clone2 = isSourceFile(node) ? baseFactory2.createBaseSourceFileNode(314 /* SourceFile */) : isIdentifier(node) ? baseFactory2.createBaseIdentifierNode(79 /* Identifier */) : isPrivateIdentifier(node) ? baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */) : !isNodeKind(node.kind) ? baseFactory2.createBaseTokenNode(node.kind) : baseFactory2.createBaseNode(node.kind); 16856 clone2.flags |= node.flags & ~8 /* Synthesized */; 16857 clone2.transformFlags = node.transformFlags; 16858 setOriginalNode(clone2, node); 16859 for (const key in node) { 16860 if (hasProperty(clone2, key) || !hasProperty(node, key)) { 16861 continue; 16862 } 16863 clone2[key] = node[key]; 16864 } 16865 return clone2; 16866 } 16867 function createImmediatelyInvokedFunctionExpression(statements, param, paramValue) { 16868 return createCallExpression( 16869 createFunctionExpression( 16870 void 0, 16871 void 0, 16872 void 0, 16873 void 0, 16874 param ? [param] : [], 16875 void 0, 16876 createBlock(statements, true) 16877 ), 16878 void 0, 16879 paramValue ? [paramValue] : [] 16880 ); 16881 } 16882 function createImmediatelyInvokedArrowFunction(statements, param, paramValue) { 16883 return createCallExpression( 16884 createArrowFunction( 16885 void 0, 16886 void 0, 16887 param ? [param] : [], 16888 void 0, 16889 void 0, 16890 createBlock(statements, true) 16891 ), 16892 void 0, 16893 paramValue ? [paramValue] : [] 16894 ); 16895 } 16896 function createVoidZero() { 16897 return createVoidExpression(createNumericLiteral("0")); 16898 } 16899 function createExportDefault(expression) { 16900 return createExportAssignment( 16901 void 0, 16902 false, 16903 expression 16904 ); 16905 } 16906 function createExternalModuleExport(exportName) { 16907 return createExportDeclaration( 16908 void 0, 16909 false, 16910 createNamedExports([ 16911 createExportSpecifier(false, void 0, exportName) 16912 ]) 16913 ); 16914 } 16915 function createTypeCheck(value, tag) { 16916 return tag === "undefined" ? factory2.createStrictEquality(value, createVoidZero()) : factory2.createStrictEquality(createTypeOfExpression(value), createStringLiteral(tag)); 16917 } 16918 function createMethodCall(object, methodName, argumentsList) { 16919 if (isCallChain(object)) { 16920 return createCallChain( 16921 createPropertyAccessChain(object, void 0, methodName), 16922 void 0, 16923 void 0, 16924 argumentsList 16925 ); 16926 } 16927 return createCallExpression( 16928 createPropertyAccessExpression(object, methodName), 16929 void 0, 16930 argumentsList 16931 ); 16932 } 16933 function createFunctionBindCall(target, thisArg, argumentsList) { 16934 return createMethodCall(target, "bind", [thisArg, ...argumentsList]); 16935 } 16936 function createFunctionCallCall(target, thisArg, argumentsList) { 16937 return createMethodCall(target, "call", [thisArg, ...argumentsList]); 16938 } 16939 function createFunctionApplyCall(target, thisArg, argumentsExpression) { 16940 return createMethodCall(target, "apply", [thisArg, argumentsExpression]); 16941 } 16942 function createGlobalMethodCall(globalObjectName, methodName, argumentsList) { 16943 return createMethodCall(createIdentifier(globalObjectName), methodName, argumentsList); 16944 } 16945 function createArraySliceCall(array, start) { 16946 return createMethodCall(array, "slice", start === void 0 ? [] : [asExpression(start)]); 16947 } 16948 function createArrayConcatCall(array, argumentsList) { 16949 return createMethodCall(array, "concat", argumentsList); 16950 } 16951 function createObjectDefinePropertyCall(target, propertyName, attributes) { 16952 return createGlobalMethodCall("Object", "defineProperty", [target, asExpression(propertyName), attributes]); 16953 } 16954 function createReflectGetCall(target, propertyKey, receiver) { 16955 return createGlobalMethodCall("Reflect", "get", receiver ? [target, propertyKey, receiver] : [target, propertyKey]); 16956 } 16957 function createReflectSetCall(target, propertyKey, value, receiver) { 16958 return createGlobalMethodCall("Reflect", "set", receiver ? [target, propertyKey, value, receiver] : [target, propertyKey, value]); 16959 } 16960 function tryAddPropertyAssignment(properties, propertyName, expression) { 16961 if (expression) { 16962 properties.push(createPropertyAssignment(propertyName, expression)); 16963 return true; 16964 } 16965 return false; 16966 } 16967 function createPropertyDescriptor(attributes, singleLine) { 16968 const properties = []; 16969 tryAddPropertyAssignment(properties, "enumerable", asExpression(attributes.enumerable)); 16970 tryAddPropertyAssignment(properties, "configurable", asExpression(attributes.configurable)); 16971 let isData = tryAddPropertyAssignment(properties, "writable", asExpression(attributes.writable)); 16972 isData = tryAddPropertyAssignment(properties, "value", attributes.value) || isData; 16973 let isAccessor2 = tryAddPropertyAssignment(properties, "get", attributes.get); 16974 isAccessor2 = tryAddPropertyAssignment(properties, "set", attributes.set) || isAccessor2; 16975 Debug.assert(!(isData && isAccessor2), "A PropertyDescriptor may not be both an accessor descriptor and a data descriptor."); 16976 return createObjectLiteralExpression(properties, !singleLine); 16977 } 16978 function updateOuterExpression(outerExpression, expression) { 16979 switch (outerExpression.kind) { 16980 case 217 /* ParenthesizedExpression */: 16981 return updateParenthesizedExpression(outerExpression, expression); 16982 case 216 /* TypeAssertionExpression */: 16983 return updateTypeAssertion(outerExpression, outerExpression.type, expression); 16984 case 235 /* AsExpression */: 16985 return updateAsExpression(outerExpression, expression, outerExpression.type); 16986 case 239 /* SatisfiesExpression */: 16987 return updateSatisfiesExpression(outerExpression, expression, outerExpression.type); 16988 case 236 /* NonNullExpression */: 16989 return updateNonNullExpression(outerExpression, expression); 16990 case 359 /* PartiallyEmittedExpression */: 16991 return updatePartiallyEmittedExpression(outerExpression, expression); 16992 } 16993 } 16994 function isIgnorableParen(node) { 16995 return isParenthesizedExpression(node) && nodeIsSynthesized(node) && nodeIsSynthesized(getSourceMapRange(node)) && nodeIsSynthesized(getCommentRange(node)) && !some(getSyntheticLeadingComments(node)) && !some(getSyntheticTrailingComments(node)); 16996 } 16997 function restoreOuterExpressions(outerExpression, innerExpression, kinds = 15 /* All */) { 16998 if (outerExpression && isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) { 16999 return updateOuterExpression( 17000 outerExpression, 17001 restoreOuterExpressions(outerExpression.expression, innerExpression) 17002 ); 17003 } 17004 return innerExpression; 17005 } 17006 function restoreEnclosingLabel(node, outermostLabeledStatement, afterRestoreLabelCallback) { 17007 if (!outermostLabeledStatement) { 17008 return node; 17009 } 17010 const updated = updateLabeledStatement( 17011 outermostLabeledStatement, 17012 outermostLabeledStatement.label, 17013 isLabeledStatement(outermostLabeledStatement.statement) ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node 17014 ); 17015 if (afterRestoreLabelCallback) { 17016 afterRestoreLabelCallback(outermostLabeledStatement); 17017 } 17018 return updated; 17019 } 17020 function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { 17021 const target = skipParentheses(node); 17022 switch (target.kind) { 17023 case 79 /* Identifier */: 17024 return cacheIdentifiers; 17025 case 109 /* ThisKeyword */: 17026 case 8 /* NumericLiteral */: 17027 case 9 /* BigIntLiteral */: 17028 case 10 /* StringLiteral */: 17029 return false; 17030 case 209 /* ArrayLiteralExpression */: 17031 const elements = target.elements; 17032 if (elements.length === 0) { 17033 return false; 17034 } 17035 return true; 17036 case 210 /* ObjectLiteralExpression */: 17037 return target.properties.length > 0; 17038 default: 17039 return true; 17040 } 17041 } 17042 function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers = false) { 17043 const callee = skipOuterExpressions(expression, 15 /* All */); 17044 let thisArg; 17045 let target; 17046 if (isSuperProperty(callee)) { 17047 thisArg = createThis(); 17048 target = callee; 17049 } else if (isSuperKeyword(callee)) { 17050 thisArg = createThis(); 17051 target = languageVersion !== void 0 && languageVersion < 2 /* ES2015 */ ? setTextRange(createIdentifier("_super"), callee) : callee; 17052 } else if (getEmitFlags(callee) & 4096 /* HelperName */) { 17053 thisArg = createVoidZero(); 17054 target = parenthesizerRules().parenthesizeLeftSideOfAccess(callee, false); 17055 } else if (isPropertyAccessExpression(callee)) { 17056 if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { 17057 thisArg = createTempVariable(recordTempVariable); 17058 target = createPropertyAccessExpression( 17059 setTextRange( 17060 factory2.createAssignment( 17061 thisArg, 17062 callee.expression 17063 ), 17064 callee.expression 17065 ), 17066 callee.name 17067 ); 17068 setTextRange(target, callee); 17069 } else { 17070 thisArg = callee.expression; 17071 target = callee; 17072 } 17073 } else if (isElementAccessExpression(callee)) { 17074 if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { 17075 thisArg = createTempVariable(recordTempVariable); 17076 target = createElementAccessExpression( 17077 setTextRange( 17078 factory2.createAssignment( 17079 thisArg, 17080 callee.expression 17081 ), 17082 callee.expression 17083 ), 17084 callee.argumentExpression 17085 ); 17086 setTextRange(target, callee); 17087 } else { 17088 thisArg = callee.expression; 17089 target = callee; 17090 } 17091 } else { 17092 thisArg = createVoidZero(); 17093 target = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, false); 17094 } 17095 return { target, thisArg }; 17096 } 17097 function createAssignmentTargetWrapper(paramName, expression) { 17098 return createPropertyAccessExpression( 17099 createParenthesizedExpression( 17100 createObjectLiteralExpression([ 17101 createSetAccessorDeclaration( 17102 void 0, 17103 "value", 17104 [createParameterDeclaration( 17105 void 0, 17106 void 0, 17107 paramName, 17108 void 0, 17109 void 0, 17110 void 0 17111 )], 17112 createBlock([ 17113 createExpressionStatement(expression) 17114 ]) 17115 ) 17116 ]) 17117 ), 17118 "value" 17119 ); 17120 } 17121 function inlineExpressions(expressions) { 17122 return expressions.length > 10 ? createCommaListExpression(expressions) : reduceLeft(expressions, factory2.createComma); 17123 } 17124 function getName(node, allowComments, allowSourceMaps, emitFlags = 0) { 17125 const nodeName = getNameOfDeclaration(node); 17126 if (nodeName && isIdentifier(nodeName) && !isGeneratedIdentifier(nodeName)) { 17127 const name = setParent(setTextRange(cloneNode(nodeName), nodeName), nodeName.parent); 17128 emitFlags |= getEmitFlags(nodeName); 17129 if (!allowSourceMaps) 17130 emitFlags |= 48 /* NoSourceMap */; 17131 if (!allowComments) 17132 emitFlags |= 1536 /* NoComments */; 17133 if (emitFlags) 17134 setEmitFlags(name, emitFlags); 17135 return name; 17136 } 17137 return getGeneratedNameForNode(node); 17138 } 17139 function getInternalName(node, allowComments, allowSourceMaps) { 17140 return getName(node, allowComments, allowSourceMaps, 16384 /* LocalName */ | 32768 /* InternalName */); 17141 } 17142 function getLocalName(node, allowComments, allowSourceMaps) { 17143 return getName(node, allowComments, allowSourceMaps, 16384 /* LocalName */); 17144 } 17145 function getExportName(node, allowComments, allowSourceMaps) { 17146 return getName(node, allowComments, allowSourceMaps, 8192 /* ExportName */); 17147 } 17148 function getDeclarationName(node, allowComments, allowSourceMaps) { 17149 return getName(node, allowComments, allowSourceMaps); 17150 } 17151 function getNamespaceMemberName(ns, name, allowComments, allowSourceMaps) { 17152 const qualifiedName = createPropertyAccessExpression(ns, nodeIsSynthesized(name) ? name : cloneNode(name)); 17153 setTextRange(qualifiedName, name); 17154 let emitFlags = 0; 17155 if (!allowSourceMaps) 17156 emitFlags |= 48 /* NoSourceMap */; 17157 if (!allowComments) 17158 emitFlags |= 1536 /* NoComments */; 17159 if (emitFlags) 17160 setEmitFlags(qualifiedName, emitFlags); 17161 return qualifiedName; 17162 } 17163 function getExternalModuleOrNamespaceExportName(ns, node, allowComments, allowSourceMaps) { 17164 if (ns && hasSyntacticModifier(node, 1 /* Export */)) { 17165 return getNamespaceMemberName(ns, getName(node), allowComments, allowSourceMaps); 17166 } 17167 return getExportName(node, allowComments, allowSourceMaps); 17168 } 17169 function copyPrologue(source, target, ensureUseStrict2, visitor) { 17170 const offset = copyStandardPrologue(source, target, 0, ensureUseStrict2); 17171 return copyCustomPrologue(source, target, offset, visitor); 17172 } 17173 function isUseStrictPrologue2(node) { 17174 return isStringLiteral(node.expression) && node.expression.text === "use strict"; 17175 } 17176 function createUseStrictPrologue() { 17177 return startOnNewLine(createExpressionStatement(createStringLiteral("use strict"))); 17178 } 17179 function copyStandardPrologue(source, target, statementOffset = 0, ensureUseStrict2) { 17180 Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array"); 17181 let foundUseStrict = false; 17182 const numStatements = source.length; 17183 while (statementOffset < numStatements) { 17184 const statement = source[statementOffset]; 17185 if (isPrologueDirective(statement)) { 17186 if (isUseStrictPrologue2(statement)) { 17187 foundUseStrict = true; 17188 } 17189 target.push(statement); 17190 } else { 17191 break; 17192 } 17193 statementOffset++; 17194 } 17195 if (ensureUseStrict2 && !foundUseStrict) { 17196 target.push(createUseStrictPrologue()); 17197 } 17198 return statementOffset; 17199 } 17200 function copyCustomPrologue(source, target, statementOffset, visitor, filter2 = returnTrue) { 17201 const numStatements = source.length; 17202 while (statementOffset !== void 0 && statementOffset < numStatements) { 17203 const statement = source[statementOffset]; 17204 if (getEmitFlags(statement) & 1048576 /* CustomPrologue */ && filter2(statement)) { 17205 append(target, visitor ? visitNode(statement, visitor, isStatement) : statement); 17206 } else { 17207 break; 17208 } 17209 statementOffset++; 17210 } 17211 return statementOffset; 17212 } 17213 function ensureUseStrict(statements) { 17214 const foundUseStrict = findUseStrictPrologue(statements); 17215 if (!foundUseStrict) { 17216 return setTextRange(createNodeArray([createUseStrictPrologue(), ...statements]), statements); 17217 } 17218 return statements; 17219 } 17220 function liftToBlock(nodes) { 17221 Debug.assert(every(nodes, isStatementOrBlock), "Cannot lift nodes to a Block."); 17222 return singleOrUndefined(nodes) || createBlock(nodes); 17223 } 17224 function findSpanEnd(array, test, start) { 17225 let i = start; 17226 while (i < array.length && test(array[i])) { 17227 i++; 17228 } 17229 return i; 17230 } 17231 function mergeLexicalEnvironment(statements, declarations) { 17232 if (!some(declarations)) { 17233 return statements; 17234 } 17235 const leftStandardPrologueEnd = findSpanEnd(statements, isPrologueDirective, 0); 17236 const leftHoistedFunctionsEnd = findSpanEnd(statements, isHoistedFunction, leftStandardPrologueEnd); 17237 const leftHoistedVariablesEnd = findSpanEnd(statements, isHoistedVariableStatement, leftHoistedFunctionsEnd); 17238 const rightStandardPrologueEnd = findSpanEnd(declarations, isPrologueDirective, 0); 17239 const rightHoistedFunctionsEnd = findSpanEnd(declarations, isHoistedFunction, rightStandardPrologueEnd); 17240 const rightHoistedVariablesEnd = findSpanEnd(declarations, isHoistedVariableStatement, rightHoistedFunctionsEnd); 17241 const rightCustomPrologueEnd = findSpanEnd(declarations, isCustomPrologue, rightHoistedVariablesEnd); 17242 Debug.assert(rightCustomPrologueEnd === declarations.length, "Expected declarations to be valid standard or custom prologues"); 17243 const left = isNodeArray(statements) ? statements.slice() : statements; 17244 if (rightCustomPrologueEnd > rightHoistedVariablesEnd) { 17245 left.splice(leftHoistedVariablesEnd, 0, ...declarations.slice(rightHoistedVariablesEnd, rightCustomPrologueEnd)); 17246 } 17247 if (rightHoistedVariablesEnd > rightHoistedFunctionsEnd) { 17248 left.splice(leftHoistedFunctionsEnd, 0, ...declarations.slice(rightHoistedFunctionsEnd, rightHoistedVariablesEnd)); 17249 } 17250 if (rightHoistedFunctionsEnd > rightStandardPrologueEnd) { 17251 left.splice(leftStandardPrologueEnd, 0, ...declarations.slice(rightStandardPrologueEnd, rightHoistedFunctionsEnd)); 17252 } 17253 if (rightStandardPrologueEnd > 0) { 17254 if (leftStandardPrologueEnd === 0) { 17255 left.splice(0, 0, ...declarations.slice(0, rightStandardPrologueEnd)); 17256 } else { 17257 const leftPrologues = new Map2(); 17258 for (let i = 0; i < leftStandardPrologueEnd; i++) { 17259 const leftPrologue = statements[i]; 17260 leftPrologues.set(leftPrologue.expression.text, true); 17261 } 17262 for (let i = rightStandardPrologueEnd - 1; i >= 0; i--) { 17263 const rightPrologue = declarations[i]; 17264 if (!leftPrologues.has(rightPrologue.expression.text)) { 17265 left.unshift(rightPrologue); 17266 } 17267 } 17268 } 17269 } 17270 if (isNodeArray(statements)) { 17271 return setTextRange(createNodeArray(left, statements.hasTrailingComma), statements); 17272 } 17273 return statements; 17274 } 17275 function updateModifiers(node, modifiers) { 17276 var _a2; 17277 let modifierArray; 17278 if (typeof modifiers === "number") { 17279 modifierArray = createModifiersFromModifierFlags(modifiers); 17280 } else { 17281 modifierArray = modifiers; 17282 } 17283 return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, (_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isStructDeclaration(node) ? updateStructDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isAnnotationDeclaration(node) ? updateAnnotationDeclaration(node, modifierArray, node.name, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node); 17284 } 17285 function asNodeArray(array) { 17286 return array ? createNodeArray(array) : void 0; 17287 } 17288 function asName(name) { 17289 return typeof name === "string" ? createIdentifier(name) : name; 17290 } 17291 function asExpression(value) { 17292 return typeof value === "string" ? createStringLiteral(value) : typeof value === "number" ? createNumericLiteral(value) : typeof value === "boolean" ? value ? createTrue() : createFalse() : value; 17293 } 17294 function asToken(value) { 17295 return typeof value === "number" ? createToken(value) : value; 17296 } 17297 function asEmbeddedStatement(statement) { 17298 return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginalNode(createEmptyStatement(), statement), statement) : statement; 17299 } 17300} 17301function updateWithoutOriginal(updated, original) { 17302 if (updated !== original) { 17303 setTextRange(updated, original); 17304 } 17305 return updated; 17306} 17307function updateWithOriginal(updated, original) { 17308 if (updated !== original) { 17309 setOriginalNode(updated, original); 17310 setTextRange(updated, original); 17311 } 17312 return updated; 17313} 17314function getDefaultTagNameForKind(kind) { 17315 switch (kind) { 17316 case 352 /* JSDocTypeTag */: 17317 return "type"; 17318 case 350 /* JSDocReturnTag */: 17319 return "returns"; 17320 case 351 /* JSDocThisTag */: 17321 return "this"; 17322 case 348 /* JSDocEnumTag */: 17323 return "enum"; 17324 case 339 /* JSDocAuthorTag */: 17325 return "author"; 17326 case 341 /* JSDocClassTag */: 17327 return "class"; 17328 case 342 /* JSDocPublicTag */: 17329 return "public"; 17330 case 343 /* JSDocPrivateTag */: 17331 return "private"; 17332 case 344 /* JSDocProtectedTag */: 17333 return "protected"; 17334 case 345 /* JSDocReadonlyTag */: 17335 return "readonly"; 17336 case 346 /* JSDocOverrideTag */: 17337 return "override"; 17338 case 353 /* JSDocTemplateTag */: 17339 return "template"; 17340 case 354 /* JSDocTypedefTag */: 17341 return "typedef"; 17342 case 349 /* JSDocParameterTag */: 17343 return "param"; 17344 case 356 /* JSDocPropertyTag */: 17345 return "prop"; 17346 case 347 /* JSDocCallbackTag */: 17347 return "callback"; 17348 case 337 /* JSDocAugmentsTag */: 17349 return "augments"; 17350 case 338 /* JSDocImplementsTag */: 17351 return "implements"; 17352 default: 17353 return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`); 17354 } 17355} 17356var rawTextScanner; 17357var invalidValueSentinel = {}; 17358function getCookedText(kind, rawText) { 17359 if (!rawTextScanner) { 17360 rawTextScanner = createScanner(99 /* Latest */, false, 0 /* Standard */); 17361 } 17362 switch (kind) { 17363 case 14 /* NoSubstitutionTemplateLiteral */: 17364 rawTextScanner.setText("`" + rawText + "`"); 17365 break; 17366 case 15 /* TemplateHead */: 17367 rawTextScanner.setText("`" + rawText + "${"); 17368 break; 17369 case 16 /* TemplateMiddle */: 17370 rawTextScanner.setText("}" + rawText + "${"); 17371 break; 17372 case 17 /* TemplateTail */: 17373 rawTextScanner.setText("}" + rawText + "`"); 17374 break; 17375 } 17376 let token = rawTextScanner.scan(); 17377 if (token === 19 /* CloseBraceToken */) { 17378 token = rawTextScanner.reScanTemplateToken(false); 17379 } 17380 if (rawTextScanner.isUnterminated()) { 17381 rawTextScanner.setText(void 0); 17382 return invalidValueSentinel; 17383 } 17384 let tokenValue; 17385 switch (token) { 17386 case 14 /* NoSubstitutionTemplateLiteral */: 17387 case 15 /* TemplateHead */: 17388 case 16 /* TemplateMiddle */: 17389 case 17 /* TemplateTail */: 17390 tokenValue = rawTextScanner.getTokenValue(); 17391 break; 17392 } 17393 if (tokenValue === void 0 || rawTextScanner.scan() !== 1 /* EndOfFileToken */) { 17394 rawTextScanner.setText(void 0); 17395 return invalidValueSentinel; 17396 } 17397 rawTextScanner.setText(void 0); 17398 return tokenValue; 17399} 17400function propagateIdentifierNameFlags(node) { 17401 return propagateChildFlags(node) & ~67108864 /* ContainsPossibleTopLevelAwait */; 17402} 17403function propagatePropertyNameFlagsOfChild(node, transformFlags) { 17404 return transformFlags | node.transformFlags & 134234112 /* PropertyNamePropagatingFlags */; 17405} 17406function propagateChildFlags(child) { 17407 if (!child) 17408 return 0 /* None */; 17409 const childFlags = child.transformFlags & ~getTransformFlagsSubtreeExclusions(child.kind); 17410 return isNamedDeclaration(child) && isPropertyName(child.name) ? propagatePropertyNameFlagsOfChild(child.name, childFlags) : childFlags; 17411} 17412function propagateChildrenFlags(children) { 17413 return children ? children.transformFlags : 0 /* None */; 17414} 17415function aggregateChildrenFlags(children) { 17416 let subtreeFlags = 0 /* None */; 17417 for (const child of children) { 17418 subtreeFlags |= propagateChildFlags(child); 17419 } 17420 children.transformFlags = subtreeFlags; 17421} 17422function getTransformFlagsSubtreeExclusions(kind) { 17423 if (kind >= 182 /* FirstTypeNode */ && kind <= 205 /* LastTypeNode */) { 17424 return -2 /* TypeExcludes */; 17425 } 17426 switch (kind) { 17427 case 213 /* CallExpression */: 17428 case 214 /* NewExpression */: 17429 case 209 /* ArrayLiteralExpression */: 17430 return -2147450880 /* ArrayLiteralOrCallOrNewExcludes */; 17431 case 270 /* ModuleDeclaration */: 17432 return -1941676032 /* ModuleExcludes */; 17433 case 168 /* Parameter */: 17434 return -2147483648 /* ParameterExcludes */; 17435 case 219 /* ArrowFunction */: 17436 return -2072174592 /* ArrowFunctionExcludes */; 17437 case 218 /* FunctionExpression */: 17438 case 263 /* FunctionDeclaration */: 17439 return -1937940480 /* FunctionExcludes */; 17440 case 262 /* VariableDeclarationList */: 17441 return -2146893824 /* VariableDeclarationListExcludes */; 17442 case 264 /* ClassDeclaration */: 17443 case 232 /* ClassExpression */: 17444 return -2147344384 /* ClassExcludes */; 17445 case 176 /* Constructor */: 17446 return -1937948672 /* ConstructorExcludes */; 17447 case 171 /* PropertyDeclaration */: 17448 return -2013249536 /* PropertyExcludes */; 17449 case 174 /* MethodDeclaration */: 17450 case 177 /* GetAccessor */: 17451 case 178 /* SetAccessor */: 17452 return -2005057536 /* MethodOrAccessorExcludes */; 17453 case 132 /* AnyKeyword */: 17454 case 149 /* NumberKeyword */: 17455 case 162 /* BigIntKeyword */: 17456 case 145 /* NeverKeyword */: 17457 case 153 /* StringKeyword */: 17458 case 150 /* ObjectKeyword */: 17459 case 135 /* BooleanKeyword */: 17460 case 154 /* SymbolKeyword */: 17461 case 115 /* VoidKeyword */: 17462 case 167 /* TypeParameter */: 17463 case 170 /* PropertySignature */: 17464 case 173 /* MethodSignature */: 17465 case 179 /* CallSignature */: 17466 case 180 /* ConstructSignature */: 17467 case 181 /* IndexSignature */: 17468 case 267 /* InterfaceDeclaration */: 17469 case 268 /* TypeAliasDeclaration */: 17470 return -2 /* TypeExcludes */; 17471 case 210 /* ObjectLiteralExpression */: 17472 return -2147278848 /* ObjectLiteralExcludes */; 17473 case 301 /* CatchClause */: 17474 return -2147418112 /* CatchClauseExcludes */; 17475 case 206 /* ObjectBindingPattern */: 17476 case 207 /* ArrayBindingPattern */: 17477 return -2147450880 /* BindingPatternExcludes */; 17478 case 216 /* TypeAssertionExpression */: 17479 case 239 /* SatisfiesExpression */: 17480 case 235 /* AsExpression */: 17481 case 359 /* PartiallyEmittedExpression */: 17482 case 217 /* ParenthesizedExpression */: 17483 case 107 /* SuperKeyword */: 17484 return -2147483648 /* OuterExpressionExcludes */; 17485 case 211 /* PropertyAccessExpression */: 17486 case 212 /* ElementAccessExpression */: 17487 return -2147483648 /* PropertyAccessExcludes */; 17488 default: 17489 return -2147483648 /* NodeExcludes */; 17490 } 17491} 17492var baseFactory = createBaseNodeFactory(); 17493function makeSynthetic(node) { 17494 node.flags |= 8 /* Synthesized */; 17495 return node; 17496} 17497var syntheticFactory = { 17498 createBaseSourceFileNode: (kind) => makeSynthetic(baseFactory.createBaseSourceFileNode(kind)), 17499 createBaseIdentifierNode: (kind) => makeSynthetic(baseFactory.createBaseIdentifierNode(kind)), 17500 createBasePrivateIdentifierNode: (kind) => makeSynthetic(baseFactory.createBasePrivateIdentifierNode(kind)), 17501 createBaseTokenNode: (kind) => makeSynthetic(baseFactory.createBaseTokenNode(kind)), 17502 createBaseNode: (kind) => makeSynthetic(baseFactory.createBaseNode(kind)) 17503}; 17504var factory = createNodeFactory(4 /* NoIndentationOnFreshPropertyAccess */, syntheticFactory); 17505function setOriginalNode(node, original) { 17506 node.original = original; 17507 if (original) { 17508 const emitNode = original.emitNode; 17509 if (emitNode) 17510 node.emitNode = mergeEmitNode(emitNode, node.emitNode); 17511 } 17512 return node; 17513} 17514function mergeEmitNode(sourceEmitNode, destEmitNode) { 17515 const { 17516 flags, 17517 leadingComments, 17518 trailingComments, 17519 commentRange, 17520 sourceMapRange, 17521 tokenSourceMapRanges, 17522 constantValue, 17523 helpers, 17524 startsOnNewLine, 17525 snippetElement 17526 } = sourceEmitNode; 17527 if (!destEmitNode) 17528 destEmitNode = {}; 17529 if (leadingComments) 17530 destEmitNode.leadingComments = addRange(leadingComments.slice(), destEmitNode.leadingComments); 17531 if (trailingComments) 17532 destEmitNode.trailingComments = addRange(trailingComments.slice(), destEmitNode.trailingComments); 17533 if (flags) 17534 destEmitNode.flags = flags & ~268435456 /* Immutable */; 17535 if (commentRange) 17536 destEmitNode.commentRange = commentRange; 17537 if (sourceMapRange) 17538 destEmitNode.sourceMapRange = sourceMapRange; 17539 if (tokenSourceMapRanges) 17540 destEmitNode.tokenSourceMapRanges = mergeTokenSourceMapRanges(tokenSourceMapRanges, destEmitNode.tokenSourceMapRanges); 17541 if (constantValue !== void 0) 17542 destEmitNode.constantValue = constantValue; 17543 if (helpers) { 17544 for (const helper of helpers) { 17545 destEmitNode.helpers = appendIfUnique(destEmitNode.helpers, helper); 17546 } 17547 } 17548 if (startsOnNewLine !== void 0) 17549 destEmitNode.startsOnNewLine = startsOnNewLine; 17550 if (snippetElement !== void 0) 17551 destEmitNode.snippetElement = snippetElement; 17552 return destEmitNode; 17553} 17554function mergeTokenSourceMapRanges(sourceRanges, destRanges) { 17555 if (!destRanges) 17556 destRanges = []; 17557 for (const key in sourceRanges) { 17558 destRanges[key] = sourceRanges[key]; 17559 } 17560 return destRanges; 17561} 17562 17563// src/compiler/factory/emitNode.ts 17564function getOrCreateEmitNode(node) { 17565 var _a2; 17566 if (!node.emitNode) { 17567 if (isParseTreeNode(node)) { 17568 if (node.kind === 314 /* SourceFile */) { 17569 return node.emitNode = { annotatedNodes: [node] }; 17570 } 17571 const sourceFile = (_a2 = getSourceFileOfNode(getParseTreeNode(getSourceFileOfNode(node)))) != null ? _a2 : Debug.fail("Could not determine parsed source file."); 17572 getOrCreateEmitNode(sourceFile).annotatedNodes.push(node); 17573 } 17574 node.emitNode = {}; 17575 } else { 17576 Debug.assert(!(node.emitNode.flags & 268435456 /* Immutable */), "Invalid attempt to mutate an immutable node."); 17577 } 17578 return node.emitNode; 17579} 17580function setEmitFlags(node, emitFlags) { 17581 getOrCreateEmitNode(node).flags = emitFlags; 17582 return node; 17583} 17584function getSourceMapRange(node) { 17585 var _a2, _b; 17586 return (_b = (_a2 = node.emitNode) == null ? void 0 : _a2.sourceMapRange) != null ? _b : node; 17587} 17588function getStartsOnNewLine(node) { 17589 var _a2; 17590 return (_a2 = node.emitNode) == null ? void 0 : _a2.startsOnNewLine; 17591} 17592function setStartsOnNewLine(node, newLine) { 17593 getOrCreateEmitNode(node).startsOnNewLine = newLine; 17594 return node; 17595} 17596function getCommentRange(node) { 17597 var _a2, _b; 17598 return (_b = (_a2 = node.emitNode) == null ? void 0 : _a2.commentRange) != null ? _b : node; 17599} 17600function getSyntheticLeadingComments(node) { 17601 var _a2; 17602 return (_a2 = node.emitNode) == null ? void 0 : _a2.leadingComments; 17603} 17604function getSyntheticTrailingComments(node) { 17605 var _a2; 17606 return (_a2 = node.emitNode) == null ? void 0 : _a2.trailingComments; 17607} 17608function getConstantValue(node) { 17609 var _a2; 17610 return (_a2 = node.emitNode) == null ? void 0 : _a2.constantValue; 17611} 17612function getEmitHelpers(node) { 17613 var _a2; 17614 return (_a2 = node.emitNode) == null ? void 0 : _a2.helpers; 17615} 17616function getSnippetElement(node) { 17617 var _a2; 17618 return (_a2 = node.emitNode) == null ? void 0 : _a2.snippetElement; 17619} 17620function getTypeNode(node) { 17621 var _a2; 17622 return (_a2 = node.emitNode) == null ? void 0 : _a2.typeNode; 17623} 17624 17625// src/compiler/factory/emitHelpers.ts 17626function compareEmitHelpers(x, y) { 17627 if (x === y) 17628 return 0 /* EqualTo */; 17629 if (x.priority === y.priority) 17630 return 0 /* EqualTo */; 17631 if (x.priority === void 0) 17632 return 1 /* GreaterThan */; 17633 if (y.priority === void 0) 17634 return -1 /* LessThan */; 17635 return compareValues(x.priority, y.priority); 17636} 17637function helperString(input, ...args) { 17638 return (uniqueName) => { 17639 let result = ""; 17640 for (let i = 0; i < args.length; i++) { 17641 result += input[i]; 17642 result += uniqueName(args[i]); 17643 } 17644 result += input[input.length - 1]; 17645 return result; 17646 }; 17647} 17648var asyncSuperHelper = { 17649 name: "typescript:async-super", 17650 scoped: true, 17651 text: helperString` 17652 const ${"_superIndex"} = name => super[name];` 17653}; 17654var advancedAsyncSuperHelper = { 17655 name: "typescript:advanced-async-super", 17656 scoped: true, 17657 text: helperString` 17658 const ${"_superIndex"} = (function (geti, seti) { 17659 const cache = Object.create(null); 17660 return name => cache[name] || (cache[name] = { get value() { return geti(name); }, set value(v) { seti(name, v); } }); 17661 })(name => super[name], (name, value) => super[name] = value);` 17662}; 17663 17664// src/compiler/factory/nodeTests.ts 17665function isNumericLiteral(node) { 17666 return node.kind === 8 /* NumericLiteral */; 17667} 17668function isBigIntLiteral(node) { 17669 return node.kind === 9 /* BigIntLiteral */; 17670} 17671function isStringLiteral(node) { 17672 return node.kind === 10 /* StringLiteral */; 17673} 17674function isJsxText(node) { 17675 return node.kind === 11 /* JsxText */; 17676} 17677function isNoSubstitutionTemplateLiteral(node) { 17678 return node.kind === 14 /* NoSubstitutionTemplateLiteral */; 17679} 17680function isTemplateHead(node) { 17681 return node.kind === 15 /* TemplateHead */; 17682} 17683function isDotDotDotToken(node) { 17684 return node.kind === 25 /* DotDotDotToken */; 17685} 17686function isCommaToken(node) { 17687 return node.kind === 27 /* CommaToken */; 17688} 17689function isPlusToken(node) { 17690 return node.kind === 39 /* PlusToken */; 17691} 17692function isMinusToken(node) { 17693 return node.kind === 40 /* MinusToken */; 17694} 17695function isAsteriskToken(node) { 17696 return node.kind === 41 /* AsteriskToken */; 17697} 17698function isExclamationToken(node) { 17699 return node.kind === 53 /* ExclamationToken */; 17700} 17701function isQuestionToken(node) { 17702 return node.kind === 57 /* QuestionToken */; 17703} 17704function isColonToken(node) { 17705 return node.kind === 58 /* ColonToken */; 17706} 17707function isQuestionDotToken(node) { 17708 return node.kind === 28 /* QuestionDotToken */; 17709} 17710function isEqualsGreaterThanToken(node) { 17711 return node.kind === 38 /* EqualsGreaterThanToken */; 17712} 17713function isIdentifier(node) { 17714 return node.kind === 79 /* Identifier */; 17715} 17716function isPrivateIdentifier(node) { 17717 return node.kind === 80 /* PrivateIdentifier */; 17718} 17719function isExportModifier(node) { 17720 return node.kind === 94 /* ExportKeyword */; 17721} 17722function isAsyncModifier(node) { 17723 return node.kind === 133 /* AsyncKeyword */; 17724} 17725function isAssertsKeyword(node) { 17726 return node.kind === 130 /* AssertsKeyword */; 17727} 17728function isAwaitKeyword(node) { 17729 return node.kind === 134 /* AwaitKeyword */; 17730} 17731function isReadonlyKeyword(node) { 17732 return node.kind === 147 /* ReadonlyKeyword */; 17733} 17734function isSuperKeyword(node) { 17735 return node.kind === 107 /* SuperKeyword */; 17736} 17737function isImportKeyword(node) { 17738 return node.kind === 101 /* ImportKeyword */; 17739} 17740function isComputedPropertyName(node) { 17741 return node.kind === 166 /* ComputedPropertyName */; 17742} 17743function isTypeParameterDeclaration(node) { 17744 return node.kind === 167 /* TypeParameter */; 17745} 17746function isParameter(node) { 17747 return node.kind === 168 /* Parameter */; 17748} 17749function isDecoratorOrAnnotation(node) { 17750 return node.kind === 169 /* Decorator */; 17751} 17752function isPropertySignature(node) { 17753 return node.kind === 170 /* PropertySignature */; 17754} 17755function isPropertyDeclaration(node) { 17756 return node.kind === 171 /* PropertyDeclaration */; 17757} 17758function isAnnotationPropertyDeclaration(node) { 17759 return node.kind === 172 /* AnnotationPropertyDeclaration */; 17760} 17761function isMethodSignature(node) { 17762 return node.kind === 173 /* MethodSignature */; 17763} 17764function isMethodDeclaration(node) { 17765 return node.kind === 174 /* MethodDeclaration */; 17766} 17767function isClassStaticBlockDeclaration(node) { 17768 return node.kind === 175 /* ClassStaticBlockDeclaration */; 17769} 17770function isConstructorDeclaration(node) { 17771 return node.kind === 176 /* Constructor */; 17772} 17773function isGetAccessorDeclaration(node) { 17774 return node.kind === 177 /* GetAccessor */; 17775} 17776function isSetAccessorDeclaration(node) { 17777 return node.kind === 178 /* SetAccessor */; 17778} 17779function isCallSignatureDeclaration(node) { 17780 return node.kind === 179 /* CallSignature */; 17781} 17782function isConstructSignatureDeclaration(node) { 17783 return node.kind === 180 /* ConstructSignature */; 17784} 17785function isIndexSignatureDeclaration(node) { 17786 return node.kind === 181 /* IndexSignature */; 17787} 17788function isTypePredicateNode(node) { 17789 return node.kind === 182 /* TypePredicate */; 17790} 17791function isTypeReferenceNode(node) { 17792 return node.kind === 183 /* TypeReference */; 17793} 17794function isFunctionTypeNode(node) { 17795 return node.kind === 184 /* FunctionType */; 17796} 17797function isConstructorTypeNode(node) { 17798 return node.kind === 185 /* ConstructorType */; 17799} 17800function isTypeQueryNode(node) { 17801 return node.kind === 186 /* TypeQuery */; 17802} 17803function isTypeLiteralNode(node) { 17804 return node.kind === 187 /* TypeLiteral */; 17805} 17806function isArrayTypeNode(node) { 17807 return node.kind === 188 /* ArrayType */; 17808} 17809function isTupleTypeNode(node) { 17810 return node.kind === 189 /* TupleType */; 17811} 17812function isNamedTupleMember(node) { 17813 return node.kind === 202 /* NamedTupleMember */; 17814} 17815function isOptionalTypeNode(node) { 17816 return node.kind === 190 /* OptionalType */; 17817} 17818function isRestTypeNode(node) { 17819 return node.kind === 191 /* RestType */; 17820} 17821function isUnionTypeNode(node) { 17822 return node.kind === 192 /* UnionType */; 17823} 17824function isIntersectionTypeNode(node) { 17825 return node.kind === 193 /* IntersectionType */; 17826} 17827function isConditionalTypeNode(node) { 17828 return node.kind === 194 /* ConditionalType */; 17829} 17830function isInferTypeNode(node) { 17831 return node.kind === 195 /* InferType */; 17832} 17833function isParenthesizedTypeNode(node) { 17834 return node.kind === 196 /* ParenthesizedType */; 17835} 17836function isThisTypeNode(node) { 17837 return node.kind === 197 /* ThisType */; 17838} 17839function isTypeOperatorNode(node) { 17840 return node.kind === 198 /* TypeOperator */; 17841} 17842function isIndexedAccessTypeNode(node) { 17843 return node.kind === 199 /* IndexedAccessType */; 17844} 17845function isMappedTypeNode(node) { 17846 return node.kind === 200 /* MappedType */; 17847} 17848function isLiteralTypeNode(node) { 17849 return node.kind === 201 /* LiteralType */; 17850} 17851function isImportTypeNode(node) { 17852 return node.kind === 205 /* ImportType */; 17853} 17854function isTemplateLiteralTypeSpan(node) { 17855 return node.kind === 204 /* TemplateLiteralTypeSpan */; 17856} 17857function isObjectBindingPattern(node) { 17858 return node.kind === 206 /* ObjectBindingPattern */; 17859} 17860function isArrayBindingPattern(node) { 17861 return node.kind === 207 /* ArrayBindingPattern */; 17862} 17863function isBindingElement(node) { 17864 return node.kind === 208 /* BindingElement */; 17865} 17866function isArrayLiteralExpression(node) { 17867 return node.kind === 209 /* ArrayLiteralExpression */; 17868} 17869function isObjectLiteralExpression(node) { 17870 return node.kind === 210 /* ObjectLiteralExpression */; 17871} 17872function isPropertyAccessExpression(node) { 17873 return node.kind === 211 /* PropertyAccessExpression */; 17874} 17875function isElementAccessExpression(node) { 17876 return node.kind === 212 /* ElementAccessExpression */; 17877} 17878function isCallExpression(node) { 17879 return node.kind === 213 /* CallExpression */; 17880} 17881function isTaggedTemplateExpression(node) { 17882 return node.kind === 215 /* TaggedTemplateExpression */; 17883} 17884function isParenthesizedExpression(node) { 17885 return node.kind === 217 /* ParenthesizedExpression */; 17886} 17887function isFunctionExpression(node) { 17888 return node.kind === 218 /* FunctionExpression */; 17889} 17890function isEtsComponentExpression(node) { 17891 return node.kind === 220 /* EtsComponentExpression */; 17892} 17893function isArrowFunction(node) { 17894 return node.kind === 219 /* ArrowFunction */; 17895} 17896function isTypeOfExpression(node) { 17897 return node.kind === 222 /* TypeOfExpression */; 17898} 17899function isVoidExpression(node) { 17900 return node.kind === 223 /* VoidExpression */; 17901} 17902function isPrefixUnaryExpression(node) { 17903 return node.kind === 225 /* PrefixUnaryExpression */; 17904} 17905function isBinaryExpression(node) { 17906 return node.kind === 227 /* BinaryExpression */; 17907} 17908function isSpreadElement(node) { 17909 return node.kind === 231 /* SpreadElement */; 17910} 17911function isClassExpression(node) { 17912 return node.kind === 232 /* ClassExpression */; 17913} 17914function isOmittedExpression(node) { 17915 return node.kind === 233 /* OmittedExpression */; 17916} 17917function isExpressionWithTypeArguments(node) { 17918 return node.kind === 234 /* ExpressionWithTypeArguments */; 17919} 17920function isNonNullExpression(node) { 17921 return node.kind === 236 /* NonNullExpression */; 17922} 17923function isMetaProperty(node) { 17924 return node.kind === 237 /* MetaProperty */; 17925} 17926function isPartiallyEmittedExpression(node) { 17927 return node.kind === 359 /* PartiallyEmittedExpression */; 17928} 17929function isCommaListExpression(node) { 17930 return node.kind === 360 /* CommaListExpression */; 17931} 17932function isTemplateSpan(node) { 17933 return node.kind === 240 /* TemplateSpan */; 17934} 17935function isBlock(node) { 17936 return node.kind === 242 /* Block */; 17937} 17938function isVariableStatement(node) { 17939 return node.kind === 244 /* VariableStatement */; 17940} 17941function isEmptyStatement(node) { 17942 return node.kind === 243 /* EmptyStatement */; 17943} 17944function isExpressionStatement(node) { 17945 return node.kind === 245 /* ExpressionStatement */; 17946} 17947function isLabeledStatement(node) { 17948 return node.kind === 257 /* LabeledStatement */; 17949} 17950function isVariableDeclaration(node) { 17951 return node.kind === 261 /* VariableDeclaration */; 17952} 17953function isVariableDeclarationList(node) { 17954 return node.kind === 262 /* VariableDeclarationList */; 17955} 17956function isFunctionDeclaration(node) { 17957 return node.kind === 263 /* FunctionDeclaration */; 17958} 17959function isClassDeclaration(node) { 17960 return node.kind === 264 /* ClassDeclaration */; 17961} 17962function isStructDeclaration(node) { 17963 return node.kind === 265 /* StructDeclaration */; 17964} 17965function isAnnotationDeclaration(node) { 17966 return node.kind === 266 /* AnnotationDeclaration */; 17967} 17968function isInterfaceDeclaration(node) { 17969 return node.kind === 267 /* InterfaceDeclaration */; 17970} 17971function isTypeAliasDeclaration(node) { 17972 return node.kind === 268 /* TypeAliasDeclaration */; 17973} 17974function isEnumDeclaration(node) { 17975 return node.kind === 269 /* EnumDeclaration */; 17976} 17977function isModuleDeclaration(node) { 17978 return node.kind === 270 /* ModuleDeclaration */; 17979} 17980function isModuleBlock(node) { 17981 return node.kind === 271 /* ModuleBlock */; 17982} 17983function isCaseBlock(node) { 17984 return node.kind === 272 /* CaseBlock */; 17985} 17986function isImportEqualsDeclaration(node) { 17987 return node.kind === 274 /* ImportEqualsDeclaration */; 17988} 17989function isImportDeclaration(node) { 17990 return node.kind === 275 /* ImportDeclaration */; 17991} 17992function isImportClause(node) { 17993 return node.kind === 276 /* ImportClause */; 17994} 17995function isImportTypeAssertionContainer(node) { 17996 return node.kind === 304 /* ImportTypeAssertionContainer */; 17997} 17998function isAssertClause(node) { 17999 return node.kind === 302 /* AssertClause */; 18000} 18001function isAssertEntry(node) { 18002 return node.kind === 303 /* AssertEntry */; 18003} 18004function isNamespaceImport(node) { 18005 return node.kind === 277 /* NamespaceImport */; 18006} 18007function isNamespaceExport(node) { 18008 return node.kind === 283 /* NamespaceExport */; 18009} 18010function isImportSpecifier(node) { 18011 return node.kind === 279 /* ImportSpecifier */; 18012} 18013function isExportAssignment(node) { 18014 return node.kind === 280 /* ExportAssignment */; 18015} 18016function isExportDeclaration(node) { 18017 return node.kind === 281 /* ExportDeclaration */; 18018} 18019function isExportSpecifier(node) { 18020 return node.kind === 284 /* ExportSpecifier */; 18021} 18022function isNotEmittedStatement(node) { 18023 return node.kind === 358 /* NotEmittedStatement */; 18024} 18025function isExternalModuleReference(node) { 18026 return node.kind === 286 /* ExternalModuleReference */; 18027} 18028function isJsxOpeningElement(node) { 18029 return node.kind === 289 /* JsxOpeningElement */; 18030} 18031function isJsxClosingElement(node) { 18032 return node.kind === 290 /* JsxClosingElement */; 18033} 18034function isJsxOpeningFragment(node) { 18035 return node.kind === 292 /* JsxOpeningFragment */; 18036} 18037function isJsxClosingFragment(node) { 18038 return node.kind === 293 /* JsxClosingFragment */; 18039} 18040function isJsxAttributes(node) { 18041 return node.kind === 295 /* JsxAttributes */; 18042} 18043function isDefaultClause(node) { 18044 return node.kind === 299 /* DefaultClause */; 18045} 18046function isHeritageClause(node) { 18047 return node.kind === 300 /* HeritageClause */; 18048} 18049function isCatchClause(node) { 18050 return node.kind === 301 /* CatchClause */; 18051} 18052function isPropertyAssignment(node) { 18053 return node.kind === 305 /* PropertyAssignment */; 18054} 18055function isShorthandPropertyAssignment(node) { 18056 return node.kind === 306 /* ShorthandPropertyAssignment */; 18057} 18058function isEnumMember(node) { 18059 return node.kind === 308 /* EnumMember */; 18060} 18061function isUnparsedPrepend(node) { 18062 return node.kind === 310 /* UnparsedPrepend */; 18063} 18064function isSourceFile(node) { 18065 return node.kind === 314 /* SourceFile */; 18066} 18067function isUnparsedSource(node) { 18068 return node.kind === 316 /* UnparsedSource */; 18069} 18070function isJSDocTypeExpression(node) { 18071 return node.kind === 318 /* JSDocTypeExpression */; 18072} 18073function isJSDocNullableType(node) { 18074 return node.kind === 323 /* JSDocNullableType */; 18075} 18076function isJSDocFunctionType(node) { 18077 return node.kind === 326 /* JSDocFunctionType */; 18078} 18079function isJSDoc(node) { 18080 return node.kind === 329 /* JSDoc */; 18081} 18082function isJSDocTypeLiteral(node) { 18083 return node.kind === 331 /* JSDocTypeLiteral */; 18084} 18085function isJSDocPublicTag(node) { 18086 return node.kind === 342 /* JSDocPublicTag */; 18087} 18088function isJSDocPrivateTag(node) { 18089 return node.kind === 343 /* JSDocPrivateTag */; 18090} 18091function isJSDocProtectedTag(node) { 18092 return node.kind === 344 /* JSDocProtectedTag */; 18093} 18094function isJSDocReadonlyTag(node) { 18095 return node.kind === 345 /* JSDocReadonlyTag */; 18096} 18097function isJSDocOverrideTag(node) { 18098 return node.kind === 346 /* JSDocOverrideTag */; 18099} 18100function isJSDocDeprecatedTag(node) { 18101 return node.kind === 340 /* JSDocDeprecatedTag */; 18102} 18103function isJSDocEnumTag(node) { 18104 return node.kind === 348 /* JSDocEnumTag */; 18105} 18106function isJSDocParameterTag(node) { 18107 return node.kind === 349 /* JSDocParameterTag */; 18108} 18109function isJSDocReturnTag(node) { 18110 return node.kind === 350 /* JSDocReturnTag */; 18111} 18112function isJSDocTypeTag(node) { 18113 return node.kind === 352 /* JSDocTypeTag */; 18114} 18115function isJSDocTemplateTag(node) { 18116 return node.kind === 353 /* JSDocTemplateTag */; 18117} 18118 18119// src/compiler/factory/utilities.ts 18120function isLocalName(node) { 18121 return (getEmitFlags(node) & 16384 /* LocalName */) !== 0; 18122} 18123function isUseStrictPrologue(node) { 18124 return isStringLiteral(node.expression) && node.expression.text === "use strict"; 18125} 18126function findUseStrictPrologue(statements) { 18127 for (const statement of statements) { 18128 if (isPrologueDirective(statement)) { 18129 if (isUseStrictPrologue(statement)) { 18130 return statement; 18131 } 18132 } else { 18133 break; 18134 } 18135 } 18136 return void 0; 18137} 18138function isCommaSequence(node) { 18139 return node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 360 /* CommaListExpression */; 18140} 18141function isJSDocTypeAssertion(node) { 18142 return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node); 18143} 18144function isOuterExpression(node, kinds = 15 /* All */) { 18145 switch (node.kind) { 18146 case 217 /* ParenthesizedExpression */: 18147 if (kinds & 16 /* ExcludeJSDocTypeAssertion */ && isJSDocTypeAssertion(node)) { 18148 return false; 18149 } 18150 return (kinds & 1 /* Parentheses */) !== 0; 18151 case 216 /* TypeAssertionExpression */: 18152 case 235 /* AsExpression */: 18153 case 239 /* SatisfiesExpression */: 18154 return (kinds & 2 /* TypeAssertions */) !== 0; 18155 case 236 /* NonNullExpression */: 18156 return (kinds & 4 /* NonNullAssertions */) !== 0; 18157 case 359 /* PartiallyEmittedExpression */: 18158 return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0; 18159 } 18160 return false; 18161} 18162function skipOuterExpressions(node, kinds = 15 /* All */) { 18163 while (isOuterExpression(node, kinds)) { 18164 node = node.expression; 18165 } 18166 return node; 18167} 18168function startOnNewLine(node) { 18169 return setStartsOnNewLine(node, true); 18170} 18171function getExternalHelpersModuleName(node) { 18172 const parseNode = getOriginalNode(node, isSourceFile); 18173 const emitNode = parseNode && parseNode.emitNode; 18174 return emitNode && emitNode.externalHelpersModuleName; 18175} 18176function hasRecordedExternalHelpers(sourceFile) { 18177 const parseNode = getOriginalNode(sourceFile, isSourceFile); 18178 const emitNode = parseNode && parseNode.emitNode; 18179 return !!emitNode && (!!emitNode.externalHelpersModuleName || !!emitNode.externalHelpers); 18180} 18181function getTargetOfBindingOrAssignmentElement(bindingElement) { 18182 if (isDeclarationBindingElement(bindingElement)) { 18183 return bindingElement.name; 18184 } 18185 if (isObjectLiteralElementLike(bindingElement)) { 18186 switch (bindingElement.kind) { 18187 case 305 /* PropertyAssignment */: 18188 return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); 18189 case 306 /* ShorthandPropertyAssignment */: 18190 return bindingElement.name; 18191 case 307 /* SpreadAssignment */: 18192 return getTargetOfBindingOrAssignmentElement(bindingElement.expression); 18193 } 18194 } 18195 if (isAssignmentExpression(bindingElement, true)) { 18196 return getTargetOfBindingOrAssignmentElement(bindingElement.left); 18197 } 18198 if (isSpreadElement(bindingElement)) { 18199 return getTargetOfBindingOrAssignmentElement(bindingElement.expression); 18200 } 18201 return bindingElement; 18202} 18203function getElementsOfBindingOrAssignmentPattern(name) { 18204 switch (name.kind) { 18205 case 206 /* ObjectBindingPattern */: 18206 case 207 /* ArrayBindingPattern */: 18207 case 209 /* ArrayLiteralExpression */: 18208 return name.elements; 18209 case 210 /* ObjectLiteralExpression */: 18210 return name.properties; 18211 } 18212} 18213function getJSDocTypeAliasName(fullName) { 18214 if (fullName) { 18215 let rightNode = fullName; 18216 while (true) { 18217 if (isIdentifier(rightNode) || !rightNode.body) { 18218 return isIdentifier(rightNode) ? rightNode : rightNode.name; 18219 } 18220 rightNode = rightNode.body; 18221 } 18222 } 18223} 18224function canHaveIllegalDecorators(node) { 18225 const kind = node.kind; 18226 return kind === 305 /* PropertyAssignment */ || kind === 306 /* ShorthandPropertyAssignment */ || kind === 263 /* FunctionDeclaration */ || kind === 176 /* Constructor */ || kind === 181 /* IndexSignature */ || kind === 175 /* ClassStaticBlockDeclaration */ || kind === 285 /* MissingDeclaration */ || kind === 244 /* VariableStatement */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 273 /* NamespaceExportDeclaration */ || kind === 281 /* ExportDeclaration */ || kind === 280 /* ExportAssignment */; 18227} 18228var isTypeNodeOrTypeParameterDeclaration = or(isTypeNode, isTypeParameterDeclaration); 18229var isQuestionOrExclamationToken = or(isQuestionToken, isExclamationToken); 18230var isIdentifierOrThisTypeNode = or(isIdentifier, isThisTypeNode); 18231var isReadonlyKeywordOrPlusOrMinusToken = or(isReadonlyKeyword, isPlusToken, isMinusToken); 18232var isQuestionOrPlusOrMinusToken = or(isQuestionToken, isPlusToken, isMinusToken); 18233var isModuleName = or(isIdentifier, isStringLiteral); 18234function isExponentiationOperator(kind) { 18235 return kind === 42 /* AsteriskAsteriskToken */; 18236} 18237function isMultiplicativeOperator(kind) { 18238 return kind === 41 /* AsteriskToken */ || kind === 43 /* SlashToken */ || kind === 44 /* PercentToken */; 18239} 18240function isMultiplicativeOperatorOrHigher(kind) { 18241 return isExponentiationOperator(kind) || isMultiplicativeOperator(kind); 18242} 18243function isAdditiveOperator(kind) { 18244 return kind === 39 /* PlusToken */ || kind === 40 /* MinusToken */; 18245} 18246function isAdditiveOperatorOrHigher(kind) { 18247 return isAdditiveOperator(kind) || isMultiplicativeOperatorOrHigher(kind); 18248} 18249function isShiftOperator(kind) { 18250 return kind === 47 /* LessThanLessThanToken */ || kind === 48 /* GreaterThanGreaterThanToken */ || kind === 49 /* GreaterThanGreaterThanGreaterThanToken */; 18251} 18252function isShiftOperatorOrHigher(kind) { 18253 return isShiftOperator(kind) || isAdditiveOperatorOrHigher(kind); 18254} 18255function isRelationalOperator(kind) { 18256 return kind === 29 /* LessThanToken */ || kind === 32 /* LessThanEqualsToken */ || kind === 31 /* GreaterThanToken */ || kind === 33 /* GreaterThanEqualsToken */ || kind === 103 /* InstanceOfKeyword */ || kind === 102 /* InKeyword */; 18257} 18258function isRelationalOperatorOrHigher(kind) { 18259 return isRelationalOperator(kind) || isShiftOperatorOrHigher(kind); 18260} 18261function isEqualityOperator(kind) { 18262 return kind === 34 /* EqualsEqualsToken */ || kind === 36 /* EqualsEqualsEqualsToken */ || kind === 35 /* ExclamationEqualsToken */ || kind === 37 /* ExclamationEqualsEqualsToken */; 18263} 18264function isEqualityOperatorOrHigher(kind) { 18265 return isEqualityOperator(kind) || isRelationalOperatorOrHigher(kind); 18266} 18267function isBitwiseOperator(kind) { 18268 return kind === 50 /* AmpersandToken */ || kind === 51 /* BarToken */ || kind === 52 /* CaretToken */; 18269} 18270function isBitwiseOperatorOrHigher(kind) { 18271 return isBitwiseOperator(kind) || isEqualityOperatorOrHigher(kind); 18272} 18273function isLogicalOperator(kind) { 18274 return kind === 55 /* AmpersandAmpersandToken */ || kind === 56 /* BarBarToken */; 18275} 18276function isLogicalOperatorOrHigher(kind) { 18277 return isLogicalOperator(kind) || isBitwiseOperatorOrHigher(kind); 18278} 18279function isAssignmentOperatorOrHigher(kind) { 18280 return kind === 60 /* QuestionQuestionToken */ || isLogicalOperatorOrHigher(kind) || isAssignmentOperator(kind); 18281} 18282function isBinaryOperator(kind) { 18283 return isAssignmentOperatorOrHigher(kind) || kind === 27 /* CommaToken */; 18284} 18285function isBinaryOperatorToken(node) { 18286 return isBinaryOperator(node.kind); 18287} 18288var BinaryExpressionState; 18289((BinaryExpressionState2) => { 18290 function enter(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, outerState) { 18291 const prevUserState = stackIndex > 0 ? userStateStack[stackIndex - 1] : void 0; 18292 Debug.assertEqual(stateStack[stackIndex], enter); 18293 userStateStack[stackIndex] = machine.onEnter(nodeStack[stackIndex], prevUserState, outerState); 18294 stateStack[stackIndex] = nextState(machine, enter); 18295 return stackIndex; 18296 } 18297 BinaryExpressionState2.enter = enter; 18298 function left(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, _outerState) { 18299 Debug.assertEqual(stateStack[stackIndex], left); 18300 Debug.assertIsDefined(machine.onLeft); 18301 stateStack[stackIndex] = nextState(machine, left); 18302 const nextNode = machine.onLeft(nodeStack[stackIndex].left, userStateStack[stackIndex], nodeStack[stackIndex]); 18303 if (nextNode) { 18304 checkCircularity(stackIndex, nodeStack, nextNode); 18305 return pushStack(stackIndex, stateStack, nodeStack, userStateStack, nextNode); 18306 } 18307 return stackIndex; 18308 } 18309 BinaryExpressionState2.left = left; 18310 function operator(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, _outerState) { 18311 Debug.assertEqual(stateStack[stackIndex], operator); 18312 Debug.assertIsDefined(machine.onOperator); 18313 stateStack[stackIndex] = nextState(machine, operator); 18314 machine.onOperator(nodeStack[stackIndex].operatorToken, userStateStack[stackIndex], nodeStack[stackIndex]); 18315 return stackIndex; 18316 } 18317 BinaryExpressionState2.operator = operator; 18318 function right(machine, stackIndex, stateStack, nodeStack, userStateStack, _resultHolder, _outerState) { 18319 Debug.assertEqual(stateStack[stackIndex], right); 18320 Debug.assertIsDefined(machine.onRight); 18321 stateStack[stackIndex] = nextState(machine, right); 18322 const nextNode = machine.onRight(nodeStack[stackIndex].right, userStateStack[stackIndex], nodeStack[stackIndex]); 18323 if (nextNode) { 18324 checkCircularity(stackIndex, nodeStack, nextNode); 18325 return pushStack(stackIndex, stateStack, nodeStack, userStateStack, nextNode); 18326 } 18327 return stackIndex; 18328 } 18329 BinaryExpressionState2.right = right; 18330 function exit(machine, stackIndex, stateStack, nodeStack, userStateStack, resultHolder, _outerState) { 18331 Debug.assertEqual(stateStack[stackIndex], exit); 18332 stateStack[stackIndex] = nextState(machine, exit); 18333 const result = machine.onExit(nodeStack[stackIndex], userStateStack[stackIndex]); 18334 if (stackIndex > 0) { 18335 stackIndex--; 18336 if (machine.foldState) { 18337 const side = stateStack[stackIndex] === exit ? "right" : "left"; 18338 userStateStack[stackIndex] = machine.foldState(userStateStack[stackIndex], result, side); 18339 } 18340 } else { 18341 resultHolder.value = result; 18342 } 18343 return stackIndex; 18344 } 18345 BinaryExpressionState2.exit = exit; 18346 function done(_machine, stackIndex, stateStack, _nodeStack, _userStateStack, _resultHolder, _outerState) { 18347 Debug.assertEqual(stateStack[stackIndex], done); 18348 return stackIndex; 18349 } 18350 BinaryExpressionState2.done = done; 18351 function nextState(machine, currentState) { 18352 switch (currentState) { 18353 case enter: 18354 if (machine.onLeft) 18355 return left; 18356 case left: 18357 if (machine.onOperator) 18358 return operator; 18359 case operator: 18360 if (machine.onRight) 18361 return right; 18362 case right: 18363 return exit; 18364 case exit: 18365 return done; 18366 case done: 18367 return done; 18368 default: 18369 Debug.fail("Invalid state"); 18370 } 18371 } 18372 BinaryExpressionState2.nextState = nextState; 18373 function pushStack(stackIndex, stateStack, nodeStack, userStateStack, node) { 18374 stackIndex++; 18375 stateStack[stackIndex] = enter; 18376 nodeStack[stackIndex] = node; 18377 userStateStack[stackIndex] = void 0; 18378 return stackIndex; 18379 } 18380 function checkCircularity(stackIndex, nodeStack, node) { 18381 if (Debug.shouldAssert(2 /* Aggressive */)) { 18382 while (stackIndex >= 0) { 18383 Debug.assert(nodeStack[stackIndex] !== node, "Circular traversal detected."); 18384 stackIndex--; 18385 } 18386 } 18387 } 18388})(BinaryExpressionState || (BinaryExpressionState = {})); 18389var BinaryExpressionStateMachine = class { 18390 constructor(onEnter, onLeft, onOperator, onRight, onExit, foldState) { 18391 this.onEnter = onEnter; 18392 this.onLeft = onLeft; 18393 this.onOperator = onOperator; 18394 this.onRight = onRight; 18395 this.onExit = onExit; 18396 this.foldState = foldState; 18397 } 18398}; 18399function createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, onExit, foldState) { 18400 const machine = new BinaryExpressionStateMachine(onEnter, onLeft, onOperator, onRight, onExit, foldState); 18401 return trampoline; 18402 function trampoline(node, outerState) { 18403 const resultHolder = { value: void 0 }; 18404 const stateStack = [BinaryExpressionState.enter]; 18405 const nodeStack = [node]; 18406 const userStateStack = [void 0]; 18407 let stackIndex = 0; 18408 while (stateStack[stackIndex] !== BinaryExpressionState.done) { 18409 stackIndex = stateStack[stackIndex](machine, stackIndex, stateStack, nodeStack, userStateStack, resultHolder, outerState); 18410 } 18411 Debug.assertEqual(stackIndex, 0); 18412 return resultHolder.value; 18413 } 18414} 18415function getNodeForGeneratedName(name) { 18416 if (name.autoGenerateFlags & 4 /* Node */) { 18417 const autoGenerateId = name.autoGenerateId; 18418 let node = name; 18419 let original = node.original; 18420 while (original) { 18421 node = original; 18422 if (isMemberName(node) && !!(node.autoGenerateFlags & 4 /* Node */) && node.autoGenerateId !== autoGenerateId) { 18423 break; 18424 } 18425 original = node.original; 18426 } 18427 return node; 18428 } 18429 return name; 18430} 18431function formatGeneratedNamePart(part, generateName) { 18432 return typeof part === "object" ? formatGeneratedName(false, part.prefix, part.node, part.suffix, generateName) : typeof part === "string" ? part.length > 0 && part.charCodeAt(0) === 35 /* hash */ ? part.slice(1) : part : ""; 18433} 18434function formatIdentifier(name, generateName) { 18435 return typeof name === "string" ? name : formatIdentifierWorker(name, Debug.checkDefined(generateName)); 18436} 18437function formatIdentifierWorker(node, generateName) { 18438 return isGeneratedPrivateIdentifier(node) ? generateName(node).slice(1) : isGeneratedIdentifier(node) ? generateName(node) : isPrivateIdentifier(node) ? node.escapedText.slice(1) : idText(node); 18439} 18440function formatGeneratedName(privateName, prefix, baseName, suffix, generateName) { 18441 prefix = formatGeneratedNamePart(prefix, generateName); 18442 suffix = formatGeneratedNamePart(suffix, generateName); 18443 baseName = formatIdentifier(baseName, generateName); 18444 return `${privateName ? "#" : ""}${prefix}${baseName}${suffix}`; 18445} 18446 18447// src/compiler/factory/utilitiesPublic.ts 18448function setTextRange(range, location) { 18449 return location ? setTextRangePosEnd(range, location.pos, location.end) : range; 18450} 18451function canHaveModifiers(node) { 18452 const kind = node.kind; 18453 return kind === 167 /* TypeParameter */ || kind === 168 /* Parameter */ || kind === 170 /* PropertySignature */ || kind === 171 /* PropertyDeclaration */ || kind === 173 /* MethodSignature */ || kind === 174 /* MethodDeclaration */ || kind === 176 /* Constructor */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 181 /* IndexSignature */ || kind === 185 /* ConstructorType */ || kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */ || kind === 232 /* ClassExpression */ || kind === 265 /* StructDeclaration */ || kind === 266 /* AnnotationDeclaration */ || kind === 244 /* VariableStatement */ || kind === 263 /* FunctionDeclaration */ || kind === 264 /* ClassDeclaration */ || kind === 267 /* InterfaceDeclaration */ || kind === 268 /* TypeAliasDeclaration */ || kind === 269 /* EnumDeclaration */ || kind === 270 /* ModuleDeclaration */ || kind === 274 /* ImportEqualsDeclaration */ || kind === 275 /* ImportDeclaration */ || kind === 280 /* ExportAssignment */ || kind === 281 /* ExportDeclaration */; 18454} 18455function canHaveDecorators(node) { 18456 const kind = node.kind; 18457 return kind === 168 /* Parameter */ || kind === 171 /* PropertyDeclaration */ || kind === 174 /* MethodDeclaration */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 232 /* ClassExpression */ || kind === 264 /* ClassDeclaration */ || kind === 265 /* StructDeclaration */; 18458} 18459 18460// src/compiler/parser.ts 18461var NodeConstructor; 18462var TokenConstructor; 18463var IdentifierConstructor; 18464var PrivateIdentifierConstructor; 18465var SourceFileConstructor; 18466var parseBaseNodeFactory = { 18467 createBaseSourceFileNode: (kind) => new (SourceFileConstructor || (SourceFileConstructor = objectAllocator.getSourceFileConstructor()))(kind, -1, -1), 18468 createBaseIdentifierNode: (kind) => new (IdentifierConstructor || (IdentifierConstructor = objectAllocator.getIdentifierConstructor()))(kind, -1, -1), 18469 createBasePrivateIdentifierNode: (kind) => new (PrivateIdentifierConstructor || (PrivateIdentifierConstructor = objectAllocator.getPrivateIdentifierConstructor()))(kind, -1, -1), 18470 createBaseTokenNode: (kind) => new (TokenConstructor || (TokenConstructor = objectAllocator.getTokenConstructor()))(kind, -1, -1), 18471 createBaseNode: (kind) => new (NodeConstructor || (NodeConstructor = objectAllocator.getNodeConstructor()))(kind, -1, -1) 18472}; 18473var parseNodeFactory = createNodeFactory(1 /* NoParenthesizerRules */, parseBaseNodeFactory); 18474function visitNode2(cbNode, node) { 18475 return node && cbNode(node); 18476} 18477function visitNodes(cbNode, cbNodes, nodes) { 18478 if (nodes) { 18479 if (cbNodes) { 18480 return cbNodes(nodes); 18481 } 18482 for (const node of nodes) { 18483 const result = cbNode(node); 18484 if (result) { 18485 return result; 18486 } 18487 } 18488 } 18489} 18490function isJSDocLikeText(text, start) { 18491 return text.charCodeAt(start + 1) === 42 /* asterisk */ && text.charCodeAt(start + 2) === 42 /* asterisk */ && text.charCodeAt(start + 3) !== 47 /* slash */; 18492} 18493function isFileProbablyExternalModule(sourceFile) { 18494 return forEach(sourceFile.statements, isAnExternalModuleIndicatorNode) || getImportMetaIfNecessary(sourceFile); 18495} 18496function isAnExternalModuleIndicatorNode(node) { 18497 return canHaveModifiers(node) && hasModifierOfKind(node, 94 /* ExportKeyword */) || isImportEqualsDeclaration(node) && isExternalModuleReference(node.moduleReference) || isImportDeclaration(node) || isExportAssignment(node) || isExportDeclaration(node) ? node : void 0; 18498} 18499function getImportMetaIfNecessary(sourceFile) { 18500 return sourceFile.flags & 4194304 /* PossiblyContainsImportMeta */ ? walkTreeForImportMeta(sourceFile) : void 0; 18501} 18502function walkTreeForImportMeta(node) { 18503 return isImportMeta(node) ? node : forEachChild(node, walkTreeForImportMeta); 18504} 18505function hasModifierOfKind(node, kind) { 18506 return some(node.modifiers, (m) => m.kind === kind); 18507} 18508function isImportMeta(node) { 18509 return isMetaProperty(node) && node.keywordToken === 101 /* ImportKeyword */ && node.name.escapedText === "meta"; 18510} 18511var forEachChildTable = { 18512 [165 /* QualifiedName */]: function forEachChildInQualifiedName(node, cbNode, _cbNodes) { 18513 return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right); 18514 }, 18515 [167 /* TypeParameter */]: function forEachChildInTypeParameter(node, cbNode, cbNodes) { 18516 return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.constraint) || visitNode2(cbNode, node.default) || visitNode2(cbNode, node.expression); 18517 }, 18518 [306 /* ShorthandPropertyAssignment */]: function forEachChildInShorthandPropertyAssignment(node, cbNode, cbNodes) { 18519 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.equalsToken) || visitNode2(cbNode, node.objectAssignmentInitializer); 18520 }, 18521 [307 /* SpreadAssignment */]: function forEachChildInSpreadAssignment(node, cbNode, _cbNodes) { 18522 return visitNode2(cbNode, node.expression); 18523 }, 18524 [168 /* Parameter */]: function forEachChildInParameter(node, cbNode, cbNodes) { 18525 return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); 18526 }, 18527 [171 /* PropertyDeclaration */]: function forEachChildInPropertyDeclaration(node, cbNode, cbNodes) { 18528 return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); 18529 }, 18530 [172 /* AnnotationPropertyDeclaration */]: function forEachChildInAnnotationPropertyDeclaration(node, cbNode, _cbNodes) { 18531 return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); 18532 }, 18533 [170 /* PropertySignature */]: function forEachChildInPropertySignature(node, cbNode, cbNodes) { 18534 return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); 18535 }, 18536 [305 /* PropertyAssignment */]: function forEachChildInPropertyAssignment(node, cbNode, cbNodes) { 18537 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.initializer); 18538 }, 18539 [261 /* VariableDeclaration */]: function forEachChildInVariableDeclaration(node, cbNode, _cbNodes) { 18540 return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.exclamationToken) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.initializer); 18541 }, 18542 [208 /* BindingElement */]: function forEachChildInBindingElement(node, cbNode, _cbNodes) { 18543 return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); 18544 }, 18545 [181 /* IndexSignature */]: function forEachChildInIndexSignature(node, cbNode, cbNodes) { 18546 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); 18547 }, 18548 [185 /* ConstructorType */]: function forEachChildInConstructorType(node, cbNode, cbNodes) { 18549 return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); 18550 }, 18551 [184 /* FunctionType */]: function forEachChildInFunctionType(node, cbNode, cbNodes) { 18552 return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); 18553 }, 18554 [179 /* CallSignature */]: forEachChildInCallOrConstructSignature, 18555 [180 /* ConstructSignature */]: forEachChildInCallOrConstructSignature, 18556 [220 /* EtsComponentExpression */]: function forEachChildInEtsComponentExpression(node, cbNode, cbNodes) { 18557 return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.arguments) || visitNode2(cbNode, node.body); 18558 }, 18559 [174 /* MethodDeclaration */]: function forEachChildInMethodDeclaration(node, cbNode, cbNodes) { 18560 return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.exclamationToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); 18561 }, 18562 [173 /* MethodSignature */]: function forEachChildInMethodSignature(node, cbNode, cbNodes) { 18563 return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); 18564 }, 18565 [176 /* Constructor */]: function forEachChildInConstructor(node, cbNode, cbNodes) { 18566 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); 18567 }, 18568 [177 /* GetAccessor */]: function forEachChildInGetAccessor(node, cbNode, cbNodes) { 18569 return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); 18570 }, 18571 [178 /* SetAccessor */]: function forEachChildInSetAccessor(node, cbNode, cbNodes) { 18572 return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); 18573 }, 18574 [263 /* FunctionDeclaration */]: function forEachChildInFunctionDeclaration(node, cbNode, cbNodes) { 18575 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); 18576 }, 18577 [218 /* FunctionExpression */]: function forEachChildInFunctionExpression(node, cbNode, cbNodes) { 18578 return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.body); 18579 }, 18580 [219 /* ArrowFunction */]: function forEachChildInArrowFunction(node, cbNode, cbNodes) { 18581 return visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type) || visitNode2(cbNode, node.equalsGreaterThanToken) || visitNode2(cbNode, node.body); 18582 }, 18583 [175 /* ClassStaticBlockDeclaration */]: function forEachChildInClassStaticBlockDeclaration(node, cbNode, cbNodes) { 18584 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.body); 18585 }, 18586 [183 /* TypeReference */]: function forEachChildInTypeReference(node, cbNode, cbNodes) { 18587 return visitNode2(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); 18588 }, 18589 [182 /* TypePredicate */]: function forEachChildInTypePredicate(node, cbNode, _cbNodes) { 18590 return visitNode2(cbNode, node.assertsModifier) || visitNode2(cbNode, node.parameterName) || visitNode2(cbNode, node.type); 18591 }, 18592 [186 /* TypeQuery */]: function forEachChildInTypeQuery(node, cbNode, cbNodes) { 18593 return visitNode2(cbNode, node.exprName) || visitNodes(cbNode, cbNodes, node.typeArguments); 18594 }, 18595 [187 /* TypeLiteral */]: function forEachChildInTypeLiteral(node, cbNode, cbNodes) { 18596 return visitNodes(cbNode, cbNodes, node.members); 18597 }, 18598 [188 /* ArrayType */]: function forEachChildInArrayType(node, cbNode, _cbNodes) { 18599 return visitNode2(cbNode, node.elementType); 18600 }, 18601 [189 /* TupleType */]: function forEachChildInTupleType(node, cbNode, cbNodes) { 18602 return visitNodes(cbNode, cbNodes, node.elements); 18603 }, 18604 [192 /* UnionType */]: forEachChildInUnionOrIntersectionType, 18605 [193 /* IntersectionType */]: forEachChildInUnionOrIntersectionType, 18606 [194 /* ConditionalType */]: function forEachChildInConditionalType(node, cbNode, _cbNodes) { 18607 return visitNode2(cbNode, node.checkType) || visitNode2(cbNode, node.extendsType) || visitNode2(cbNode, node.trueType) || visitNode2(cbNode, node.falseType); 18608 }, 18609 [195 /* InferType */]: function forEachChildInInferType(node, cbNode, _cbNodes) { 18610 return visitNode2(cbNode, node.typeParameter); 18611 }, 18612 [205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) { 18613 return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.assertions) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); 18614 }, 18615 [304 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) { 18616 return visitNode2(cbNode, node.assertClause); 18617 }, 18618 [196 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator, 18619 [198 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator, 18620 [199 /* IndexedAccessType */]: function forEachChildInIndexedAccessType(node, cbNode, _cbNodes) { 18621 return visitNode2(cbNode, node.objectType) || visitNode2(cbNode, node.indexType); 18622 }, 18623 [200 /* MappedType */]: function forEachChildInMappedType(node, cbNode, cbNodes) { 18624 return visitNode2(cbNode, node.readonlyToken) || visitNode2(cbNode, node.typeParameter) || visitNode2(cbNode, node.nameType) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type) || visitNodes(cbNode, cbNodes, node.members); 18625 }, 18626 [201 /* LiteralType */]: function forEachChildInLiteralType(node, cbNode, _cbNodes) { 18627 return visitNode2(cbNode, node.literal); 18628 }, 18629 [202 /* NamedTupleMember */]: function forEachChildInNamedTupleMember(node, cbNode, _cbNodes) { 18630 return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.type); 18631 }, 18632 [206 /* ObjectBindingPattern */]: forEachChildInObjectOrArrayBindingPattern, 18633 [207 /* ArrayBindingPattern */]: forEachChildInObjectOrArrayBindingPattern, 18634 [209 /* ArrayLiteralExpression */]: function forEachChildInArrayLiteralExpression(node, cbNode, cbNodes) { 18635 return visitNodes(cbNode, cbNodes, node.elements); 18636 }, 18637 [210 /* ObjectLiteralExpression */]: function forEachChildInObjectLiteralExpression(node, cbNode, cbNodes) { 18638 return visitNodes(cbNode, cbNodes, node.properties); 18639 }, 18640 [211 /* PropertyAccessExpression */]: function forEachChildInPropertyAccessExpression(node, cbNode, _cbNodes) { 18641 return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.name); 18642 }, 18643 [212 /* ElementAccessExpression */]: function forEachChildInElementAccessExpression(node, cbNode, _cbNodes) { 18644 return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNode2(cbNode, node.argumentExpression); 18645 }, 18646 [213 /* CallExpression */]: forEachChildInCallOrNewExpression, 18647 [214 /* NewExpression */]: forEachChildInCallOrNewExpression, 18648 [215 /* TaggedTemplateExpression */]: function forEachChildInTaggedTemplateExpression(node, cbNode, cbNodes) { 18649 return visitNode2(cbNode, node.tag) || visitNode2(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode2(cbNode, node.template); 18650 }, 18651 [216 /* TypeAssertionExpression */]: function forEachChildInTypeAssertionExpression(node, cbNode, _cbNodes) { 18652 return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.expression); 18653 }, 18654 [217 /* ParenthesizedExpression */]: function forEachChildInParenthesizedExpression(node, cbNode, _cbNodes) { 18655 return visitNode2(cbNode, node.expression); 18656 }, 18657 [221 /* DeleteExpression */]: function forEachChildInDeleteExpression(node, cbNode, _cbNodes) { 18658 return visitNode2(cbNode, node.expression); 18659 }, 18660 [222 /* TypeOfExpression */]: function forEachChildInTypeOfExpression(node, cbNode, _cbNodes) { 18661 return visitNode2(cbNode, node.expression); 18662 }, 18663 [223 /* VoidExpression */]: function forEachChildInVoidExpression(node, cbNode, _cbNodes) { 18664 return visitNode2(cbNode, node.expression); 18665 }, 18666 [225 /* PrefixUnaryExpression */]: function forEachChildInPrefixUnaryExpression(node, cbNode, _cbNodes) { 18667 return visitNode2(cbNode, node.operand); 18668 }, 18669 [230 /* YieldExpression */]: function forEachChildInYieldExpression(node, cbNode, _cbNodes) { 18670 return visitNode2(cbNode, node.asteriskToken) || visitNode2(cbNode, node.expression); 18671 }, 18672 [224 /* AwaitExpression */]: function forEachChildInAwaitExpression(node, cbNode, _cbNodes) { 18673 return visitNode2(cbNode, node.expression); 18674 }, 18675 [226 /* PostfixUnaryExpression */]: function forEachChildInPostfixUnaryExpression(node, cbNode, _cbNodes) { 18676 return visitNode2(cbNode, node.operand); 18677 }, 18678 [227 /* BinaryExpression */]: function forEachChildInBinaryExpression(node, cbNode, _cbNodes) { 18679 return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.operatorToken) || visitNode2(cbNode, node.right); 18680 }, 18681 [235 /* AsExpression */]: function forEachChildInAsExpression(node, cbNode, _cbNodes) { 18682 return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type); 18683 }, 18684 [236 /* NonNullExpression */]: function forEachChildInNonNullExpression(node, cbNode, _cbNodes) { 18685 return visitNode2(cbNode, node.expression); 18686 }, 18687 [239 /* SatisfiesExpression */]: function forEachChildInSatisfiesExpression(node, cbNode, _cbNodes) { 18688 return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.type); 18689 }, 18690 [237 /* MetaProperty */]: function forEachChildInMetaProperty(node, cbNode, _cbNodes) { 18691 return visitNode2(cbNode, node.name); 18692 }, 18693 [228 /* ConditionalExpression */]: function forEachChildInConditionalExpression(node, cbNode, _cbNodes) { 18694 return visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.questionToken) || visitNode2(cbNode, node.whenTrue) || visitNode2(cbNode, node.colonToken) || visitNode2(cbNode, node.whenFalse); 18695 }, 18696 [231 /* SpreadElement */]: function forEachChildInSpreadElement(node, cbNode, _cbNodes) { 18697 return visitNode2(cbNode, node.expression); 18698 }, 18699 [242 /* Block */]: forEachChildInBlock, 18700 [271 /* ModuleBlock */]: forEachChildInBlock, 18701 [314 /* SourceFile */]: function forEachChildInSourceFile(node, cbNode, cbNodes) { 18702 return visitNodes(cbNode, cbNodes, node.statements) || visitNode2(cbNode, node.endOfFileToken); 18703 }, 18704 [244 /* VariableStatement */]: function forEachChildInVariableStatement(node, cbNode, cbNodes) { 18705 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.declarationList); 18706 }, 18707 [262 /* VariableDeclarationList */]: function forEachChildInVariableDeclarationList(node, cbNode, cbNodes) { 18708 return visitNodes(cbNode, cbNodes, node.declarations); 18709 }, 18710 [245 /* ExpressionStatement */]: function forEachChildInExpressionStatement(node, cbNode, _cbNodes) { 18711 return visitNode2(cbNode, node.expression); 18712 }, 18713 [246 /* IfStatement */]: function forEachChildInIfStatement(node, cbNode, _cbNodes) { 18714 return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.thenStatement) || visitNode2(cbNode, node.elseStatement); 18715 }, 18716 [247 /* DoStatement */]: function forEachChildInDoStatement(node, cbNode, _cbNodes) { 18717 return visitNode2(cbNode, node.statement) || visitNode2(cbNode, node.expression); 18718 }, 18719 [248 /* WhileStatement */]: function forEachChildInWhileStatement(node, cbNode, _cbNodes) { 18720 return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); 18721 }, 18722 [249 /* ForStatement */]: function forEachChildInForStatement(node, cbNode, _cbNodes) { 18723 return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.condition) || visitNode2(cbNode, node.incrementor) || visitNode2(cbNode, node.statement); 18724 }, 18725 [250 /* ForInStatement */]: function forEachChildInForInStatement(node, cbNode, _cbNodes) { 18726 return visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); 18727 }, 18728 [251 /* ForOfStatement */]: function forEachChildInForOfStatement(node, cbNode, _cbNodes) { 18729 return visitNode2(cbNode, node.awaitModifier) || visitNode2(cbNode, node.initializer) || visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); 18730 }, 18731 [252 /* ContinueStatement */]: forEachChildInContinueOrBreakStatement, 18732 [253 /* BreakStatement */]: forEachChildInContinueOrBreakStatement, 18733 [254 /* ReturnStatement */]: function forEachChildInReturnStatement(node, cbNode, _cbNodes) { 18734 return visitNode2(cbNode, node.expression); 18735 }, 18736 [255 /* WithStatement */]: function forEachChildInWithStatement(node, cbNode, _cbNodes) { 18737 return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.statement); 18738 }, 18739 [256 /* SwitchStatement */]: function forEachChildInSwitchStatement(node, cbNode, _cbNodes) { 18740 return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.caseBlock); 18741 }, 18742 [272 /* CaseBlock */]: function forEachChildInCaseBlock(node, cbNode, cbNodes) { 18743 return visitNodes(cbNode, cbNodes, node.clauses); 18744 }, 18745 [298 /* CaseClause */]: function forEachChildInCaseClause(node, cbNode, cbNodes) { 18746 return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); 18747 }, 18748 [299 /* DefaultClause */]: function forEachChildInDefaultClause(node, cbNode, cbNodes) { 18749 return visitNodes(cbNode, cbNodes, node.statements); 18750 }, 18751 [257 /* LabeledStatement */]: function forEachChildInLabeledStatement(node, cbNode, _cbNodes) { 18752 return visitNode2(cbNode, node.label) || visitNode2(cbNode, node.statement); 18753 }, 18754 [258 /* ThrowStatement */]: function forEachChildInThrowStatement(node, cbNode, _cbNodes) { 18755 return visitNode2(cbNode, node.expression); 18756 }, 18757 [259 /* TryStatement */]: function forEachChildInTryStatement(node, cbNode, _cbNodes) { 18758 return visitNode2(cbNode, node.tryBlock) || visitNode2(cbNode, node.catchClause) || visitNode2(cbNode, node.finallyBlock); 18759 }, 18760 [301 /* CatchClause */]: function forEachChildInCatchClause(node, cbNode, _cbNodes) { 18761 return visitNode2(cbNode, node.variableDeclaration) || visitNode2(cbNode, node.block); 18762 }, 18763 [169 /* Decorator */]: function forEachChildInDecorator(node, cbNode, _cbNodes) { 18764 return visitNode2(cbNode, node.expression); 18765 }, 18766 [264 /* ClassDeclaration */]: forEachChildInClassDeclarationOrExpression, 18767 [232 /* ClassExpression */]: forEachChildInClassDeclarationOrExpression, 18768 [265 /* StructDeclaration */]: forEachChildInClassDeclarationOrExpression, 18769 [266 /* AnnotationDeclaration */]: forEachChildInAnnotationDeclaration, 18770 [267 /* InterfaceDeclaration */]: function forEachChildInInterfaceDeclaration(node, cbNode, cbNodes) { 18771 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); 18772 }, 18773 [268 /* TypeAliasDeclaration */]: function forEachChildInTypeAliasDeclaration(node, cbNode, cbNodes) { 18774 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode2(cbNode, node.type); 18775 }, 18776 [269 /* EnumDeclaration */]: function forEachChildInEnumDeclaration(node, cbNode, cbNodes) { 18777 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); 18778 }, 18779 [308 /* EnumMember */]: function forEachChildInEnumMember(node, cbNode, _cbNodes) { 18780 return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); 18781 }, 18782 [270 /* ModuleDeclaration */]: function forEachChildInModuleDeclaration(node, cbNode, cbNodes) { 18783 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.body); 18784 }, 18785 [274 /* ImportEqualsDeclaration */]: function forEachChildInImportEqualsDeclaration(node, cbNode, cbNodes) { 18786 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference); 18787 }, 18788 [275 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) { 18789 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); 18790 }, 18791 [276 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) { 18792 return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings); 18793 }, 18794 [302 /* AssertClause */]: function forEachChildInAssertClause(node, cbNode, cbNodes) { 18795 return visitNodes(cbNode, cbNodes, node.elements); 18796 }, 18797 [303 /* AssertEntry */]: function forEachChildInAssertEntry(node, cbNode, _cbNodes) { 18798 return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value); 18799 }, 18800 [273 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) { 18801 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNode2(cbNode, node.name); 18802 }, 18803 [277 /* NamespaceImport */]: function forEachChildInNamespaceImport(node, cbNode, _cbNodes) { 18804 return visitNode2(cbNode, node.name); 18805 }, 18806 [283 /* NamespaceExport */]: function forEachChildInNamespaceExport(node, cbNode, _cbNodes) { 18807 return visitNode2(cbNode, node.name); 18808 }, 18809 [278 /* NamedImports */]: forEachChildInNamedImportsOrExports, 18810 [282 /* NamedExports */]: forEachChildInNamedImportsOrExports, 18811 [281 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) { 18812 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause); 18813 }, 18814 [279 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier, 18815 [284 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier, 18816 [280 /* ExportAssignment */]: function forEachChildInExportAssignment(node, cbNode, cbNodes) { 18817 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.expression); 18818 }, 18819 [229 /* TemplateExpression */]: function forEachChildInTemplateExpression(node, cbNode, cbNodes) { 18820 return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); 18821 }, 18822 [240 /* TemplateSpan */]: function forEachChildInTemplateSpan(node, cbNode, _cbNodes) { 18823 return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.literal); 18824 }, 18825 [203 /* TemplateLiteralType */]: function forEachChildInTemplateLiteralType(node, cbNode, cbNodes) { 18826 return visitNode2(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); 18827 }, 18828 [204 /* TemplateLiteralTypeSpan */]: function forEachChildInTemplateLiteralTypeSpan(node, cbNode, _cbNodes) { 18829 return visitNode2(cbNode, node.type) || visitNode2(cbNode, node.literal); 18830 }, 18831 [166 /* ComputedPropertyName */]: function forEachChildInComputedPropertyName(node, cbNode, _cbNodes) { 18832 return visitNode2(cbNode, node.expression); 18833 }, 18834 [300 /* HeritageClause */]: function forEachChildInHeritageClause(node, cbNode, cbNodes) { 18835 return visitNodes(cbNode, cbNodes, node.types); 18836 }, 18837 [234 /* ExpressionWithTypeArguments */]: function forEachChildInExpressionWithTypeArguments(node, cbNode, cbNodes) { 18838 return visitNode2(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); 18839 }, 18840 [286 /* ExternalModuleReference */]: function forEachChildInExternalModuleReference(node, cbNode, _cbNodes) { 18841 return visitNode2(cbNode, node.expression); 18842 }, 18843 [285 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) { 18844 return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers); 18845 }, 18846 [360 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) { 18847 return visitNodes(cbNode, cbNodes, node.elements); 18848 }, 18849 [287 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) { 18850 return visitNode2(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingElement); 18851 }, 18852 [291 /* JsxFragment */]: function forEachChildInJsxFragment(node, cbNode, cbNodes) { 18853 return visitNode2(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode2(cbNode, node.closingFragment); 18854 }, 18855 [288 /* JsxSelfClosingElement */]: forEachChildInJsxOpeningOrSelfClosingElement, 18856 [289 /* JsxOpeningElement */]: forEachChildInJsxOpeningOrSelfClosingElement, 18857 [295 /* JsxAttributes */]: function forEachChildInJsxAttributes(node, cbNode, cbNodes) { 18858 return visitNodes(cbNode, cbNodes, node.properties); 18859 }, 18860 [294 /* JsxAttribute */]: function forEachChildInJsxAttribute(node, cbNode, _cbNodes) { 18861 return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.initializer); 18862 }, 18863 [296 /* JsxSpreadAttribute */]: function forEachChildInJsxSpreadAttribute(node, cbNode, _cbNodes) { 18864 return visitNode2(cbNode, node.expression); 18865 }, 18866 [297 /* JsxExpression */]: function forEachChildInJsxExpression(node, cbNode, _cbNodes) { 18867 return visitNode2(cbNode, node.dotDotDotToken) || visitNode2(cbNode, node.expression); 18868 }, 18869 [290 /* JsxClosingElement */]: function forEachChildInJsxClosingElement(node, cbNode, _cbNodes) { 18870 return visitNode2(cbNode, node.tagName); 18871 }, 18872 [190 /* OptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier, 18873 [191 /* RestType */]: forEachChildInOptionalRestOrJSDocParameterModifier, 18874 [318 /* JSDocTypeExpression */]: forEachChildInOptionalRestOrJSDocParameterModifier, 18875 [324 /* JSDocNonNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier, 18876 [323 /* JSDocNullableType */]: forEachChildInOptionalRestOrJSDocParameterModifier, 18877 [325 /* JSDocOptionalType */]: forEachChildInOptionalRestOrJSDocParameterModifier, 18878 [327 /* JSDocVariadicType */]: forEachChildInOptionalRestOrJSDocParameterModifier, 18879 [326 /* JSDocFunctionType */]: function forEachChildInJSDocFunctionType(node, cbNode, cbNodes) { 18880 return visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); 18881 }, 18882 [329 /* JSDoc */]: function forEachChildInJSDoc(node, cbNode, cbNodes) { 18883 return (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) || visitNodes(cbNode, cbNodes, node.tags); 18884 }, 18885 [355 /* JSDocSeeTag */]: function forEachChildInJSDocSeeTag(node, cbNode, cbNodes) { 18886 return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.name) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); 18887 }, 18888 [319 /* JSDocNameReference */]: function forEachChildInJSDocNameReference(node, cbNode, _cbNodes) { 18889 return visitNode2(cbNode, node.name); 18890 }, 18891 [320 /* JSDocMemberName */]: function forEachChildInJSDocMemberName(node, cbNode, _cbNodes) { 18892 return visitNode2(cbNode, node.left) || visitNode2(cbNode, node.right); 18893 }, 18894 [349 /* JSDocParameterTag */]: forEachChildInJSDocParameterOrPropertyTag, 18895 [356 /* JSDocPropertyTag */]: forEachChildInJSDocParameterOrPropertyTag, 18896 [339 /* JSDocAuthorTag */]: function forEachChildInJSDocAuthorTag(node, cbNode, cbNodes) { 18897 return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); 18898 }, 18899 [338 /* JSDocImplementsTag */]: function forEachChildInJSDocImplementsTag(node, cbNode, cbNodes) { 18900 return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); 18901 }, 18902 [337 /* JSDocAugmentsTag */]: function forEachChildInJSDocAugmentsTag(node, cbNode, cbNodes) { 18903 return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.class) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); 18904 }, 18905 [353 /* JSDocTemplateTag */]: function forEachChildInJSDocTemplateTag(node, cbNode, cbNodes) { 18906 return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.constraint) || visitNodes(cbNode, cbNodes, node.typeParameters) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); 18907 }, 18908 [354 /* JSDocTypedefTag */]: function forEachChildInJSDocTypedefTag(node, cbNode, cbNodes) { 18909 return visitNode2(cbNode, node.tagName) || (node.typeExpression && node.typeExpression.kind === 318 /* JSDocTypeExpression */ ? visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.fullName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)) : visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment))); 18910 }, 18911 [347 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) { 18912 return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); 18913 }, 18914 [350 /* JSDocReturnTag */]: forEachChildInJSDocReturnTag, 18915 [352 /* JSDocTypeTag */]: forEachChildInJSDocReturnTag, 18916 [351 /* JSDocThisTag */]: forEachChildInJSDocReturnTag, 18917 [348 /* JSDocEnumTag */]: forEachChildInJSDocReturnTag, 18918 [332 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) { 18919 return forEach(node.typeParameters, cbNode) || forEach(node.parameters, cbNode) || visitNode2(cbNode, node.type); 18920 }, 18921 [333 /* JSDocLink */]: forEachChildInJSDocLinkCodeOrPlain, 18922 [334 /* JSDocLinkCode */]: forEachChildInJSDocLinkCodeOrPlain, 18923 [335 /* JSDocLinkPlain */]: forEachChildInJSDocLinkCodeOrPlain, 18924 [331 /* JSDocTypeLiteral */]: function forEachChildInJSDocTypeLiteral(node, cbNode, _cbNodes) { 18925 return forEach(node.jsDocPropertyTags, cbNode); 18926 }, 18927 [336 /* JSDocTag */]: forEachChildInJSDocTag, 18928 [341 /* JSDocClassTag */]: forEachChildInJSDocTag, 18929 [342 /* JSDocPublicTag */]: forEachChildInJSDocTag, 18930 [343 /* JSDocPrivateTag */]: forEachChildInJSDocTag, 18931 [344 /* JSDocProtectedTag */]: forEachChildInJSDocTag, 18932 [345 /* JSDocReadonlyTag */]: forEachChildInJSDocTag, 18933 [340 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag, 18934 [346 /* JSDocOverrideTag */]: forEachChildInJSDocTag, 18935 [359 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression 18936}; 18937function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) { 18938 return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type); 18939} 18940function forEachChildInUnionOrIntersectionType(node, cbNode, cbNodes) { 18941 return visitNodes(cbNode, cbNodes, node.types); 18942} 18943function forEachChildInParenthesizedTypeOrTypeOperator(node, cbNode, _cbNodes) { 18944 return visitNode2(cbNode, node.type); 18945} 18946function forEachChildInObjectOrArrayBindingPattern(node, cbNode, cbNodes) { 18947 return visitNodes(cbNode, cbNodes, node.elements); 18948} 18949function forEachChildInCallOrNewExpression(node, cbNode, cbNodes) { 18950 return visitNode2(cbNode, node.expression) || visitNode2(cbNode, node.questionDotToken) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); 18951} 18952function forEachChildInBlock(node, cbNode, cbNodes) { 18953 return visitNodes(cbNode, cbNodes, node.statements); 18954} 18955function forEachChildInContinueOrBreakStatement(node, cbNode, _cbNodes) { 18956 return visitNode2(cbNode, node.label); 18957} 18958function forEachChildInClassDeclarationOrExpression(node, cbNode, cbNodes) { 18959 return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); 18960} 18961function forEachChildInAnnotationDeclaration(node, cbNode, cbNodes) { 18962 return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); 18963} 18964function forEachChildInNamedImportsOrExports(node, cbNode, cbNodes) { 18965 return visitNodes(cbNode, cbNodes, node.elements); 18966} 18967function forEachChildInImportOrExportSpecifier(node, cbNode, _cbNodes) { 18968 return visitNode2(cbNode, node.propertyName) || visitNode2(cbNode, node.name); 18969} 18970function forEachChildInJsxOpeningOrSelfClosingElement(node, cbNode, cbNodes) { 18971 return visitNode2(cbNode, node.tagName) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNode2(cbNode, node.attributes); 18972} 18973function forEachChildInOptionalRestOrJSDocParameterModifier(node, cbNode, _cbNodes) { 18974 return visitNode2(cbNode, node.type); 18975} 18976function forEachChildInJSDocParameterOrPropertyTag(node, cbNode, cbNodes) { 18977 return visitNode2(cbNode, node.tagName) || (node.isNameFirst ? visitNode2(cbNode, node.name) || visitNode2(cbNode, node.typeExpression) : visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.name)) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); 18978} 18979function forEachChildInJSDocReturnTag(node, cbNode, cbNodes) { 18980 return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); 18981} 18982function forEachChildInJSDocLinkCodeOrPlain(node, cbNode, _cbNodes) { 18983 return visitNode2(cbNode, node.name); 18984} 18985function forEachChildInJSDocTag(node, cbNode, cbNodes) { 18986 return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment)); 18987} 18988function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) { 18989 return visitNode2(cbNode, node.expression); 18990} 18991function forEachChild(node, cbNode, cbNodes) { 18992 if (node === void 0 || node.kind <= 164 /* LastToken */) { 18993 return; 18994 } 18995 const fn = forEachChildTable[node.kind]; 18996 return fn === void 0 ? void 0 : fn(node, cbNode, cbNodes); 18997} 18998function forEachChildRecursively(rootNode, cbNode, cbNodes) { 18999 const queue = gatherPossibleChildren(rootNode); 19000 const parents = []; 19001 while (parents.length < queue.length) { 19002 parents.push(rootNode); 19003 } 19004 while (queue.length !== 0) { 19005 const current = queue.pop(); 19006 const parent = parents.pop(); 19007 if (isArray(current)) { 19008 if (cbNodes) { 19009 const res = cbNodes(current, parent); 19010 if (res) { 19011 if (res === "skip") 19012 continue; 19013 return res; 19014 } 19015 } 19016 for (let i = current.length - 1; i >= 0; --i) { 19017 queue.push(current[i]); 19018 parents.push(parent); 19019 } 19020 } else { 19021 const res = cbNode(current, parent); 19022 if (res) { 19023 if (res === "skip") 19024 continue; 19025 return res; 19026 } 19027 if (current.kind >= 165 /* FirstNode */) { 19028 for (const child of gatherPossibleChildren(current)) { 19029 queue.push(child); 19030 parents.push(current); 19031 } 19032 } 19033 } 19034 } 19035} 19036function gatherPossibleChildren(node) { 19037 const children = []; 19038 forEachChild(node, addWorkItem, addWorkItem); 19039 return children; 19040 function addWorkItem(n) { 19041 children.unshift(n); 19042 } 19043} 19044function setExternalModuleIndicator(sourceFile) { 19045 sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile); 19046} 19047var sourceFileCompilerOptions; 19048var isArkguardInputSourceFile = false; 19049function parseJsonText(fileName, sourceText) { 19050 return Parser.parseJsonText(fileName, sourceText); 19051} 19052function isExternalModule(file) { 19053 return file.externalModuleIndicator !== void 0; 19054} 19055var languageVersionCallBack; 19056var Parser; 19057((Parser2) => { 19058 var scanner = createScanner(99 /* Latest */, true); 19059 var disallowInAndDecoratorContext = 4096 /* DisallowInContext */ | 16384 /* DecoratorContext */; 19060 var NodeConstructor2; 19061 var TokenConstructor2; 19062 var IdentifierConstructor2; 19063 var PrivateIdentifierConstructor2; 19064 var SourceFileConstructor2; 19065 function countNode(node) { 19066 nodeCount++; 19067 return node; 19068 } 19069 var baseNodeFactory = { 19070 createBaseSourceFileNode: (kind) => countNode(new SourceFileConstructor2(kind, 0, 0)), 19071 createBaseIdentifierNode: (kind) => countNode(new IdentifierConstructor2(kind, 0, 0)), 19072 createBasePrivateIdentifierNode: (kind) => countNode(new PrivateIdentifierConstructor2(kind, 0, 0)), 19073 createBaseTokenNode: (kind) => countNode(new TokenConstructor2(kind, 0, 0)), 19074 createBaseNode: (kind) => countNode(new NodeConstructor2(kind, 0, 0)) 19075 }; 19076 var factory2 = createNodeFactory(1 /* NoParenthesizerRules */ | 2 /* NoNodeConverters */ | 8 /* NoOriginalNode */, baseNodeFactory); 19077 var fileName; 19078 var sourceFlags; 19079 var sourceText; 19080 var languageVersion; 19081 var scriptKind; 19082 var languageVariant; 19083 var parseDiagnostics; 19084 var jsDocDiagnostics; 19085 var syntaxCursor; 19086 var currentToken; 19087 var nodeCount; 19088 var identifiers; 19089 var privateIdentifiers; 19090 var identifierCount; 19091 var parsingContext; 19092 var notParenthesizedArrow; 19093 var contextFlags; 19094 var etsFlags; 19095 var topLevel = true; 19096 var parseErrorBeforeNextFinishedNode = false; 19097 var extendEtsComponentDeclaration; 19098 var stylesEtsComponentDeclaration; 19099 var fileStylesComponents = new Map2(); 19100 var currentStructName; 19101 var stateStylesRootNode; 19102 var structStylesComponents = new Map2(); 19103 function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride) { 19104 var _a2; 19105 scriptKind2 = ensureScriptKind(fileName2, scriptKind2); 19106 if (scriptKind2 === 6 /* JSON */) { 19107 const result2 = parseJsonText2(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes); 19108 convertToObjectWorker(result2, (_a2 = result2.statements[0]) == null ? void 0 : _a2.expression, result2.parseDiagnostics, false, void 0, void 0); 19109 result2.referencedFiles = emptyArray; 19110 result2.typeReferenceDirectives = emptyArray; 19111 result2.libReferenceDirectives = emptyArray; 19112 result2.amdDependencies = emptyArray; 19113 result2.hasNoDefaultLib = false; 19114 result2.pragmas = emptyMap; 19115 return result2; 19116 } 19117 initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2); 19118 const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator); 19119 clearState(); 19120 return result; 19121 } 19122 Parser2.parseSourceFile = parseSourceFile; 19123 function parseIsolatedEntityName2(content, languageVersion2) { 19124 initializeState("", content, languageVersion2, void 0, 1 /* JS */); 19125 nextToken(); 19126 const entityName = parseEntityName(true); 19127 const isInvalid = token() === 1 /* EndOfFileToken */ && !parseDiagnostics.length; 19128 clearState(); 19129 return isInvalid ? entityName : void 0; 19130 } 19131 Parser2.parseIsolatedEntityName = parseIsolatedEntityName2; 19132 function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) { 19133 initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */); 19134 sourceFlags = contextFlags; 19135 nextToken(); 19136 const pos = getNodePos(); 19137 let statements, endOfFileToken; 19138 if (token() === 1 /* EndOfFileToken */) { 19139 statements = createNodeArray([], pos, pos); 19140 endOfFileToken = parseTokenNode(); 19141 } else { 19142 let expressions; 19143 while (token() !== 1 /* EndOfFileToken */) { 19144 let expression2; 19145 switch (token()) { 19146 case 22 /* OpenBracketToken */: 19147 expression2 = parseArrayLiteralExpression(); 19148 break; 19149 case 111 /* TrueKeyword */: 19150 case 96 /* FalseKeyword */: 19151 case 105 /* NullKeyword */: 19152 expression2 = parseTokenNode(); 19153 break; 19154 case 40 /* MinusToken */: 19155 if (lookAhead(() => nextToken() === 8 /* NumericLiteral */ && nextToken() !== 58 /* ColonToken */)) { 19156 expression2 = parsePrefixUnaryExpression(); 19157 } else { 19158 expression2 = parseObjectLiteralExpression(); 19159 } 19160 break; 19161 case 8 /* NumericLiteral */: 19162 case 10 /* StringLiteral */: 19163 if (lookAhead(() => nextToken() !== 58 /* ColonToken */)) { 19164 expression2 = parseLiteralNode(); 19165 break; 19166 } 19167 default: 19168 expression2 = parseObjectLiteralExpression(); 19169 break; 19170 } 19171 if (expressions && isArray(expressions)) { 19172 expressions.push(expression2); 19173 } else if (expressions) { 19174 expressions = [expressions, expression2]; 19175 } else { 19176 expressions = expression2; 19177 if (token() !== 1 /* EndOfFileToken */) { 19178 parseErrorAtCurrentToken(Diagnostics.Unexpected_token); 19179 } 19180 } 19181 } 19182 const expression = isArray(expressions) ? finishNode(factory2.createArrayLiteralExpression(expressions), pos) : Debug.checkDefined(expressions); 19183 const statement = factory2.createExpressionStatement(expression); 19184 finishNode(statement, pos); 19185 statements = createNodeArray([statement], pos); 19186 endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, Diagnostics.Unexpected_token); 19187 } 19188 const sourceFile = createSourceFile2(fileName2, 2 /* ES2015 */, 6 /* JSON */, false, statements, endOfFileToken, sourceFlags, noop); 19189 if (setParentNodes) { 19190 fixupParentReferences(sourceFile); 19191 } 19192 sourceFile.nodeCount = nodeCount; 19193 sourceFile.identifierCount = identifierCount; 19194 sourceFile.identifiers = identifiers; 19195 sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile); 19196 if (jsDocDiagnostics) { 19197 sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile); 19198 } 19199 const result = sourceFile; 19200 clearState(); 19201 return result; 19202 } 19203 Parser2.parseJsonText = parseJsonText2; 19204 function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind) { 19205 NodeConstructor2 = objectAllocator.getNodeConstructor(); 19206 TokenConstructor2 = objectAllocator.getTokenConstructor(); 19207 IdentifierConstructor2 = objectAllocator.getIdentifierConstructor(); 19208 PrivateIdentifierConstructor2 = objectAllocator.getPrivateIdentifierConstructor(); 19209 SourceFileConstructor2 = objectAllocator.getSourceFileConstructor(); 19210 fileName = normalizePath(_fileName); 19211 sourceText = _sourceText; 19212 languageVersion = _languageVersion; 19213 syntaxCursor = _syntaxCursor; 19214 scriptKind = _scriptKind; 19215 languageVariant = getLanguageVariant(_scriptKind); 19216 parseDiagnostics = []; 19217 parsingContext = 0; 19218 identifiers = new Map2(); 19219 privateIdentifiers = new Map2(); 19220 identifierCount = 0; 19221 nodeCount = 0; 19222 sourceFlags = 0; 19223 topLevel = true; 19224 switch (scriptKind) { 19225 case 1 /* JS */: 19226 case 2 /* JSX */: 19227 contextFlags = 262144 /* JavaScriptFile */; 19228 break; 19229 case 6 /* JSON */: 19230 contextFlags = 262144 /* JavaScriptFile */ | 67108864 /* JsonFile */; 19231 break; 19232 case 8 /* ETS */: 19233 contextFlags = 1073741824 /* EtsContext */; 19234 break; 19235 default: 19236 contextFlags = 0 /* None */; 19237 break; 19238 } 19239 if (fileName.endsWith(".ets" /* Ets */)) { 19240 contextFlags = 1073741824 /* EtsContext */; 19241 } 19242 parseErrorBeforeNextFinishedNode = false; 19243 scanner.setText(sourceText); 19244 scanner.setOnError(scanError); 19245 scanner.setScriptTarget(languageVersion); 19246 scanner.setLanguageVariant(languageVariant); 19247 scanner.setEtsContext(inEtsContext()); 19248 } 19249 function clearState() { 19250 scanner.clearCommentDirectives(); 19251 scanner.setText(""); 19252 scanner.setOnError(void 0); 19253 scanner.setEtsContext(false); 19254 sourceText = void 0; 19255 languageVersion = void 0; 19256 syntaxCursor = void 0; 19257 scriptKind = void 0; 19258 languageVariant = void 0; 19259 sourceFlags = 0; 19260 parseDiagnostics = void 0; 19261 jsDocDiagnostics = void 0; 19262 parsingContext = 0; 19263 identifiers = void 0; 19264 notParenthesizedArrow = void 0; 19265 topLevel = true; 19266 extendEtsComponentDeclaration = void 0; 19267 stylesEtsComponentDeclaration = void 0; 19268 stateStylesRootNode = void 0; 19269 fileStylesComponents.clear(); 19270 structStylesComponents.clear(); 19271 } 19272 function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2) { 19273 const isDeclarationFile = isDeclarationFileName(fileName); 19274 if (isDeclarationFile) { 19275 contextFlags |= 16777216 /* Ambient */; 19276 } 19277 sourceFlags = contextFlags; 19278 nextToken(); 19279 let statements = parseList(ParsingContext.SourceElements, parseStatement); 19280 const markedkitImportRanges = new Array(); 19281 const sdkPath = getSdkPath(sourceFileCompilerOptions); 19282 statements = !!sourceFileCompilerOptions.noTransformedKitInParser || !sdkPath || parseDiagnostics.length || (languageVersionCallBack == null ? void 0 : languageVersionCallBack(fileName)) ? statements : createNodeArray(processKit(factory2, statements, sdkPath, markedkitImportRanges, inEtsContext(), sourceFileCompilerOptions), statements.pos); 19283 Debug.assert(token() === 1 /* EndOfFileToken */); 19284 const endOfFileToken = addJSDocComment(parseTokenNode()); 19285 const sourceFile = createSourceFile2(fileName, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator2); 19286 if (markedkitImportRanges.length > 0) { 19287 sourceFile.markedKitImportRange = markedkitImportRanges; 19288 } 19289 processCommentPragmas(sourceFile, sourceText); 19290 processPragmasIntoFields(sourceFile, reportPragmaDiagnostic); 19291 sourceFile.commentDirectives = scanner.getCommentDirectives(); 19292 sourceFile.nodeCount = nodeCount; 19293 sourceFile.identifierCount = identifierCount; 19294 sourceFile.identifiers = identifiers; 19295 sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile); 19296 if (jsDocDiagnostics) { 19297 sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile); 19298 } 19299 if (setParentNodes) { 19300 fixupParentReferences(sourceFile); 19301 } 19302 return sourceFile; 19303 function reportPragmaDiagnostic(pos, end, diagnostic) { 19304 parseDiagnostics.push(createDetachedDiagnostic(fileName, pos, end, diagnostic)); 19305 } 19306 } 19307 function withJSDoc(node, hasJSDoc) { 19308 return hasJSDoc ? addJSDocComment(node) : node; 19309 } 19310 let hasDeprecatedTag = false; 19311 function addJSDocComment(node) { 19312 Debug.assert(!node.jsDoc); 19313 const jsDoc = mapDefined(getJSDocCommentRanges(node, sourceText), (comment) => JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos)); 19314 if (jsDoc.length) 19315 node.jsDoc = jsDoc; 19316 if (hasDeprecatedTag) { 19317 hasDeprecatedTag = false; 19318 node.flags |= 268435456 /* Deprecated */; 19319 } 19320 return node; 19321 } 19322 function reparseTopLevelAwait(sourceFile) { 19323 const savedSyntaxCursor = syntaxCursor; 19324 const baseSyntaxCursor = IncrementalParser.createSyntaxCursor(sourceFile); 19325 syntaxCursor = { currentNode: currentNode2 }; 19326 const statements = []; 19327 const savedParseDiagnostics = parseDiagnostics; 19328 parseDiagnostics = []; 19329 let pos = 0; 19330 let start = findNextStatementWithAwait(sourceFile.statements, 0); 19331 while (start !== -1) { 19332 const prevStatement = sourceFile.statements[pos]; 19333 const nextStatement = sourceFile.statements[start]; 19334 addRange(statements, sourceFile.statements, pos, start); 19335 pos = findNextStatementWithoutAwait(sourceFile.statements, start); 19336 const diagnosticStart = findIndex(savedParseDiagnostics, (diagnostic) => diagnostic.start >= prevStatement.pos); 19337 const diagnosticEnd = diagnosticStart >= 0 ? findIndex(savedParseDiagnostics, (diagnostic) => diagnostic.start >= nextStatement.pos, diagnosticStart) : -1; 19338 if (diagnosticStart >= 0) { 19339 addRange(parseDiagnostics, savedParseDiagnostics, diagnosticStart, diagnosticEnd >= 0 ? diagnosticEnd : void 0); 19340 } 19341 speculationHelper(() => { 19342 const savedContextFlags = contextFlags; 19343 contextFlags |= 32768 /* AwaitContext */; 19344 scanner.setTextPos(nextStatement.pos); 19345 nextToken(); 19346 while (token() !== 1 /* EndOfFileToken */) { 19347 const startPos = scanner.getStartPos(); 19348 const statement = parseListElement(ParsingContext.SourceElements, parseStatement); 19349 statements.push(statement); 19350 if (startPos === scanner.getStartPos()) { 19351 nextToken(); 19352 } 19353 if (pos >= 0) { 19354 const nonAwaitStatement = sourceFile.statements[pos]; 19355 if (statement.end === nonAwaitStatement.pos) { 19356 break; 19357 } 19358 if (statement.end > nonAwaitStatement.pos) { 19359 pos = findNextStatementWithoutAwait(sourceFile.statements, pos + 1); 19360 } 19361 } 19362 } 19363 contextFlags = savedContextFlags; 19364 }, 2 /* Reparse */); 19365 start = pos >= 0 ? findNextStatementWithAwait(sourceFile.statements, pos) : -1; 19366 } 19367 if (pos >= 0) { 19368 const prevStatement = sourceFile.statements[pos]; 19369 addRange(statements, sourceFile.statements, pos); 19370 const diagnosticStart = findIndex(savedParseDiagnostics, (diagnostic) => diagnostic.start >= prevStatement.pos); 19371 if (diagnosticStart >= 0) { 19372 addRange(parseDiagnostics, savedParseDiagnostics, diagnosticStart); 19373 } 19374 } 19375 syntaxCursor = savedSyntaxCursor; 19376 return factory2.updateSourceFile(sourceFile, setTextRange(factory2.createNodeArray(statements), sourceFile.statements)); 19377 function containsPossibleTopLevelAwait(node) { 19378 return !(node.flags & 32768 /* AwaitContext */) && !!(node.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */); 19379 } 19380 function findNextStatementWithAwait(statements2, start2) { 19381 for (let i = start2; i < statements2.length; i++) { 19382 if (containsPossibleTopLevelAwait(statements2[i])) { 19383 return i; 19384 } 19385 } 19386 return -1; 19387 } 19388 function findNextStatementWithoutAwait(statements2, start2) { 19389 for (let i = start2; i < statements2.length; i++) { 19390 if (!containsPossibleTopLevelAwait(statements2[i])) { 19391 return i; 19392 } 19393 } 19394 return -1; 19395 } 19396 function currentNode2(position) { 19397 const node = baseSyntaxCursor.currentNode(position); 19398 if (topLevel && node && containsPossibleTopLevelAwait(node)) { 19399 node.intersectsChange = true; 19400 } 19401 return node; 19402 } 19403 } 19404 function fixupParentReferences(rootNode) { 19405 setParentRecursive(rootNode, true); 19406 } 19407 Parser2.fixupParentReferences = fixupParentReferences; 19408 function createSourceFile2(fileName2, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, flags, setExternalModuleIndicator2) { 19409 let sourceFile = factory2.createSourceFile(statements, endOfFileToken, flags); 19410 setTextRangePosWidth(sourceFile, 0, sourceText.length); 19411 setFields(sourceFile); 19412 if (!isDeclarationFile && isExternalModule(sourceFile) && sourceFile.transformFlags & 67108864 /* ContainsPossibleTopLevelAwait */) { 19413 sourceFile = reparseTopLevelAwait(sourceFile); 19414 setFields(sourceFile); 19415 } 19416 return sourceFile; 19417 function setFields(sourceFile2) { 19418 sourceFile2.text = sourceText; 19419 sourceFile2.bindDiagnostics = []; 19420 sourceFile2.bindSuggestionDiagnostics = void 0; 19421 sourceFile2.languageVersion = languageVersion2; 19422 sourceFile2.fileName = fileName2; 19423 sourceFile2.languageVariant = getLanguageVariant(scriptKind2); 19424 sourceFile2.isDeclarationFile = isDeclarationFile; 19425 sourceFile2.scriptKind = scriptKind2; 19426 setExternalModuleIndicator2(sourceFile2); 19427 sourceFile2.setExternalModuleIndicator = setExternalModuleIndicator2; 19428 } 19429 } 19430 function setContextFlag(val, flag) { 19431 if (val) { 19432 contextFlags |= flag; 19433 } else { 19434 contextFlags &= ~flag; 19435 } 19436 } 19437 function setEtsFlag(val, flag) { 19438 if (val) { 19439 etsFlags |= flag; 19440 } else { 19441 etsFlags &= ~flag; 19442 } 19443 } 19444 function setDisallowInContext(val) { 19445 setContextFlag(val, 4096 /* DisallowInContext */); 19446 } 19447 function setYieldContext(val) { 19448 setContextFlag(val, 8192 /* YieldContext */); 19449 } 19450 function setDecoratorContext(val) { 19451 setContextFlag(val, 16384 /* DecoratorContext */); 19452 } 19453 function setAwaitContext(val) { 19454 setContextFlag(val, 32768 /* AwaitContext */); 19455 } 19456 function setStructContext(val) { 19457 setEtsFlag(val, 2 /* StructContext */); 19458 } 19459 function setEtsComponentsContext(val) { 19460 setEtsFlag(val, 128 /* EtsComponentsContext */); 19461 } 19462 function setEtsNewExpressionContext(val) { 19463 setEtsFlag(val, 256 /* EtsNewExpressionContext */); 19464 } 19465 function setEtsExtendComponentsContext(val) { 19466 setEtsFlag(val, 4 /* EtsExtendComponentsContext */); 19467 } 19468 function setEtsStylesComponentsContext(val) { 19469 setEtsFlag(val, 8 /* EtsStylesComponentsContext */); 19470 } 19471 function setEtsBuildContext(val) { 19472 setEtsFlag(val, 16 /* EtsBuildContext */); 19473 } 19474 function setEtsBuilderContext(val) { 19475 setEtsFlag(val, 32 /* EtsBuilderContext */); 19476 } 19477 function setEtsStateStylesContext(val) { 19478 setEtsFlag(val, 64 /* EtsStateStylesContext */); 19479 } 19480 function setUICallbackContext(val) { 19481 setEtsFlag(val, 512 /* UICallbackContext */); 19482 } 19483 function setSyntaxComponentContext(val) { 19484 setEtsFlag(val, 1024 /* SyntaxComponentContext */); 19485 } 19486 function setSyntaxDataSourceContext(val) { 19487 setEtsFlag(val, 2048 /* SyntaxDataSourceContext */); 19488 } 19489 function setNoEtsComponentContext(val) { 19490 setEtsFlag(val, 4096 /* NoEtsComponentContext */); 19491 } 19492 let firstArgumentExpression = false; 19493 function setFirstArgumentExpression(val) { 19494 firstArgumentExpression = val; 19495 } 19496 function getFirstArgumentExpression() { 19497 return firstArgumentExpression; 19498 } 19499 let repeatEachRest = false; 19500 function setRepeatEachRest(val) { 19501 repeatEachRest = val; 19502 } 19503 function getRepeatEachRest() { 19504 return repeatEachRest; 19505 } 19506 function doOutsideOfContext(context, func) { 19507 const contextFlagsToClear = context & contextFlags; 19508 if (contextFlagsToClear) { 19509 setContextFlag(false, contextFlagsToClear); 19510 const result = func(); 19511 setContextFlag(true, contextFlagsToClear); 19512 return result; 19513 } 19514 return func(); 19515 } 19516 function doInsideOfContext(context, func) { 19517 const contextFlagsToSet = context & ~contextFlags; 19518 if (contextFlagsToSet) { 19519 setContextFlag(true, contextFlagsToSet); 19520 const result = func(); 19521 setContextFlag(false, contextFlagsToSet); 19522 return result; 19523 } 19524 return func(); 19525 } 19526 function allowInAnd(func) { 19527 return doOutsideOfContext(4096 /* DisallowInContext */, func); 19528 } 19529 function disallowInAnd(func) { 19530 return doInsideOfContext(4096 /* DisallowInContext */, func); 19531 } 19532 function allowConditionalTypesAnd(func) { 19533 return doOutsideOfContext(65536 /* DisallowConditionalTypesContext */, func); 19534 } 19535 function disallowConditionalTypesAnd(func) { 19536 return doInsideOfContext(65536 /* DisallowConditionalTypesContext */, func); 19537 } 19538 function doInYieldContext(func) { 19539 return doInsideOfContext(8192 /* YieldContext */, func); 19540 } 19541 function doInDecoratorContext(func) { 19542 var _a2, _b, _c, _d, _e, _f; 19543 const extendDecorator = (_c = (_b = (_a2 = sourceFileCompilerOptions.ets) == null ? void 0 : _a2.extend) == null ? void 0 : _b.decorator) != null ? _c : "Extend"; 19544 if (token() === 79 /* Identifier */ && scanner.getTokenText() === extendDecorator) { 19545 setEtsFlag(true, 4 /* EtsExtendComponentsContext */); 19546 } 19547 const stylesDecorator = (_f = (_e = (_d = sourceFileCompilerOptions.ets) == null ? void 0 : _d.styles) == null ? void 0 : _e.decorator) != null ? _f : "Styles"; 19548 if (token() === 79 /* Identifier */ && scanner.getTokenText() === stylesDecorator) { 19549 setEtsFlag(true, 8 /* EtsStylesComponentsContext */); 19550 } 19551 return doInsideOfContext(16384 /* DecoratorContext */, func); 19552 } 19553 function doInAwaitContext(func) { 19554 return doInsideOfContext(32768 /* AwaitContext */, func); 19555 } 19556 function doOutsideOfAwaitContext(func) { 19557 return doOutsideOfContext(32768 /* AwaitContext */, func); 19558 } 19559 function doInYieldAndAwaitContext(func) { 19560 return doInsideOfContext(8192 /* YieldContext */ | 32768 /* AwaitContext */, func); 19561 } 19562 function doOutsideOfYieldAndAwaitContext(func) { 19563 return doOutsideOfContext(8192 /* YieldContext */ | 32768 /* AwaitContext */, func); 19564 } 19565 function inContext(flags) { 19566 return (contextFlags & flags) !== 0; 19567 } 19568 function inEtsFlagsContext(flags) { 19569 return (etsFlags & flags) !== 0; 19570 } 19571 function inYieldContext() { 19572 return inContext(8192 /* YieldContext */); 19573 } 19574 function inDisallowInContext() { 19575 return inContext(4096 /* DisallowInContext */); 19576 } 19577 function inDisallowConditionalTypesContext() { 19578 return inContext(65536 /* DisallowConditionalTypesContext */); 19579 } 19580 function inDecoratorContext() { 19581 return inContext(16384 /* DecoratorContext */); 19582 } 19583 function inAwaitContext() { 19584 return inContext(32768 /* AwaitContext */); 19585 } 19586 function parseErrorAtCurrentToken(message, arg0) { 19587 return parseErrorAt(scanner.getTokenPos(), scanner.getTextPos(), message, arg0); 19588 } 19589 function inEtsContext() { 19590 return inContext(1073741824 /* EtsContext */); 19591 } 19592 function inStructContext() { 19593 return inEtsContext() && inEtsFlagsContext(2 /* StructContext */); 19594 } 19595 function inEtsComponentsContext() { 19596 return inEtsContext() && inEtsFlagsContext(128 /* EtsComponentsContext */); 19597 } 19598 function inEtsNewExpressionContext() { 19599 return inEtsContext() && inEtsFlagsContext(256 /* EtsNewExpressionContext */); 19600 } 19601 function inEtsExtendComponentsContext() { 19602 return inEtsContext() && inEtsFlagsContext(4 /* EtsExtendComponentsContext */); 19603 } 19604 function inEtsStylesComponentsContext() { 19605 return inEtsContext() && inEtsFlagsContext(8 /* EtsStylesComponentsContext */); 19606 } 19607 function inBuildContext() { 19608 return inEtsContext() && inStructContext() && inEtsFlagsContext(16 /* EtsBuildContext */); 19609 } 19610 function inBuilderContext() { 19611 return inEtsContext() && inEtsFlagsContext(32 /* EtsBuilderContext */); 19612 } 19613 function inEtsStateStylesContext() { 19614 return inEtsContext() && (inBuildContext() || inBuilderContext() || inEtsExtendComponentsContext() || inEtsStylesComponentsContext()) && inEtsFlagsContext(64 /* EtsStateStylesContext */); 19615 } 19616 function inUICallbackContext() { 19617 return inEtsContext() && (inBuildContext() || inBuilderContext()) && inEtsFlagsContext(512 /* UICallbackContext */); 19618 } 19619 function inSyntaxComponentContext() { 19620 return inEtsContext() && (inBuildContext() || inBuilderContext()) && inEtsFlagsContext(1024 /* SyntaxComponentContext */); 19621 } 19622 function inSyntaxDataSourceContext() { 19623 return inEtsContext() && (inBuildContext() || inBuilderContext()) && inEtsFlagsContext(2048 /* SyntaxDataSourceContext */); 19624 } 19625 function inNoEtsComponentContext() { 19626 return inEtsContext() && (inBuildContext() || inBuilderContext()) && inEtsFlagsContext(4096 /* NoEtsComponentContext */); 19627 } 19628 function inAllowAnnotationContext() { 19629 return (inEtsContext() || isArkguardInputSourceFile) && (sourceFileCompilerOptions == null ? void 0 : sourceFileCompilerOptions.etsAnnotationsEnable) === true; 19630 } 19631 function parseErrorAtPosition(start, length2, message, arg0) { 19632 const lastError = lastOrUndefined(parseDiagnostics); 19633 let result; 19634 if (!lastError || start !== lastError.start) { 19635 result = createDetachedDiagnostic(fileName, start, length2, message, arg0); 19636 parseDiagnostics.push(result); 19637 } 19638 parseErrorBeforeNextFinishedNode = true; 19639 return result; 19640 } 19641 function parseErrorAt(start, end, message, arg0) { 19642 return parseErrorAtPosition(start, end - start, message, arg0); 19643 } 19644 function parseErrorAtRange(range, message, arg0) { 19645 parseErrorAt(range.pos, range.end, message, arg0); 19646 } 19647 function scanError(message, length2) { 19648 parseErrorAtPosition(scanner.getTextPos(), length2, message); 19649 } 19650 function getNodePos() { 19651 return scanner.getStartPos(); 19652 } 19653 function hasPrecedingJSDocComment() { 19654 return scanner.hasPrecedingJSDocComment(); 19655 } 19656 function token() { 19657 return currentToken; 19658 } 19659 function nextTokenWithoutCheck() { 19660 return currentToken = scanner.scan(); 19661 } 19662 function nextTokenAnd(func) { 19663 nextToken(); 19664 return func(); 19665 } 19666 function nextToken() { 19667 if (isKeyword(currentToken) && (scanner.hasUnicodeEscape() || scanner.hasExtendedUnicodeEscape())) { 19668 parseErrorAt(scanner.getTokenPos(), scanner.getTextPos(), Diagnostics.Keywords_cannot_contain_escape_characters); 19669 } 19670 return nextTokenWithoutCheck(); 19671 } 19672 function nextTokenJSDoc() { 19673 return currentToken = scanner.scanJsDocToken(); 19674 } 19675 function reScanGreaterToken() { 19676 return currentToken = scanner.reScanGreaterToken(); 19677 } 19678 function reScanSlashToken() { 19679 return currentToken = scanner.reScanSlashToken(); 19680 } 19681 function reScanTemplateToken(isTaggedTemplate) { 19682 return currentToken = scanner.reScanTemplateToken(isTaggedTemplate); 19683 } 19684 function reScanTemplateHeadOrNoSubstitutionTemplate() { 19685 return currentToken = scanner.reScanTemplateHeadOrNoSubstitutionTemplate(); 19686 } 19687 function reScanLessThanToken() { 19688 return currentToken = scanner.reScanLessThanToken(); 19689 } 19690 function reScanHashToken() { 19691 return currentToken = scanner.reScanHashToken(); 19692 } 19693 function scanJsxIdentifier() { 19694 return currentToken = scanner.scanJsxIdentifier(); 19695 } 19696 function scanJsxText() { 19697 return currentToken = scanner.scanJsxToken(); 19698 } 19699 function scanJsxAttributeValue() { 19700 return currentToken = scanner.scanJsxAttributeValue(); 19701 } 19702 function speculationHelper(callback, speculationKind) { 19703 const saveToken = currentToken; 19704 const saveParseDiagnosticsLength = parseDiagnostics.length; 19705 const saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; 19706 const saveContextFlags = contextFlags; 19707 const result = speculationKind !== 0 /* TryParse */ ? scanner.lookAhead(callback) : scanner.tryScan(callback); 19708 Debug.assert(saveContextFlags === contextFlags); 19709 if (!result || speculationKind !== 0 /* TryParse */) { 19710 currentToken = saveToken; 19711 if (speculationKind !== 2 /* Reparse */) { 19712 parseDiagnostics.length = saveParseDiagnosticsLength; 19713 } 19714 parseErrorBeforeNextFinishedNode = saveParseErrorBeforeNextFinishedNode; 19715 } 19716 return result; 19717 } 19718 function lookAhead(callback) { 19719 return speculationHelper(callback, 1 /* Lookahead */); 19720 } 19721 function tryParse(callback) { 19722 return speculationHelper(callback, 0 /* TryParse */); 19723 } 19724 function isBindingIdentifier() { 19725 if (token() === 79 /* Identifier */) { 19726 return true; 19727 } 19728 return token() > 117 /* LastReservedWord */; 19729 } 19730 function isIdentifier2() { 19731 if (token() === 79 /* Identifier */) { 19732 return true; 19733 } 19734 if (token() === 126 /* YieldKeyword */ && inYieldContext()) { 19735 return false; 19736 } 19737 if (token() === 134 /* AwaitKeyword */ && inAwaitContext()) { 19738 return false; 19739 } 19740 return token() > 117 /* LastReservedWord */; 19741 } 19742 function parseExpected(kind, diagnosticMessage, shouldAdvance = true) { 19743 if (token() === kind) { 19744 if (shouldAdvance) { 19745 nextToken(); 19746 } 19747 return true; 19748 } 19749 if (token() !== kind && stateStylesRootNode && inEtsStateStylesContext()) { 19750 return true; 19751 } 19752 if (diagnosticMessage) { 19753 parseErrorAtCurrentToken(diagnosticMessage); 19754 } else { 19755 parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(kind)); 19756 } 19757 return false; 19758 } 19759 const viableKeywordSuggestions = Object.keys(textToKeywordObj).filter((keyword) => keyword.length > 2); 19760 function parseErrorForMissingSemicolonAfter(node) { 19761 var _a2; 19762 if (isTaggedTemplateExpression(node)) { 19763 parseErrorAt(skipTrivia(sourceText, node.template.pos), node.template.end, Diagnostics.Module_declaration_names_may_only_use_or_quoted_strings); 19764 return; 19765 } 19766 const expressionText = isIdentifier(node) ? idText(node) : void 0; 19767 if (!expressionText || !isIdentifierText(expressionText, languageVersion)) { 19768 parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(26 /* SemicolonToken */)); 19769 return; 19770 } 19771 const pos = skipTrivia(sourceText, node.pos); 19772 switch (expressionText) { 19773 case "const": 19774 case "let": 19775 case "var": 19776 parseErrorAt(pos, node.end, Diagnostics.Variable_declaration_not_allowed_at_this_location); 19777 return; 19778 case "declare": 19779 return; 19780 case "interface": 19781 parseErrorForInvalidName(Diagnostics.Interface_name_cannot_be_0, Diagnostics.Interface_must_be_given_a_name, 18 /* OpenBraceToken */); 19782 return; 19783 case "is": 19784 parseErrorAt(pos, scanner.getTextPos(), Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); 19785 return; 19786 case "module": 19787 case "namespace": 19788 parseErrorForInvalidName(Diagnostics.Namespace_name_cannot_be_0, Diagnostics.Namespace_must_be_given_a_name, 18 /* OpenBraceToken */); 19789 return; 19790 case "type": 19791 parseErrorForInvalidName(Diagnostics.Type_alias_name_cannot_be_0, Diagnostics.Type_alias_must_be_given_a_name, 63 /* EqualsToken */); 19792 return; 19793 } 19794 const suggestion = (_a2 = getSpellingSuggestion(expressionText, viableKeywordSuggestions, (n) => n)) != null ? _a2 : getSpaceSuggestion(expressionText); 19795 if (suggestion) { 19796 parseErrorAt(pos, node.end, Diagnostics.Unknown_keyword_or_identifier_Did_you_mean_0, suggestion); 19797 return; 19798 } 19799 if (token() === 0 /* Unknown */) { 19800 return; 19801 } 19802 parseErrorAt(pos, node.end, Diagnostics.Unexpected_keyword_or_identifier); 19803 } 19804 function parseErrorForInvalidName(nameDiagnostic, blankDiagnostic, tokenIfBlankName) { 19805 if (token() === tokenIfBlankName) { 19806 parseErrorAtCurrentToken(blankDiagnostic); 19807 } else { 19808 parseErrorAtCurrentToken(nameDiagnostic, scanner.getTokenValue()); 19809 } 19810 } 19811 function getSpaceSuggestion(expressionText) { 19812 for (const keyword of viableKeywordSuggestions) { 19813 if (expressionText.length > keyword.length + 2 && startsWith(expressionText, keyword)) { 19814 return `${keyword} ${expressionText.slice(keyword.length)}`; 19815 } 19816 } 19817 return void 0; 19818 } 19819 function parseSemicolonAfterPropertyName(name, type, initializer) { 19820 if (token() === 59 /* AtToken */ && !scanner.hasPrecedingLineBreak()) { 19821 parseErrorAtCurrentToken(Diagnostics.Decorators_must_precede_the_name_and_all_keywords_of_property_declarations); 19822 return; 19823 } 19824 if (token() === 20 /* OpenParenToken */) { 19825 parseErrorAtCurrentToken(Diagnostics.Cannot_start_a_function_call_in_a_type_annotation); 19826 nextToken(); 19827 return; 19828 } 19829 if (type && !canParseSemicolon()) { 19830 if (initializer) { 19831 parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(26 /* SemicolonToken */)); 19832 } else { 19833 parseErrorAtCurrentToken(Diagnostics.Expected_for_property_initializer); 19834 } 19835 return; 19836 } 19837 if (tryParseSemicolon()) { 19838 return; 19839 } 19840 if (initializer) { 19841 parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(26 /* SemicolonToken */)); 19842 return; 19843 } 19844 parseErrorForMissingSemicolonAfter(name); 19845 } 19846 function parseExpectedJSDoc(kind) { 19847 if (token() === kind) { 19848 nextTokenJSDoc(); 19849 return true; 19850 } 19851 parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(kind)); 19852 return false; 19853 } 19854 function parseExpectedMatchingBrackets(openKind, closeKind, openParsed, openPosition) { 19855 if (token() === closeKind) { 19856 nextToken(); 19857 return; 19858 } 19859 const lastError = parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(closeKind)); 19860 if (!openParsed) { 19861 return; 19862 } 19863 if (lastError) { 19864 addRelatedInfo( 19865 lastError, 19866 createDetachedDiagnostic(fileName, openPosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, tokenToString(openKind), tokenToString(closeKind)) 19867 ); 19868 } 19869 } 19870 function parseOptional(t) { 19871 if (token() === t) { 19872 nextToken(); 19873 return true; 19874 } 19875 return false; 19876 } 19877 function parseOptionalToken(t) { 19878 if (token() === t) { 19879 return parseTokenNode(); 19880 } 19881 return void 0; 19882 } 19883 function parseOptionalTokenJSDoc(t) { 19884 if (token() === t) { 19885 return parseTokenNodeJSDoc(); 19886 } 19887 return void 0; 19888 } 19889 function parseExpectedToken(t, diagnosticMessage, arg0) { 19890 return parseOptionalToken(t) || createMissingNode(t, false, diagnosticMessage || Diagnostics._0_expected, arg0 || tokenToString(t)); 19891 } 19892 function parseExpectedTokenJSDoc(t) { 19893 return parseOptionalTokenJSDoc(t) || createMissingNode(t, false, Diagnostics._0_expected, tokenToString(t)); 19894 } 19895 function parseTokenNode() { 19896 const pos = getNodePos(); 19897 const kind = token(); 19898 nextToken(); 19899 return finishNode(factory2.createToken(kind), pos); 19900 } 19901 function parseTokenNodeJSDoc() { 19902 const pos = getNodePos(); 19903 const kind = token(); 19904 nextTokenJSDoc(); 19905 return finishNode(factory2.createToken(kind), pos); 19906 } 19907 function canParseSemicolon() { 19908 if (token() === 26 /* SemicolonToken */) { 19909 return true; 19910 } 19911 return token() === 19 /* CloseBraceToken */ || token() === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); 19912 } 19913 function tryParseSemicolon() { 19914 if (!canParseSemicolon()) { 19915 return false; 19916 } 19917 if (token() === 26 /* SemicolonToken */) { 19918 nextToken(); 19919 } 19920 return true; 19921 } 19922 function parseSemicolon() { 19923 return tryParseSemicolon() || parseExpected(26 /* SemicolonToken */); 19924 } 19925 function createNodeArray(elements, pos, end, hasTrailingComma) { 19926 const array = factory2.createNodeArray(elements, hasTrailingComma); 19927 setTextRangePosEnd(array, pos, end != null ? end : scanner.getStartPos()); 19928 return array; 19929 } 19930 function finishNode(node, pos, end, virtual) { 19931 setTextRangePosEnd(node, pos, end != null ? end : scanner.getStartPos()); 19932 if (contextFlags) { 19933 node.flags |= contextFlags; 19934 } 19935 if (parseErrorBeforeNextFinishedNode) { 19936 parseErrorBeforeNextFinishedNode = false; 19937 node.flags |= 131072 /* ThisNodeHasError */; 19938 } 19939 if (virtual) { 19940 node.virtual = true; 19941 } 19942 return node; 19943 } 19944 function createMissingNode(kind, reportAtCurrentPosition, diagnosticMessage, arg0) { 19945 if (reportAtCurrentPosition) { 19946 parseErrorAtPosition(scanner.getStartPos(), 0, diagnosticMessage, arg0); 19947 } else if (diagnosticMessage) { 19948 parseErrorAtCurrentToken(diagnosticMessage, arg0); 19949 } 19950 const pos = getNodePos(); 19951 const result = kind === 79 /* Identifier */ ? factory2.createIdentifier("", void 0, void 0) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(kind, "", "", void 0) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral("", void 0) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral("", void 0) : kind === 285 /* MissingDeclaration */ ? factory2.createMissingDeclaration() : factory2.createToken(kind); 19952 return finishNode(result, pos); 19953 } 19954 function internIdentifier(text) { 19955 let identifier = identifiers.get(text); 19956 if (identifier === void 0) { 19957 identifiers.set(text, identifier = text); 19958 } 19959 return identifier; 19960 } 19961 function createIdentifier(isIdentifier3, diagnosticMessage, privateIdentifierDiagnosticMessage) { 19962 if (isIdentifier3) { 19963 identifierCount++; 19964 const pos = getNodePos(); 19965 const originalKeywordKind = token(); 19966 const text = internIdentifier(scanner.getTokenValue()); 19967 const hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape(); 19968 nextTokenWithoutCheck(); 19969 return finishNode(factory2.createIdentifier(text, void 0, originalKeywordKind, hasExtendedUnicodeEscape), pos); 19970 } 19971 if (token() === 80 /* PrivateIdentifier */) { 19972 parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies); 19973 return createIdentifier(true); 19974 } 19975 if (token() === 0 /* Unknown */ && scanner.tryScan(() => scanner.reScanInvalidIdentifier() === 79 /* Identifier */)) { 19976 return createIdentifier(true); 19977 } 19978 if (stateStylesRootNode && inEtsStateStylesContext() && token() === 24 /* DotToken */) { 19979 identifierCount++; 19980 const pos = getNodePos(); 19981 return finishVirtualNode( 19982 factory2.createIdentifier(`${stateStylesRootNode}Instance`, void 0, 79 /* Identifier */), 19983 pos, 19984 pos 19985 ); 19986 } 19987 identifierCount++; 19988 const reportAtCurrentPosition = token() === 1 /* EndOfFileToken */; 19989 const isReservedWord = scanner.isReservedWord(); 19990 const msgArg = scanner.getTokenText(); 19991 const defaultMessage = isReservedWord ? Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here : Diagnostics.Identifier_expected; 19992 return createMissingNode(79 /* Identifier */, reportAtCurrentPosition, diagnosticMessage || defaultMessage, msgArg); 19993 } 19994 function parseBindingIdentifier(privateIdentifierDiagnosticMessage) { 19995 return createIdentifier(isBindingIdentifier(), void 0, privateIdentifierDiagnosticMessage); 19996 } 19997 function parseIdentifier(diagnosticMessage, privateIdentifierDiagnosticMessage) { 19998 return createIdentifier(isIdentifier2(), diagnosticMessage, privateIdentifierDiagnosticMessage); 19999 } 20000 function parseEtsIdentifier(pos) { 20001 identifierCount++; 20002 const text = internIdentifier(stylesEtsComponentDeclaration.type); 20003 return finishVirtualNode(factory2.createIdentifier(text), pos, pos); 20004 } 20005 function parseIdentifierName(diagnosticMessage) { 20006 return createIdentifier(tokenIsIdentifierOrKeyword(token()), diagnosticMessage); 20007 } 20008 function isLiteralPropertyName() { 20009 return tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */; 20010 } 20011 function isAssertionKey2() { 20012 return tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */; 20013 } 20014 function parsePropertyNameWorker(allowComputedPropertyNames) { 20015 if (token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */) { 20016 const node = parseLiteralNode(); 20017 node.text = internIdentifier(node.text); 20018 return node; 20019 } 20020 if (allowComputedPropertyNames && token() === 22 /* OpenBracketToken */) { 20021 return parseComputedPropertyName(); 20022 } 20023 if (token() === 80 /* PrivateIdentifier */) { 20024 return parsePrivateIdentifier(); 20025 } 20026 return parseIdentifierName(); 20027 } 20028 function parsePropertyName() { 20029 return parsePropertyNameWorker(true); 20030 } 20031 function parseComputedPropertyName() { 20032 const pos = getNodePos(); 20033 parseExpected(22 /* OpenBracketToken */); 20034 const expression = allowInAnd(parseExpression); 20035 parseExpected(23 /* CloseBracketToken */); 20036 return finishNode(factory2.createComputedPropertyName(expression), pos); 20037 } 20038 function internPrivateIdentifier(text) { 20039 let privateIdentifier = privateIdentifiers.get(text); 20040 if (privateIdentifier === void 0) { 20041 privateIdentifiers.set(text, privateIdentifier = text); 20042 } 20043 return privateIdentifier; 20044 } 20045 function parsePrivateIdentifier() { 20046 const pos = getNodePos(); 20047 const node = factory2.createPrivateIdentifier(internPrivateIdentifier(scanner.getTokenValue())); 20048 nextToken(); 20049 return finishNode(node, pos); 20050 } 20051 function parseContextualModifier(t) { 20052 return token() === t && tryParse(nextTokenCanFollowModifier); 20053 } 20054 function nextTokenIsOnSameLineAndCanFollowModifier() { 20055 nextToken(); 20056 if (scanner.hasPrecedingLineBreak()) { 20057 return false; 20058 } 20059 return canFollowModifier(); 20060 } 20061 function nextTokenCanFollowModifier() { 20062 switch (token()) { 20063 case 86 /* ConstKeyword */: 20064 return nextToken() === 93 /* EnumKeyword */; 20065 case 94 /* ExportKeyword */: 20066 nextToken(); 20067 if (token() === 89 /* DefaultKeyword */) { 20068 return lookAhead(nextTokenCanFollowDefaultKeyword); 20069 } 20070 if (token() === 155 /* TypeKeyword */) { 20071 return lookAhead(nextTokenCanFollowExportModifier); 20072 } 20073 if (inAllowAnnotationContext() && token() === 59 /* AtToken */) { 20074 return lookAhead(() => nextToken() === 119 /* InterfaceKeyword */); 20075 } 20076 return canFollowExportModifier(); 20077 case 89 /* DefaultKeyword */: 20078 return nextTokenCanFollowDefaultKeyword(); 20079 case 128 /* AccessorKeyword */: 20080 case 125 /* StaticKeyword */: 20081 case 138 /* GetKeyword */: 20082 case 152 /* SetKeyword */: 20083 nextToken(); 20084 return canFollowModifier(); 20085 default: 20086 return nextTokenIsOnSameLineAndCanFollowModifier(); 20087 } 20088 } 20089 function canFollowExportModifier() { 20090 return token() !== 41 /* AsteriskToken */ && token() !== 129 /* AsKeyword */ && token() !== 18 /* OpenBraceToken */ && canFollowModifier(); 20091 } 20092 function nextTokenCanFollowExportModifier() { 20093 nextToken(); 20094 return canFollowExportModifier(); 20095 } 20096 function parseAnyContextualModifier() { 20097 return isModifierKind(token()) && tryParse(nextTokenCanFollowModifier); 20098 } 20099 function canFollowModifier() { 20100 return token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */ || token() === 41 /* AsteriskToken */ || token() === 25 /* DotDotDotToken */ || token() === 59 /* AtToken */ && inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */) || isLiteralPropertyName(); 20101 } 20102 function nextTokenCanFollowDefaultKeyword() { 20103 nextToken(); 20104 return token() === 84 /* ClassKeyword */ || inEtsContext() && token() === 85 /* StructKeyword */ || token() === 99 /* FunctionKeyword */ || token() === 119 /* InterfaceKeyword */ || token() === 127 /* AbstractKeyword */ && lookAhead(nextTokenIsClassKeywordOnSameLine) || token() === 133 /* AsyncKeyword */ && lookAhead(nextTokenIsFunctionKeywordOnSameLine); 20105 } 20106 function isListElement(parsingContext2, inErrorRecovery) { 20107 const node = currentNode(parsingContext2); 20108 if (node) { 20109 return true; 20110 } 20111 switch (parsingContext2) { 20112 case ParsingContext.SourceElements: 20113 case ParsingContext.BlockStatements: 20114 case ParsingContext.SwitchClauseStatements: 20115 return !(token() === 26 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement(); 20116 case ParsingContext.SwitchClauses: 20117 return token() === 82 /* CaseKeyword */ || token() === 89 /* DefaultKeyword */; 20118 case ParsingContext.TypeMembers: 20119 return lookAhead(isTypeMemberStart); 20120 case ParsingContext.ClassMembers: 20121 return lookAhead(isClassMemberStart) || token() === 26 /* SemicolonToken */ && !inErrorRecovery; 20122 case ParsingContext.AnnotationMembers: 20123 return lookAhead(isAnnotationMemberStart); 20124 case ParsingContext.EnumMembers: 20125 return token() === 22 /* OpenBracketToken */ || isLiteralPropertyName(); 20126 case ParsingContext.ObjectLiteralMembers: 20127 switch (token()) { 20128 case 22 /* OpenBracketToken */: 20129 case 41 /* AsteriskToken */: 20130 case 25 /* DotDotDotToken */: 20131 case 24 /* DotToken */: 20132 return true; 20133 default: 20134 return isLiteralPropertyName(); 20135 } 20136 case ParsingContext.RestProperties: 20137 return isLiteralPropertyName(); 20138 case ParsingContext.ObjectBindingElements: 20139 return token() === 22 /* OpenBracketToken */ || token() === 25 /* DotDotDotToken */ || isLiteralPropertyName(); 20140 case ParsingContext.AssertEntries: 20141 return isAssertionKey2(); 20142 case ParsingContext.HeritageClauseElement: 20143 if (token() === 18 /* OpenBraceToken */) { 20144 return lookAhead(isValidHeritageClauseObjectLiteral); 20145 } 20146 if (!inErrorRecovery) { 20147 return isStartOfLeftHandSideExpression() && !isHeritageClauseExtendsOrImplementsKeyword(); 20148 } else { 20149 return isIdentifier2() && !isHeritageClauseExtendsOrImplementsKeyword(); 20150 } 20151 case ParsingContext.VariableDeclarations: 20152 return isBindingIdentifierOrPrivateIdentifierOrPattern(); 20153 case ParsingContext.ArrayBindingElements: 20154 return token() === 27 /* CommaToken */ || token() === 25 /* DotDotDotToken */ || isBindingIdentifierOrPrivateIdentifierOrPattern(); 20155 case ParsingContext.TypeParameters: 20156 return token() === 102 /* InKeyword */ || isIdentifier2(); 20157 case ParsingContext.ArrayLiteralMembers: 20158 switch (token()) { 20159 case 27 /* CommaToken */: 20160 case 24 /* DotToken */: 20161 return true; 20162 } 20163 case ParsingContext.ArgumentExpressions: 20164 return token() === 25 /* DotDotDotToken */ || isStartOfExpression(); 20165 case ParsingContext.Parameters: 20166 return isStartOfParameter(false); 20167 case ParsingContext.JSDocParameters: 20168 return isStartOfParameter(true); 20169 case ParsingContext.TypeArguments: 20170 case ParsingContext.TupleElementTypes: 20171 return token() === 27 /* CommaToken */ || isStartOfType(); 20172 case ParsingContext.HeritageClauses: 20173 return isHeritageClause2(); 20174 case ParsingContext.ImportOrExportSpecifiers: 20175 return tokenIsIdentifierOrKeyword(token()); 20176 case ParsingContext.JsxAttributes: 20177 return tokenIsIdentifierOrKeyword(token()) || token() === 18 /* OpenBraceToken */; 20178 case ParsingContext.JsxChildren: 20179 return true; 20180 } 20181 return Debug.fail("Non-exhaustive case in 'isListElement'."); 20182 } 20183 function isValidHeritageClauseObjectLiteral() { 20184 Debug.assert(token() === 18 /* OpenBraceToken */); 20185 if (nextToken() === 19 /* CloseBraceToken */) { 20186 const next = nextToken(); 20187 return next === 27 /* CommaToken */ || next === 18 /* OpenBraceToken */ || next === 95 /* ExtendsKeyword */ || next === 118 /* ImplementsKeyword */; 20188 } 20189 return true; 20190 } 20191 function nextTokenIsIdentifier() { 20192 nextToken(); 20193 return isIdentifier2(); 20194 } 20195 function nextTokenIsIdentifierOrKeyword() { 20196 nextToken(); 20197 return tokenIsIdentifierOrKeyword(token()); 20198 } 20199 function nextTokenIsIdentifierOrKeywordOrGreaterThan() { 20200 nextToken(); 20201 return tokenIsIdentifierOrKeywordOrGreaterThan(token()); 20202 } 20203 function isHeritageClauseExtendsOrImplementsKeyword() { 20204 if (token() === 118 /* ImplementsKeyword */ || token() === 95 /* ExtendsKeyword */) { 20205 return lookAhead(nextTokenIsStartOfExpression); 20206 } 20207 return false; 20208 } 20209 function nextTokenIsStartOfExpression() { 20210 nextToken(); 20211 return isStartOfExpression(); 20212 } 20213 function nextTokenIsStartOfType() { 20214 nextToken(); 20215 return isStartOfType(); 20216 } 20217 function isListTerminator(kind) { 20218 if (token() === 1 /* EndOfFileToken */) { 20219 return true; 20220 } 20221 switch (kind) { 20222 case ParsingContext.BlockStatements: 20223 case ParsingContext.SwitchClauses: 20224 case ParsingContext.TypeMembers: 20225 case ParsingContext.ClassMembers: 20226 case ParsingContext.AnnotationMembers: 20227 case ParsingContext.EnumMembers: 20228 case ParsingContext.ObjectLiteralMembers: 20229 case ParsingContext.ObjectBindingElements: 20230 case ParsingContext.ImportOrExportSpecifiers: 20231 case ParsingContext.AssertEntries: 20232 return token() === 19 /* CloseBraceToken */; 20233 case ParsingContext.SwitchClauseStatements: 20234 return token() === 19 /* CloseBraceToken */ || token() === 82 /* CaseKeyword */ || token() === 89 /* DefaultKeyword */; 20235 case ParsingContext.HeritageClauseElement: 20236 return token() === 18 /* OpenBraceToken */ || token() === 95 /* ExtendsKeyword */ || token() === 118 /* ImplementsKeyword */; 20237 case ParsingContext.VariableDeclarations: 20238 return isVariableDeclaratorListTerminator(); 20239 case ParsingContext.TypeParameters: 20240 return token() === 31 /* GreaterThanToken */ || token() === 20 /* OpenParenToken */ || token() === 18 /* OpenBraceToken */ || token() === 95 /* ExtendsKeyword */ || token() === 118 /* ImplementsKeyword */; 20241 case ParsingContext.ArgumentExpressions: 20242 return token() === 21 /* CloseParenToken */ || token() === 26 /* SemicolonToken */; 20243 case ParsingContext.ArrayLiteralMembers: 20244 case ParsingContext.TupleElementTypes: 20245 case ParsingContext.ArrayBindingElements: 20246 return token() === 23 /* CloseBracketToken */; 20247 case ParsingContext.JSDocParameters: 20248 case ParsingContext.Parameters: 20249 case ParsingContext.RestProperties: 20250 return token() === 21 /* CloseParenToken */ || token() === 23 /* CloseBracketToken */; 20251 case ParsingContext.TypeArguments: 20252 return token() !== 27 /* CommaToken */; 20253 case ParsingContext.HeritageClauses: 20254 return token() === 18 /* OpenBraceToken */ || token() === 19 /* CloseBraceToken */; 20255 case ParsingContext.JsxAttributes: 20256 return token() === 31 /* GreaterThanToken */ || token() === 43 /* SlashToken */; 20257 case ParsingContext.JsxChildren: 20258 return token() === 29 /* LessThanToken */ && lookAhead(nextTokenIsSlash); 20259 default: 20260 return false; 20261 } 20262 } 20263 function isVariableDeclaratorListTerminator() { 20264 if (canParseSemicolon()) { 20265 return true; 20266 } 20267 if (isInOrOfKeyword(token())) { 20268 return true; 20269 } 20270 if (token() === 38 /* EqualsGreaterThanToken */) { 20271 return true; 20272 } 20273 return false; 20274 } 20275 function isInSomeParsingContext() { 20276 for (let kind = 0; kind < ParsingContext.Count; kind++) { 20277 if (parsingContext & 1 << kind) { 20278 if (isListElement(kind, true) || isListTerminator(kind)) { 20279 return true; 20280 } 20281 } 20282 } 20283 return false; 20284 } 20285 function parseList(kind, parseElement) { 20286 const saveParsingContext = parsingContext; 20287 parsingContext |= 1 << kind; 20288 const list = []; 20289 const listPos = getNodePos(); 20290 while (!isListTerminator(kind)) { 20291 if (isListElement(kind, false)) { 20292 list.push(parseListElement(kind, parseElement)); 20293 continue; 20294 } 20295 if (abortParsingListOrMoveToNextToken(kind)) { 20296 break; 20297 } 20298 } 20299 parsingContext = saveParsingContext; 20300 return createNodeArray(list, listPos); 20301 } 20302 function parseListElement(parsingContext2, parseElement) { 20303 const node = currentNode(parsingContext2); 20304 if (node) { 20305 return consumeNode(node); 20306 } 20307 return parseElement(); 20308 } 20309 function currentNode(parsingContext2, pos) { 20310 if (!syntaxCursor || !isReusableParsingContext(parsingContext2) || parseErrorBeforeNextFinishedNode) { 20311 return void 0; 20312 } 20313 const node = syntaxCursor.currentNode(pos != null ? pos : scanner.getStartPos()); 20314 if (nodeIsMissing(node) || node.intersectsChange || containsParseError(node)) { 20315 return void 0; 20316 } 20317 const nodeContextFlags = node.flags & 1124462592 /* ContextFlags */; 20318 if (nodeContextFlags !== contextFlags) { 20319 return void 0; 20320 } 20321 if (!canReuseNode(node, parsingContext2)) { 20322 return void 0; 20323 } 20324 if (node.jsDocCache) { 20325 node.jsDocCache = void 0; 20326 } 20327 return node; 20328 } 20329 function consumeNode(node) { 20330 scanner.setTextPos(node.end); 20331 nextToken(); 20332 return node; 20333 } 20334 function isReusableParsingContext(parsingContext2) { 20335 switch (parsingContext2) { 20336 case ParsingContext.ClassMembers: 20337 case ParsingContext.SwitchClauses: 20338 case ParsingContext.SourceElements: 20339 case ParsingContext.BlockStatements: 20340 case ParsingContext.SwitchClauseStatements: 20341 case ParsingContext.EnumMembers: 20342 case ParsingContext.TypeMembers: 20343 case ParsingContext.VariableDeclarations: 20344 case ParsingContext.JSDocParameters: 20345 case ParsingContext.Parameters: 20346 return true; 20347 } 20348 return false; 20349 } 20350 function canReuseNode(node, parsingContext2) { 20351 switch (parsingContext2) { 20352 case ParsingContext.ClassMembers: 20353 return isReusableClassMember(node); 20354 case ParsingContext.SwitchClauses: 20355 return isReusableSwitchClause(node); 20356 case ParsingContext.SourceElements: 20357 case ParsingContext.BlockStatements: 20358 case ParsingContext.SwitchClauseStatements: 20359 return isReusableStatement(node); 20360 case ParsingContext.EnumMembers: 20361 return isReusableEnumMember(node); 20362 case ParsingContext.TypeMembers: 20363 return isReusableTypeMember(node); 20364 case ParsingContext.VariableDeclarations: 20365 return isReusableVariableDeclaration(node); 20366 case ParsingContext.JSDocParameters: 20367 case ParsingContext.Parameters: 20368 return isReusableParameter(node); 20369 } 20370 return false; 20371 } 20372 function isReusableClassMember(node) { 20373 if (node) { 20374 switch (node.kind) { 20375 case 176 /* Constructor */: 20376 case 181 /* IndexSignature */: 20377 case 177 /* GetAccessor */: 20378 case 178 /* SetAccessor */: 20379 case 241 /* SemicolonClassElement */: 20380 return true; 20381 case 171 /* PropertyDeclaration */: 20382 return !inStructContext(); 20383 case 174 /* MethodDeclaration */: 20384 const methodDeclaration = node; 20385 const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.originalKeywordKind === 136 /* ConstructorKeyword */; 20386 return !nameIsConstructor; 20387 } 20388 } 20389 return false; 20390 } 20391 function isReusableSwitchClause(node) { 20392 if (node) { 20393 switch (node.kind) { 20394 case 298 /* CaseClause */: 20395 case 299 /* DefaultClause */: 20396 return true; 20397 } 20398 } 20399 return false; 20400 } 20401 function isReusableStatement(node) { 20402 if (node) { 20403 switch (node.kind) { 20404 case 263 /* FunctionDeclaration */: 20405 case 244 /* VariableStatement */: 20406 case 242 /* Block */: 20407 case 246 /* IfStatement */: 20408 case 245 /* ExpressionStatement */: 20409 case 258 /* ThrowStatement */: 20410 case 254 /* ReturnStatement */: 20411 case 256 /* SwitchStatement */: 20412 case 253 /* BreakStatement */: 20413 case 252 /* ContinueStatement */: 20414 case 250 /* ForInStatement */: 20415 case 251 /* ForOfStatement */: 20416 case 249 /* ForStatement */: 20417 case 248 /* WhileStatement */: 20418 case 255 /* WithStatement */: 20419 case 243 /* EmptyStatement */: 20420 case 259 /* TryStatement */: 20421 case 257 /* LabeledStatement */: 20422 case 247 /* DoStatement */: 20423 case 260 /* DebuggerStatement */: 20424 case 275 /* ImportDeclaration */: 20425 case 274 /* ImportEqualsDeclaration */: 20426 case 281 /* ExportDeclaration */: 20427 case 280 /* ExportAssignment */: 20428 case 270 /* ModuleDeclaration */: 20429 case 264 /* ClassDeclaration */: 20430 case 265 /* StructDeclaration */: 20431 case 267 /* InterfaceDeclaration */: 20432 case 269 /* EnumDeclaration */: 20433 case 268 /* TypeAliasDeclaration */: 20434 return true; 20435 } 20436 } 20437 return false; 20438 } 20439 function isReusableEnumMember(node) { 20440 return node.kind === 308 /* EnumMember */; 20441 } 20442 function isReusableTypeMember(node) { 20443 if (node) { 20444 switch (node.kind) { 20445 case 180 /* ConstructSignature */: 20446 case 173 /* MethodSignature */: 20447 case 181 /* IndexSignature */: 20448 case 170 /* PropertySignature */: 20449 case 179 /* CallSignature */: 20450 return true; 20451 } 20452 } 20453 return false; 20454 } 20455 function isReusableVariableDeclaration(node) { 20456 if (node.kind !== 261 /* VariableDeclaration */) { 20457 return false; 20458 } 20459 const variableDeclarator = node; 20460 return variableDeclarator.initializer === void 0; 20461 } 20462 function isReusableParameter(node) { 20463 if (node.kind !== 168 /* Parameter */) { 20464 return false; 20465 } 20466 const parameter = node; 20467 return parameter.initializer === void 0; 20468 } 20469 function abortParsingListOrMoveToNextToken(kind) { 20470 parsingContextErrors(kind); 20471 if (isInSomeParsingContext()) { 20472 return true; 20473 } 20474 nextToken(); 20475 return false; 20476 } 20477 function parsingContextErrors(context) { 20478 switch (context) { 20479 case ParsingContext.SourceElements: 20480 return token() === 89 /* DefaultKeyword */ ? parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(94 /* ExportKeyword */)) : parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected); 20481 case ParsingContext.BlockStatements: 20482 return parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected); 20483 case ParsingContext.SwitchClauses: 20484 return parseErrorAtCurrentToken(Diagnostics.case_or_default_expected); 20485 case ParsingContext.SwitchClauseStatements: 20486 return parseErrorAtCurrentToken(Diagnostics.Statement_expected); 20487 case ParsingContext.RestProperties: 20488 case ParsingContext.TypeMembers: 20489 return parseErrorAtCurrentToken(Diagnostics.Property_or_signature_expected); 20490 case ParsingContext.ClassMembers: 20491 return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected); 20492 case ParsingContext.AnnotationMembers: 20493 return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_An_annotation_property_was_expected); 20494 case ParsingContext.EnumMembers: 20495 return parseErrorAtCurrentToken(Diagnostics.Enum_member_expected); 20496 case ParsingContext.HeritageClauseElement: 20497 return parseErrorAtCurrentToken(Diagnostics.Expression_expected); 20498 case ParsingContext.VariableDeclarations: 20499 return isKeyword(token()) ? parseErrorAtCurrentToken(Diagnostics._0_is_not_allowed_as_a_variable_declaration_name, tokenToString(token())) : parseErrorAtCurrentToken(Diagnostics.Variable_declaration_expected); 20500 case ParsingContext.ObjectBindingElements: 20501 return parseErrorAtCurrentToken(Diagnostics.Property_destructuring_pattern_expected); 20502 case ParsingContext.ArrayBindingElements: 20503 return parseErrorAtCurrentToken(Diagnostics.Array_element_destructuring_pattern_expected); 20504 case ParsingContext.ArgumentExpressions: 20505 return parseErrorAtCurrentToken(Diagnostics.Argument_expression_expected); 20506 case ParsingContext.ObjectLiteralMembers: 20507 return parseErrorAtCurrentToken(Diagnostics.Property_assignment_expected); 20508 case ParsingContext.ArrayLiteralMembers: 20509 return parseErrorAtCurrentToken(Diagnostics.Expression_or_comma_expected); 20510 case ParsingContext.JSDocParameters: 20511 return parseErrorAtCurrentToken(Diagnostics.Parameter_declaration_expected); 20512 case ParsingContext.Parameters: 20513 return isKeyword(token()) ? parseErrorAtCurrentToken(Diagnostics._0_is_not_allowed_as_a_parameter_name, tokenToString(token())) : parseErrorAtCurrentToken(Diagnostics.Parameter_declaration_expected); 20514 case ParsingContext.TypeParameters: 20515 return parseErrorAtCurrentToken(Diagnostics.Type_parameter_declaration_expected); 20516 case ParsingContext.TypeArguments: 20517 return parseErrorAtCurrentToken(Diagnostics.Type_argument_expected); 20518 case ParsingContext.TupleElementTypes: 20519 return parseErrorAtCurrentToken(Diagnostics.Type_expected); 20520 case ParsingContext.HeritageClauses: 20521 return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_expected); 20522 case ParsingContext.ImportOrExportSpecifiers: 20523 return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); 20524 case ParsingContext.JsxAttributes: 20525 return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); 20526 case ParsingContext.JsxChildren: 20527 return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); 20528 case ParsingContext.AssertEntries: 20529 return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected); 20530 case ParsingContext.Count: 20531 return Debug.fail("ParsingContext.Count used as a context"); 20532 default: 20533 Debug.assertNever(context); 20534 } 20535 } 20536 function parseDelimitedList(kind, parseElement, considerSemicolonAsDelimiter) { 20537 const saveParsingContext = parsingContext; 20538 parsingContext |= 1 << kind; 20539 const list = []; 20540 const listPos = getNodePos(); 20541 let commaStart = -1; 20542 while (true) { 20543 if (isListElement(kind, false)) { 20544 const startPos = scanner.getStartPos(); 20545 const result = parseListElement(kind, parseElement); 20546 if (!result) { 20547 parsingContext = saveParsingContext; 20548 return void 0; 20549 } 20550 list.push(result); 20551 commaStart = scanner.getTokenPos(); 20552 if (parseOptional(27 /* CommaToken */)) { 20553 continue; 20554 } 20555 commaStart = -1; 20556 if (isListTerminator(kind)) { 20557 break; 20558 } 20559 parseExpected(27 /* CommaToken */, getExpectedCommaDiagnostic(kind)); 20560 if (considerSemicolonAsDelimiter && token() === 26 /* SemicolonToken */ && !scanner.hasPrecedingLineBreak()) { 20561 nextToken(); 20562 } 20563 if (startPos === scanner.getStartPos()) { 20564 nextToken(); 20565 } 20566 continue; 20567 } 20568 if (isListTerminator(kind)) { 20569 break; 20570 } 20571 if (abortParsingListOrMoveToNextToken(kind)) { 20572 break; 20573 } 20574 } 20575 parsingContext = saveParsingContext; 20576 return createNodeArray(list, listPos, void 0, commaStart >= 0); 20577 } 20578 function getExpectedCommaDiagnostic(kind) { 20579 return kind === ParsingContext.EnumMembers ? Diagnostics.An_enum_member_name_must_be_followed_by_a_or : void 0; 20580 } 20581 function createMissingList() { 20582 const list = createNodeArray([], getNodePos()); 20583 list.isMissingList = true; 20584 return list; 20585 } 20586 function isMissingList(arr) { 20587 return !!arr.isMissingList; 20588 } 20589 function parseBracketedList(kind, parseElement, open, close) { 20590 if (parseExpected(open)) { 20591 const result = parseDelimitedList(kind, parseElement); 20592 parseExpected(close); 20593 return result; 20594 } 20595 return createMissingList(); 20596 } 20597 function parseEntityName(allowReservedWords, diagnosticMessage) { 20598 const pos = getNodePos(); 20599 let entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage); 20600 let dotPos = getNodePos(); 20601 while (parseOptional(24 /* DotToken */)) { 20602 if (token() === 29 /* LessThanToken */) { 20603 entity.jsdocDotPos = dotPos; 20604 break; 20605 } 20606 dotPos = getNodePos(); 20607 entity = finishNode( 20608 factory2.createQualifiedName( 20609 entity, 20610 parseRightSideOfDot(allowReservedWords, false) 20611 ), 20612 pos 20613 ); 20614 } 20615 return entity; 20616 } 20617 function createQualifiedName(entity, name) { 20618 return finishNode(factory2.createQualifiedName(entity, name), entity.pos); 20619 } 20620 function parseRightSideOfDot(allowIdentifierNames, allowPrivateIdentifiers) { 20621 if (scanner.hasPrecedingLineBreak() && tokenIsIdentifierOrKeyword(token())) { 20622 const matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); 20623 if (matchesPattern) { 20624 return createMissingNode(79 /* Identifier */, true, Diagnostics.Identifier_expected); 20625 } 20626 } 20627 if (token() === 80 /* PrivateIdentifier */) { 20628 const node = parsePrivateIdentifier(); 20629 return allowPrivateIdentifiers ? node : createMissingNode(79 /* Identifier */, true, Diagnostics.Identifier_expected); 20630 } 20631 return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); 20632 } 20633 function parseTemplateSpans(isTaggedTemplate) { 20634 const pos = getNodePos(); 20635 const list = []; 20636 let node; 20637 do { 20638 node = parseTemplateSpan(isTaggedTemplate); 20639 list.push(node); 20640 } while (node.literal.kind === 16 /* TemplateMiddle */); 20641 return createNodeArray(list, pos); 20642 } 20643 function parseTemplateExpression(isTaggedTemplate) { 20644 const pos = getNodePos(); 20645 return finishNode( 20646 factory2.createTemplateExpression( 20647 parseTemplateHead(isTaggedTemplate), 20648 parseTemplateSpans(isTaggedTemplate) 20649 ), 20650 pos 20651 ); 20652 } 20653 function parseTemplateType() { 20654 const pos = getNodePos(); 20655 return finishNode( 20656 factory2.createTemplateLiteralType( 20657 parseTemplateHead(false), 20658 parseTemplateTypeSpans() 20659 ), 20660 pos 20661 ); 20662 } 20663 function parseTemplateTypeSpans() { 20664 const pos = getNodePos(); 20665 const list = []; 20666 let node; 20667 do { 20668 node = parseTemplateTypeSpan(); 20669 list.push(node); 20670 } while (node.literal.kind === 16 /* TemplateMiddle */); 20671 return createNodeArray(list, pos); 20672 } 20673 function parseTemplateTypeSpan() { 20674 const pos = getNodePos(); 20675 return finishNode( 20676 factory2.createTemplateLiteralTypeSpan( 20677 parseType(), 20678 parseLiteralOfTemplateSpan(false) 20679 ), 20680 pos 20681 ); 20682 } 20683 function parseLiteralOfTemplateSpan(isTaggedTemplate) { 20684 if (token() === 19 /* CloseBraceToken */) { 20685 reScanTemplateToken(isTaggedTemplate); 20686 return parseTemplateMiddleOrTemplateTail(); 20687 } else { 20688 return parseExpectedToken(17 /* TemplateTail */, Diagnostics._0_expected, tokenToString(19 /* CloseBraceToken */)); 20689 } 20690 } 20691 function parseTemplateSpan(isTaggedTemplate) { 20692 const pos = getNodePos(); 20693 return finishNode( 20694 factory2.createTemplateSpan( 20695 allowInAnd(parseExpression), 20696 parseLiteralOfTemplateSpan(isTaggedTemplate) 20697 ), 20698 pos 20699 ); 20700 } 20701 function parseLiteralNode() { 20702 return parseLiteralLikeNode(token()); 20703 } 20704 function parseTemplateHead(isTaggedTemplate) { 20705 if (isTaggedTemplate) { 20706 reScanTemplateHeadOrNoSubstitutionTemplate(); 20707 } 20708 const fragment = parseLiteralLikeNode(token()); 20709 Debug.assert(fragment.kind === 15 /* TemplateHead */, "Template head has wrong token kind"); 20710 return fragment; 20711 } 20712 function parseTemplateMiddleOrTemplateTail() { 20713 const fragment = parseLiteralLikeNode(token()); 20714 Debug.assert(fragment.kind === 16 /* TemplateMiddle */ || fragment.kind === 17 /* TemplateTail */, "Template fragment has wrong token kind"); 20715 return fragment; 20716 } 20717 function getTemplateLiteralRawText(kind) { 20718 const isLast = kind === 14 /* NoSubstitutionTemplateLiteral */ || kind === 17 /* TemplateTail */; 20719 const tokenText = scanner.getTokenText(); 20720 return tokenText.substring(1, tokenText.length - (scanner.isUnterminated() ? 0 : isLast ? 1 : 2)); 20721 } 20722 function parseLiteralLikeNode(kind) { 20723 const pos = getNodePos(); 20724 const node = isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(kind, scanner.getTokenValue(), getTemplateLiteralRawText(kind), scanner.getTokenFlags() & 2048 /* TemplateLiteralLikeFlags */) : kind === 8 /* NumericLiteral */ ? factory2.createNumericLiteral(scanner.getTokenValue(), scanner.getNumericLiteralFlags()) : kind === 10 /* StringLiteral */ ? factory2.createStringLiteral(scanner.getTokenValue(), void 0, scanner.hasExtendedUnicodeEscape()) : isLiteralKind(kind) ? factory2.createLiteralLikeNode(kind, scanner.getTokenValue()) : Debug.fail(); 20725 if (scanner.hasExtendedUnicodeEscape()) { 20726 node.hasExtendedUnicodeEscape = true; 20727 } 20728 if (scanner.isUnterminated()) { 20729 node.isUnterminated = true; 20730 } 20731 nextToken(); 20732 return finishNode(node, pos); 20733 } 20734 function parseEntityNameOfTypeReference() { 20735 return parseEntityName(true, Diagnostics.Type_expected); 20736 } 20737 function parseTypeArgumentsOfTypeReference() { 20738 if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) { 20739 return parseBracketedList(ParsingContext.TypeArguments, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */); 20740 } 20741 } 20742 function parseTypeReference() { 20743 const pos = getNodePos(); 20744 return finishNode( 20745 factory2.createTypeReferenceNode( 20746 parseEntityNameOfTypeReference(), 20747 parseTypeArgumentsOfTypeReference() 20748 ), 20749 pos 20750 ); 20751 } 20752 function typeHasArrowFunctionBlockingParseError(node) { 20753 switch (node.kind) { 20754 case 183 /* TypeReference */: 20755 return nodeIsMissing(node.typeName); 20756 case 184 /* FunctionType */: 20757 case 185 /* ConstructorType */: { 20758 const { parameters, type } = node; 20759 return isMissingList(parameters) || typeHasArrowFunctionBlockingParseError(type); 20760 } 20761 case 196 /* ParenthesizedType */: 20762 return typeHasArrowFunctionBlockingParseError(node.type); 20763 default: 20764 return false; 20765 } 20766 } 20767 function parseThisTypePredicate(lhs) { 20768 nextToken(); 20769 return finishNode(factory2.createTypePredicateNode(void 0, lhs, parseType()), lhs.pos); 20770 } 20771 function parseThisTypeNode() { 20772 const pos = getNodePos(); 20773 nextToken(); 20774 return finishNode(factory2.createThisTypeNode(), pos); 20775 } 20776 function parseJSDocAllType() { 20777 const pos = getNodePos(); 20778 nextToken(); 20779 return finishNode(factory2.createJSDocAllType(), pos); 20780 } 20781 function parseJSDocNonNullableType() { 20782 const pos = getNodePos(); 20783 nextToken(); 20784 return finishNode(factory2.createJSDocNonNullableType(parseNonArrayType(), false), pos); 20785 } 20786 function parseJSDocUnknownOrNullableType() { 20787 const pos = getNodePos(); 20788 nextToken(); 20789 if (token() === 27 /* CommaToken */ || token() === 19 /* CloseBraceToken */ || token() === 21 /* CloseParenToken */ || token() === 31 /* GreaterThanToken */ || token() === 63 /* EqualsToken */ || token() === 51 /* BarToken */) { 20790 return finishNode(factory2.createJSDocUnknownType(), pos); 20791 } else { 20792 return finishNode(factory2.createJSDocNullableType(parseType(), false), pos); 20793 } 20794 } 20795 function parseJSDocFunctionType() { 20796 const pos = getNodePos(); 20797 const hasJSDoc = hasPrecedingJSDocComment(); 20798 if (lookAhead(nextTokenIsOpenParen)) { 20799 nextToken(); 20800 const parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */); 20801 const type = parseReturnType(58 /* ColonToken */, false); 20802 return withJSDoc(finishNode(factory2.createJSDocFunctionType(parameters, type), pos), hasJSDoc); 20803 } 20804 return finishNode(factory2.createTypeReferenceNode(parseIdentifierName(), void 0), pos); 20805 } 20806 function parseJSDocParameter() { 20807 const pos = getNodePos(); 20808 let name; 20809 if (token() === 109 /* ThisKeyword */ || token() === 104 /* NewKeyword */) { 20810 name = parseIdentifierName(); 20811 parseExpected(58 /* ColonToken */); 20812 } 20813 return finishNode( 20814 factory2.createParameterDeclaration( 20815 void 0, 20816 void 0, 20817 name, 20818 void 0, 20819 parseJSDocType(), 20820 void 0 20821 ), 20822 pos 20823 ); 20824 } 20825 function parseJSDocType() { 20826 scanner.setInJSDocType(true); 20827 const pos = getNodePos(); 20828 if (parseOptional(143 /* ModuleKeyword */)) { 20829 const moduleTag = factory2.createJSDocNamepathType(void 0); 20830 terminate: 20831 while (true) { 20832 switch (token()) { 20833 case 19 /* CloseBraceToken */: 20834 case 1 /* EndOfFileToken */: 20835 case 27 /* CommaToken */: 20836 case 5 /* WhitespaceTrivia */: 20837 break terminate; 20838 default: 20839 nextTokenJSDoc(); 20840 } 20841 } 20842 scanner.setInJSDocType(false); 20843 return finishNode(moduleTag, pos); 20844 } 20845 const hasDotDotDot = parseOptional(25 /* DotDotDotToken */); 20846 let type = parseTypeOrTypePredicate(); 20847 scanner.setInJSDocType(false); 20848 if (hasDotDotDot) { 20849 type = finishNode(factory2.createJSDocVariadicType(type), pos); 20850 } 20851 if (token() === 63 /* EqualsToken */) { 20852 nextToken(); 20853 return finishNode(factory2.createJSDocOptionalType(type), pos); 20854 } 20855 return type; 20856 } 20857 function parseTypeQuery() { 20858 const pos = getNodePos(); 20859 parseExpected(113 /* TypeOfKeyword */); 20860 const entityName = parseEntityName(true); 20861 const typeArguments = !scanner.hasPrecedingLineBreak() ? tryParseTypeArguments() : void 0; 20862 return finishNode(factory2.createTypeQueryNode(entityName, typeArguments), pos); 20863 } 20864 function parseTypeParameter(position) { 20865 const pos = getNodePos(); 20866 const modifiers = parseModifiers(); 20867 const name = position !== void 0 ? parseEtsIdentifier(position) : parseIdentifier(); 20868 let constraint; 20869 let expression; 20870 if (parseOptional(95 /* ExtendsKeyword */)) { 20871 if (isStartOfType() || !isStartOfExpression()) { 20872 constraint = parseType(); 20873 } else { 20874 expression = parseUnaryExpressionOrHigher(); 20875 } 20876 } 20877 const defaultType = parseOptional(63 /* EqualsToken */) ? parseType() : void 0; 20878 const node = factory2.createTypeParameterDeclaration(modifiers, name, constraint, defaultType); 20879 node.expression = expression; 20880 return position !== void 0 ? finishVirtualNode(node, position, position) : finishNode(node, pos); 20881 } 20882 function parseTypeParameters() { 20883 if (token() === 29 /* LessThanToken */) { 20884 return parseBracketedList(ParsingContext.TypeParameters, parseTypeParameter, 29 /* LessThanToken */, 31 /* GreaterThanToken */); 20885 } 20886 } 20887 function parseEtsTypeParameters(pos) { 20888 return createNodeArray([parseTypeParameter(pos)], getNodePos()); 20889 } 20890 function parseEtsTypeArguments(pos, name) { 20891 if ((contextFlags & 262144 /* JavaScriptFile */) !== 0) { 20892 return void 0; 20893 } 20894 return createNodeArray([parseEtsType(pos, name)], getNodePos()); 20895 } 20896 function isStartOfParameter(isJSDocParameter) { 20897 return token() === 25 /* DotDotDotToken */ || isBindingIdentifierOrPrivateIdentifierOrPattern() || isModifierKind(token()) || token() === 59 /* AtToken */ || isStartOfType(!isJSDocParameter); 20898 } 20899 function parseNameOfParameter(modifiers) { 20900 const name = parseIdentifierOrPattern(Diagnostics.Private_identifiers_cannot_be_used_as_parameters); 20901 if (getFullWidth(name) === 0 && !some(modifiers) && isModifierKind(token())) { 20902 nextToken(); 20903 } 20904 return name; 20905 } 20906 function isParameterNameStart() { 20907 return isBindingIdentifier() || token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */; 20908 } 20909 function parseParameter(inOuterAwaitContext) { 20910 return parseParameterWorker(inOuterAwaitContext); 20911 } 20912 function parseParameterForSpeculation(inOuterAwaitContext) { 20913 return parseParameterWorker(inOuterAwaitContext, false); 20914 } 20915 function parseParameterWorker(inOuterAwaitContext, allowAmbiguity = true) { 20916 const pos = getNodePos(); 20917 const hasJSDoc = hasPrecedingJSDocComment(); 20918 const decorators = inOuterAwaitContext ? doInAwaitContext(parseDecorators) : doOutsideOfAwaitContext(parseDecorators); 20919 if (token() === 109 /* ThisKeyword */) { 20920 const node2 = factory2.createParameterDeclaration( 20921 decorators, 20922 void 0, 20923 createIdentifier(true), 20924 void 0, 20925 parseTypeAnnotation(), 20926 void 0 20927 ); 20928 if (decorators) { 20929 parseErrorAtRange(decorators[0], Diagnostics.Decorators_may_not_be_applied_to_this_parameters); 20930 } 20931 return withJSDoc(finishNode(node2, pos), hasJSDoc); 20932 } 20933 const savedTopLevel = topLevel; 20934 topLevel = false; 20935 const modifiers = combineDecoratorsAndModifiers(decorators, parseModifiers()); 20936 const dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); 20937 if (!allowAmbiguity && !isParameterNameStart()) { 20938 return void 0; 20939 } 20940 const node = withJSDoc( 20941 finishNode( 20942 factory2.createParameterDeclaration( 20943 modifiers, 20944 dotDotDotToken, 20945 parseNameOfParameter(modifiers), 20946 parseOptionalToken(57 /* QuestionToken */), 20947 parseTypeAnnotation(), 20948 parseInitializer() 20949 ), 20950 pos 20951 ), 20952 hasJSDoc 20953 ); 20954 topLevel = savedTopLevel; 20955 return node; 20956 } 20957 function parseReturnType(returnToken, isType) { 20958 if (shouldParseReturnType(returnToken, isType)) { 20959 return allowConditionalTypesAnd(parseTypeOrTypePredicate); 20960 } 20961 } 20962 function shouldParseReturnType(returnToken, isType) { 20963 if (returnToken === 38 /* EqualsGreaterThanToken */) { 20964 parseExpected(returnToken); 20965 return true; 20966 } else if (parseOptional(58 /* ColonToken */)) { 20967 return true; 20968 } else if (isType && token() === 38 /* EqualsGreaterThanToken */) { 20969 parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(58 /* ColonToken */)); 20970 nextToken(); 20971 return true; 20972 } 20973 return false; 20974 } 20975 function parseParametersWorker(flags, allowAmbiguity) { 20976 const savedYieldContext = inYieldContext(); 20977 const savedAwaitContext = inAwaitContext(); 20978 setYieldContext(!!(flags & 1 /* Yield */)); 20979 setAwaitContext(!!(flags & 2 /* Await */)); 20980 const parameters = flags & 32 /* JSDoc */ ? parseDelimitedList(ParsingContext.JSDocParameters, parseJSDocParameter) : parseDelimitedList(ParsingContext.Parameters, () => allowAmbiguity ? parseParameter(savedAwaitContext) : parseParameterForSpeculation(savedAwaitContext)); 20981 setYieldContext(savedYieldContext); 20982 setAwaitContext(savedAwaitContext); 20983 return parameters; 20984 } 20985 function parseParameters(flags) { 20986 if (!parseExpected(20 /* OpenParenToken */)) { 20987 return createMissingList(); 20988 } 20989 const parameters = parseParametersWorker(flags, true); 20990 parseExpected(21 /* CloseParenToken */); 20991 return parameters; 20992 } 20993 function parseTypeMemberSemicolon() { 20994 if (parseOptional(27 /* CommaToken */)) { 20995 return; 20996 } 20997 parseSemicolon(); 20998 } 20999 function parseSignatureMember(kind) { 21000 const pos = getNodePos(); 21001 const hasJSDoc = hasPrecedingJSDocComment(); 21002 if (kind === 180 /* ConstructSignature */) { 21003 parseExpected(104 /* NewKeyword */); 21004 } 21005 const typeParameters = parseTypeParameters(); 21006 const parameters = parseParameters(4 /* Type */); 21007 const type = parseReturnType(58 /* ColonToken */, true); 21008 parseTypeMemberSemicolon(); 21009 const node = kind === 179 /* CallSignature */ ? factory2.createCallSignature(typeParameters, parameters, type) : factory2.createConstructSignature(typeParameters, parameters, type); 21010 return withJSDoc(finishNode(node, pos), hasJSDoc); 21011 } 21012 function isIndexSignature() { 21013 return token() === 22 /* OpenBracketToken */ && lookAhead(isUnambiguouslyIndexSignature); 21014 } 21015 function isUnambiguouslyIndexSignature() { 21016 nextToken(); 21017 if (token() === 25 /* DotDotDotToken */ || token() === 23 /* CloseBracketToken */) { 21018 return true; 21019 } 21020 if (isModifierKind(token())) { 21021 nextToken(); 21022 if (isIdentifier2()) { 21023 return true; 21024 } 21025 } else if (!isIdentifier2()) { 21026 return false; 21027 } else { 21028 nextToken(); 21029 } 21030 if (token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */) { 21031 return true; 21032 } 21033 if (token() !== 57 /* QuestionToken */) { 21034 return false; 21035 } 21036 nextToken(); 21037 return token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 23 /* CloseBracketToken */; 21038 } 21039 function parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers) { 21040 const parameters = parseBracketedList(ParsingContext.Parameters, () => parseParameter(false), 22 /* OpenBracketToken */, 23 /* CloseBracketToken */); 21041 const type = parseTypeAnnotation(); 21042 parseTypeMemberSemicolon(); 21043 const node = factory2.createIndexSignature(modifiers, parameters, type); 21044 node.illegalDecorators = decorators; 21045 return withJSDoc(finishNode(node, pos), hasJSDoc); 21046 } 21047 function parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers) { 21048 const name = parsePropertyName(); 21049 const questionToken = parseOptionalToken(57 /* QuestionToken */); 21050 let node; 21051 if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { 21052 const typeParameters = parseTypeParameters(); 21053 const parameters = parseParameters(4 /* Type */); 21054 const type = parseReturnType(58 /* ColonToken */, true); 21055 node = factory2.createMethodSignature(modifiers, name, questionToken, typeParameters, parameters, type); 21056 } else { 21057 const type = parseTypeAnnotation(); 21058 node = factory2.createPropertySignature(modifiers, name, questionToken, type); 21059 if (token() === 63 /* EqualsToken */) 21060 node.initializer = parseInitializer(); 21061 } 21062 parseTypeMemberSemicolon(); 21063 return withJSDoc(finishNode(node, pos), hasJSDoc); 21064 } 21065 function isTypeMemberStart() { 21066 if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 138 /* GetKeyword */ || token() === 152 /* SetKeyword */) { 21067 return true; 21068 } 21069 let idToken = false; 21070 while (isModifierKind(token())) { 21071 idToken = true; 21072 nextToken(); 21073 } 21074 if (token() === 22 /* OpenBracketToken */) { 21075 return true; 21076 } 21077 if (isLiteralPropertyName()) { 21078 idToken = true; 21079 nextToken(); 21080 } 21081 if (idToken) { 21082 return token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 57 /* QuestionToken */ || token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || canParseSemicolon(); 21083 } 21084 return false; 21085 } 21086 function parseTypeMember() { 21087 if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { 21088 return parseSignatureMember(179 /* CallSignature */); 21089 } 21090 if (token() === 104 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { 21091 return parseSignatureMember(180 /* ConstructSignature */); 21092 } 21093 const pos = getNodePos(); 21094 const hasJSDoc = hasPrecedingJSDocComment(); 21095 const modifiers = parseModifiers(); 21096 if (parseContextualModifier(138 /* GetKeyword */)) { 21097 return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 177 /* GetAccessor */, 4 /* Type */); 21098 } 21099 if (parseContextualModifier(152 /* SetKeyword */)) { 21100 return parseAccessorDeclaration(pos, hasJSDoc, void 0, modifiers, 178 /* SetAccessor */, 4 /* Type */); 21101 } 21102 if (isIndexSignature()) { 21103 return parseIndexSignatureDeclaration(pos, hasJSDoc, void 0, modifiers); 21104 } 21105 return parsePropertyOrMethodSignature(pos, hasJSDoc, modifiers); 21106 } 21107 function nextTokenIsOpenParenOrLessThan() { 21108 nextToken(); 21109 return token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */; 21110 } 21111 function nextTokenIsDot() { 21112 return nextToken() === 24 /* DotToken */; 21113 } 21114 function nextTokenIsOpenParenOrLessThanOrDot() { 21115 switch (nextToken()) { 21116 case 20 /* OpenParenToken */: 21117 case 29 /* LessThanToken */: 21118 case 24 /* DotToken */: 21119 return true; 21120 } 21121 return false; 21122 } 21123 function parseTypeLiteral() { 21124 const pos = getNodePos(); 21125 return finishNode(factory2.createTypeLiteralNode(parseObjectTypeMembers()), pos); 21126 } 21127 function parseObjectTypeMembers() { 21128 let members; 21129 if (parseExpected(18 /* OpenBraceToken */)) { 21130 members = parseList(ParsingContext.TypeMembers, parseTypeMember); 21131 parseExpected(19 /* CloseBraceToken */); 21132 } else { 21133 members = createMissingList(); 21134 } 21135 return members; 21136 } 21137 function isStartOfMappedType() { 21138 nextToken(); 21139 if (token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { 21140 return nextToken() === 147 /* ReadonlyKeyword */; 21141 } 21142 if (token() === 147 /* ReadonlyKeyword */) { 21143 nextToken(); 21144 } 21145 return token() === 22 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 102 /* InKeyword */; 21146 } 21147 function parseMappedTypeParameter() { 21148 const pos = getNodePos(); 21149 const name = parseIdentifierName(); 21150 parseExpected(102 /* InKeyword */); 21151 const type = parseType(); 21152 return finishNode(factory2.createTypeParameterDeclaration(void 0, name, type, void 0), pos); 21153 } 21154 function parseMappedType() { 21155 const pos = getNodePos(); 21156 parseExpected(18 /* OpenBraceToken */); 21157 let readonlyToken; 21158 if (token() === 147 /* ReadonlyKeyword */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { 21159 readonlyToken = parseTokenNode(); 21160 if (readonlyToken.kind !== 147 /* ReadonlyKeyword */) { 21161 parseExpected(147 /* ReadonlyKeyword */); 21162 } 21163 } 21164 parseExpected(22 /* OpenBracketToken */); 21165 const typeParameter = parseMappedTypeParameter(); 21166 const nameType = parseOptional(129 /* AsKeyword */) ? parseType() : void 0; 21167 parseExpected(23 /* CloseBracketToken */); 21168 let questionToken; 21169 if (token() === 57 /* QuestionToken */ || token() === 39 /* PlusToken */ || token() === 40 /* MinusToken */) { 21170 questionToken = parseTokenNode(); 21171 if (questionToken.kind !== 57 /* QuestionToken */) { 21172 parseExpected(57 /* QuestionToken */); 21173 } 21174 } 21175 const type = parseTypeAnnotation(); 21176 parseSemicolon(); 21177 const members = parseList(ParsingContext.TypeMembers, parseTypeMember); 21178 parseExpected(19 /* CloseBraceToken */); 21179 return finishNode(factory2.createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members), pos); 21180 } 21181 function parseTupleElementType() { 21182 const pos = getNodePos(); 21183 if (parseOptional(25 /* DotDotDotToken */)) { 21184 return finishNode(factory2.createRestTypeNode(parseType()), pos); 21185 } 21186 const type = parseType(); 21187 if (isJSDocNullableType(type) && type.pos === type.type.pos) { 21188 const node = factory2.createOptionalTypeNode(type.type); 21189 setTextRange(node, type); 21190 node.flags = type.flags; 21191 return node; 21192 } 21193 return type; 21194 } 21195 function isNextTokenColonOrQuestionColon() { 21196 return nextToken() === 58 /* ColonToken */ || token() === 57 /* QuestionToken */ && nextToken() === 58 /* ColonToken */; 21197 } 21198 function isTupleElementName() { 21199 if (token() === 25 /* DotDotDotToken */) { 21200 return tokenIsIdentifierOrKeyword(nextToken()) && isNextTokenColonOrQuestionColon(); 21201 } 21202 return tokenIsIdentifierOrKeyword(token()) && isNextTokenColonOrQuestionColon(); 21203 } 21204 function parseTupleElementNameOrTupleElementType() { 21205 if (lookAhead(isTupleElementName)) { 21206 const pos = getNodePos(); 21207 const hasJSDoc = hasPrecedingJSDocComment(); 21208 const dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); 21209 const name = parseIdentifierName(); 21210 const questionToken = parseOptionalToken(57 /* QuestionToken */); 21211 parseExpected(58 /* ColonToken */); 21212 const type = parseTupleElementType(); 21213 const node = factory2.createNamedTupleMember(dotDotDotToken, name, questionToken, type); 21214 return withJSDoc(finishNode(node, pos), hasJSDoc); 21215 } 21216 return parseTupleElementType(); 21217 } 21218 function parseTupleType() { 21219 const pos = getNodePos(); 21220 return finishNode( 21221 factory2.createTupleTypeNode( 21222 parseBracketedList(ParsingContext.TupleElementTypes, parseTupleElementNameOrTupleElementType, 22 /* OpenBracketToken */, 23 /* CloseBracketToken */) 21223 ), 21224 pos 21225 ); 21226 } 21227 function parseParenthesizedType() { 21228 const pos = getNodePos(); 21229 parseExpected(20 /* OpenParenToken */); 21230 const type = parseType(); 21231 parseExpected(21 /* CloseParenToken */); 21232 return finishNode(factory2.createParenthesizedType(type), pos); 21233 } 21234 function parseModifiersForConstructorType() { 21235 let modifiers; 21236 if (token() === 127 /* AbstractKeyword */) { 21237 const pos = getNodePos(); 21238 nextToken(); 21239 const modifier = finishNode(factory2.createToken(127 /* AbstractKeyword */), pos); 21240 modifiers = createNodeArray([modifier], pos); 21241 } 21242 return modifiers; 21243 } 21244 function parseFunctionOrConstructorType() { 21245 const pos = getNodePos(); 21246 const hasJSDoc = hasPrecedingJSDocComment(); 21247 const modifiers = parseModifiersForConstructorType(); 21248 const isConstructorType = parseOptional(104 /* NewKeyword */); 21249 const typeParameters = parseTypeParameters(); 21250 const parameters = parseParameters(4 /* Type */); 21251 const type = parseReturnType(38 /* EqualsGreaterThanToken */, false); 21252 const node = isConstructorType ? factory2.createConstructorTypeNode(modifiers, typeParameters, parameters, type) : factory2.createFunctionTypeNode(typeParameters, parameters, type); 21253 if (!isConstructorType) 21254 node.modifiers = modifiers; 21255 return withJSDoc(finishNode(node, pos), hasJSDoc); 21256 } 21257 function parseKeywordAndNoDot() { 21258 const node = parseTokenNode(); 21259 return token() === 24 /* DotToken */ ? void 0 : node; 21260 } 21261 function parseLiteralTypeNode(negative) { 21262 const pos = getNodePos(); 21263 if (negative) { 21264 nextToken(); 21265 } 21266 let expression = token() === 111 /* TrueKeyword */ || token() === 96 /* FalseKeyword */ || token() === 105 /* NullKeyword */ ? parseTokenNode() : parseLiteralLikeNode(token()); 21267 if (negative) { 21268 expression = finishNode(factory2.createPrefixUnaryExpression(40 /* MinusToken */, expression), pos); 21269 } 21270 return finishNode(factory2.createLiteralTypeNode(expression), pos); 21271 } 21272 function isStartOfTypeOfImportType() { 21273 nextToken(); 21274 return token() === 101 /* ImportKeyword */; 21275 } 21276 function parseImportTypeAssertions() { 21277 const pos = getNodePos(); 21278 const openBracePosition = scanner.getTokenPos(); 21279 parseExpected(18 /* OpenBraceToken */); 21280 const multiLine = scanner.hasPrecedingLineBreak(); 21281 parseExpected(131 /* AssertKeyword */); 21282 parseExpected(58 /* ColonToken */); 21283 const clause = parseAssertClause(true); 21284 if (!parseExpected(19 /* CloseBraceToken */)) { 21285 const lastError = lastOrUndefined(parseDiagnostics); 21286 if (lastError && lastError.code === Diagnostics._0_expected.code) { 21287 addRelatedInfo( 21288 lastError, 21289 createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}") 21290 ); 21291 } 21292 } 21293 return finishNode(factory2.createImportTypeAssertionContainer(clause, multiLine), pos); 21294 } 21295 function parseImportType() { 21296 sourceFlags |= 2097152 /* PossiblyContainsDynamicImport */; 21297 const pos = getNodePos(); 21298 const isTypeOf = parseOptional(113 /* TypeOfKeyword */); 21299 parseExpected(101 /* ImportKeyword */); 21300 parseExpected(20 /* OpenParenToken */); 21301 const type = parseType(); 21302 let assertions; 21303 if (parseOptional(27 /* CommaToken */)) { 21304 assertions = parseImportTypeAssertions(); 21305 } 21306 parseExpected(21 /* CloseParenToken */); 21307 const qualifier = parseOptional(24 /* DotToken */) ? parseEntityNameOfTypeReference() : void 0; 21308 const typeArguments = parseTypeArgumentsOfTypeReference(); 21309 return finishNode(factory2.createImportTypeNode(type, assertions, qualifier, typeArguments, isTypeOf), pos); 21310 } 21311 function nextTokenIsNumericOrBigIntLiteral() { 21312 nextToken(); 21313 return token() === 8 /* NumericLiteral */ || token() === 9 /* BigIntLiteral */; 21314 } 21315 function parseNonArrayType() { 21316 switch (token()) { 21317 case 132 /* AnyKeyword */: 21318 case 159 /* UnknownKeyword */: 21319 case 153 /* StringKeyword */: 21320 case 149 /* NumberKeyword */: 21321 case 162 /* BigIntKeyword */: 21322 case 154 /* SymbolKeyword */: 21323 case 135 /* BooleanKeyword */: 21324 case 157 /* UndefinedKeyword */: 21325 case 145 /* NeverKeyword */: 21326 case 150 /* ObjectKeyword */: 21327 return tryParse(parseKeywordAndNoDot) || parseTypeReference(); 21328 case 66 /* AsteriskEqualsToken */: 21329 scanner.reScanAsteriskEqualsToken(); 21330 case 41 /* AsteriskToken */: 21331 return parseJSDocAllType(); 21332 case 60 /* QuestionQuestionToken */: 21333 scanner.reScanQuestionToken(); 21334 case 57 /* QuestionToken */: 21335 return parseJSDocUnknownOrNullableType(); 21336 case 99 /* FunctionKeyword */: 21337 return parseJSDocFunctionType(); 21338 case 53 /* ExclamationToken */: 21339 return parseJSDocNonNullableType(); 21340 case 14 /* NoSubstitutionTemplateLiteral */: 21341 case 10 /* StringLiteral */: 21342 case 8 /* NumericLiteral */: 21343 case 9 /* BigIntLiteral */: 21344 case 111 /* TrueKeyword */: 21345 case 96 /* FalseKeyword */: 21346 case 105 /* NullKeyword */: 21347 return parseLiteralTypeNode(); 21348 case 40 /* MinusToken */: 21349 return lookAhead(nextTokenIsNumericOrBigIntLiteral) ? parseLiteralTypeNode(true) : parseTypeReference(); 21350 case 115 /* VoidKeyword */: 21351 return parseTokenNode(); 21352 case 109 /* ThisKeyword */: { 21353 const thisKeyword = parseThisTypeNode(); 21354 if (token() === 141 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { 21355 return parseThisTypePredicate(thisKeyword); 21356 } else { 21357 return thisKeyword; 21358 } 21359 } 21360 case 113 /* TypeOfKeyword */: 21361 return lookAhead(isStartOfTypeOfImportType) ? parseImportType() : parseTypeQuery(); 21362 case 18 /* OpenBraceToken */: 21363 return lookAhead(isStartOfMappedType) ? parseMappedType() : parseTypeLiteral(); 21364 case 22 /* OpenBracketToken */: 21365 return parseTupleType(); 21366 case 20 /* OpenParenToken */: 21367 return parseParenthesizedType(); 21368 case 101 /* ImportKeyword */: 21369 return parseImportType(); 21370 case 130 /* AssertsKeyword */: 21371 return lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine) ? parseAssertsTypePredicate() : parseTypeReference(); 21372 case 15 /* TemplateHead */: 21373 return parseTemplateType(); 21374 default: 21375 return parseTypeReference(); 21376 } 21377 } 21378 function isStartOfType(inStartOfParameter) { 21379 switch (token()) { 21380 case 132 /* AnyKeyword */: 21381 case 159 /* UnknownKeyword */: 21382 case 153 /* StringKeyword */: 21383 case 149 /* NumberKeyword */: 21384 case 162 /* BigIntKeyword */: 21385 case 135 /* BooleanKeyword */: 21386 case 147 /* ReadonlyKeyword */: 21387 case 154 /* SymbolKeyword */: 21388 case 158 /* UniqueKeyword */: 21389 case 115 /* VoidKeyword */: 21390 case 157 /* UndefinedKeyword */: 21391 case 105 /* NullKeyword */: 21392 case 109 /* ThisKeyword */: 21393 case 113 /* TypeOfKeyword */: 21394 case 145 /* NeverKeyword */: 21395 case 18 /* OpenBraceToken */: 21396 case 22 /* OpenBracketToken */: 21397 case 29 /* LessThanToken */: 21398 case 51 /* BarToken */: 21399 case 50 /* AmpersandToken */: 21400 case 104 /* NewKeyword */: 21401 case 10 /* StringLiteral */: 21402 case 8 /* NumericLiteral */: 21403 case 9 /* BigIntLiteral */: 21404 case 111 /* TrueKeyword */: 21405 case 96 /* FalseKeyword */: 21406 case 150 /* ObjectKeyword */: 21407 case 41 /* AsteriskToken */: 21408 case 57 /* QuestionToken */: 21409 case 53 /* ExclamationToken */: 21410 case 25 /* DotDotDotToken */: 21411 case 139 /* InferKeyword */: 21412 case 101 /* ImportKeyword */: 21413 case 130 /* AssertsKeyword */: 21414 case 14 /* NoSubstitutionTemplateLiteral */: 21415 case 15 /* TemplateHead */: 21416 return true; 21417 case 99 /* FunctionKeyword */: 21418 return !inStartOfParameter; 21419 case 40 /* MinusToken */: 21420 return !inStartOfParameter && lookAhead(nextTokenIsNumericOrBigIntLiteral); 21421 case 20 /* OpenParenToken */: 21422 return !inStartOfParameter && lookAhead(isStartOfParenthesizedOrFunctionType); 21423 default: 21424 return isIdentifier2(); 21425 } 21426 } 21427 function isStartOfParenthesizedOrFunctionType() { 21428 nextToken(); 21429 return token() === 21 /* CloseParenToken */ || isStartOfParameter(false) || isStartOfType(); 21430 } 21431 function parsePostfixTypeOrHigher() { 21432 const pos = getNodePos(); 21433 let type = parseNonArrayType(); 21434 while (!scanner.hasPrecedingLineBreak()) { 21435 switch (token()) { 21436 case 53 /* ExclamationToken */: 21437 nextToken(); 21438 type = finishNode(factory2.createJSDocNonNullableType(type, true), pos); 21439 break; 21440 case 57 /* QuestionToken */: 21441 if (lookAhead(nextTokenIsStartOfType)) { 21442 return type; 21443 } 21444 nextToken(); 21445 type = finishNode(factory2.createJSDocNullableType(type, true), pos); 21446 break; 21447 case 22 /* OpenBracketToken */: 21448 parseExpected(22 /* OpenBracketToken */); 21449 if (isStartOfType()) { 21450 const indexType = parseType(); 21451 parseExpected(23 /* CloseBracketToken */); 21452 type = finishNode(factory2.createIndexedAccessTypeNode(type, indexType), pos); 21453 } else { 21454 parseExpected(23 /* CloseBracketToken */); 21455 type = finishNode(factory2.createArrayTypeNode(type), pos); 21456 } 21457 break; 21458 default: 21459 return type; 21460 } 21461 } 21462 return type; 21463 } 21464 function parseTypeOperator(operator) { 21465 const pos = getNodePos(); 21466 parseExpected(operator); 21467 return finishNode(factory2.createTypeOperatorNode(operator, parseTypeOperatorOrHigher()), pos); 21468 } 21469 function tryParseConstraintOfInferType() { 21470 if (parseOptional(95 /* ExtendsKeyword */)) { 21471 const constraint = disallowConditionalTypesAnd(parseType); 21472 if (inDisallowConditionalTypesContext() || token() !== 57 /* QuestionToken */) { 21473 return constraint; 21474 } 21475 } 21476 } 21477 function parseTypeParameterOfInferType() { 21478 const pos = getNodePos(); 21479 const name = parseIdentifier(); 21480 const constraint = tryParse(tryParseConstraintOfInferType); 21481 const node = factory2.createTypeParameterDeclaration(void 0, name, constraint); 21482 return finishNode(node, pos); 21483 } 21484 function parseInferType() { 21485 const pos = getNodePos(); 21486 parseExpected(139 /* InferKeyword */); 21487 return finishNode(factory2.createInferTypeNode(parseTypeParameterOfInferType()), pos); 21488 } 21489 function parseTypeOperatorOrHigher() { 21490 const operator = token(); 21491 switch (operator) { 21492 case 142 /* KeyOfKeyword */: 21493 case 158 /* UniqueKeyword */: 21494 case 147 /* ReadonlyKeyword */: 21495 return parseTypeOperator(operator); 21496 case 139 /* InferKeyword */: 21497 return parseInferType(); 21498 } 21499 return allowConditionalTypesAnd(parsePostfixTypeOrHigher); 21500 } 21501 function parseFunctionOrConstructorTypeToError(isInUnionType) { 21502 if (isStartOfFunctionTypeOrConstructorType()) { 21503 const type = parseFunctionOrConstructorType(); 21504 let diagnostic; 21505 if (isFunctionTypeNode(type)) { 21506 diagnostic = isInUnionType ? Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_a_union_type : Diagnostics.Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type; 21507 } else { 21508 diagnostic = isInUnionType ? Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type : Diagnostics.Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type; 21509 } 21510 parseErrorAtRange(type, diagnostic); 21511 return type; 21512 } 21513 return void 0; 21514 } 21515 function parseUnionOrIntersectionType(operator, parseConstituentType, createTypeNode) { 21516 const pos = getNodePos(); 21517 const isUnionType = operator === 51 /* BarToken */; 21518 const hasLeadingOperator = parseOptional(operator); 21519 let type = hasLeadingOperator && parseFunctionOrConstructorTypeToError(isUnionType) || parseConstituentType(); 21520 if (token() === operator || hasLeadingOperator) { 21521 const types = [type]; 21522 while (parseOptional(operator)) { 21523 types.push(parseFunctionOrConstructorTypeToError(isUnionType) || parseConstituentType()); 21524 } 21525 type = finishNode(createTypeNode(createNodeArray(types, pos)), pos); 21526 } 21527 return type; 21528 } 21529 function parseIntersectionTypeOrHigher() { 21530 return parseUnionOrIntersectionType(50 /* AmpersandToken */, parseTypeOperatorOrHigher, factory2.createIntersectionTypeNode); 21531 } 21532 function parseUnionTypeOrHigher() { 21533 return parseUnionOrIntersectionType(51 /* BarToken */, parseIntersectionTypeOrHigher, factory2.createUnionTypeNode); 21534 } 21535 function nextTokenIsNewKeyword() { 21536 nextToken(); 21537 return token() === 104 /* NewKeyword */; 21538 } 21539 function isStartOfFunctionTypeOrConstructorType() { 21540 if (token() === 29 /* LessThanToken */) { 21541 return true; 21542 } 21543 if (token() === 20 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType)) { 21544 return true; 21545 } 21546 return token() === 104 /* NewKeyword */ || token() === 127 /* AbstractKeyword */ && lookAhead(nextTokenIsNewKeyword); 21547 } 21548 function skipParameterStart() { 21549 if (isModifierKind(token())) { 21550 parseModifiers(); 21551 } 21552 if (isIdentifier2() || token() === 109 /* ThisKeyword */) { 21553 nextToken(); 21554 return true; 21555 } 21556 if (token() === 22 /* OpenBracketToken */ || token() === 18 /* OpenBraceToken */) { 21557 const previousErrorCount = parseDiagnostics.length; 21558 parseIdentifierOrPattern(); 21559 return previousErrorCount === parseDiagnostics.length; 21560 } 21561 return false; 21562 } 21563 function isUnambiguouslyStartOfFunctionType() { 21564 nextToken(); 21565 if (token() === 21 /* CloseParenToken */ || token() === 25 /* DotDotDotToken */) { 21566 return true; 21567 } 21568 if (skipParameterStart()) { 21569 if (token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 57 /* QuestionToken */ || token() === 63 /* EqualsToken */) { 21570 return true; 21571 } 21572 if (token() === 21 /* CloseParenToken */) { 21573 nextToken(); 21574 if (token() === 38 /* EqualsGreaterThanToken */) { 21575 return true; 21576 } 21577 } 21578 } 21579 return false; 21580 } 21581 function parseTypeOrTypePredicate() { 21582 const pos = getNodePos(); 21583 const typePredicateVariable = isIdentifier2() && tryParse(parseTypePredicatePrefix); 21584 const type = parseType(); 21585 if (typePredicateVariable) { 21586 return finishNode(factory2.createTypePredicateNode(void 0, typePredicateVariable, type), pos); 21587 } else { 21588 return type; 21589 } 21590 } 21591 function parseTypePredicatePrefix() { 21592 const id = parseIdentifier(); 21593 if (token() === 141 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { 21594 nextToken(); 21595 return id; 21596 } 21597 } 21598 function parseAssertsTypePredicate() { 21599 const pos = getNodePos(); 21600 const assertsModifier = parseExpectedToken(130 /* AssertsKeyword */); 21601 const parameterName = token() === 109 /* ThisKeyword */ ? parseThisTypeNode() : parseIdentifier(); 21602 const type = parseOptional(141 /* IsKeyword */) ? parseType() : void 0; 21603 return finishNode(factory2.createTypePredicateNode(assertsModifier, parameterName, type), pos); 21604 } 21605 function parseType() { 21606 if (contextFlags & 40960 /* TypeExcludesFlags */) { 21607 return doOutsideOfContext(40960 /* TypeExcludesFlags */, parseType); 21608 } 21609 if (isStartOfFunctionTypeOrConstructorType()) { 21610 return parseFunctionOrConstructorType(); 21611 } 21612 const pos = getNodePos(); 21613 const type = parseUnionTypeOrHigher(); 21614 if (!inDisallowConditionalTypesContext() && !scanner.hasPrecedingLineBreak() && parseOptional(95 /* ExtendsKeyword */)) { 21615 const extendsType = disallowConditionalTypesAnd(parseType); 21616 parseExpected(57 /* QuestionToken */); 21617 const trueType = allowConditionalTypesAnd(parseType); 21618 parseExpected(58 /* ColonToken */); 21619 const falseType = allowConditionalTypesAnd(parseType); 21620 return finishNode(factory2.createConditionalTypeNode(type, extendsType, trueType, falseType), pos); 21621 } 21622 return type; 21623 } 21624 function parseEtsType(pos, name) { 21625 const contextFlagsToClear = 40960 /* TypeExcludesFlags */ & contextFlags; 21626 if (contextFlagsToClear) { 21627 setContextFlag(false, contextFlagsToClear); 21628 const result = parseEtsTypeReferenceWorker(pos, name); 21629 setContextFlag(true, contextFlagsToClear); 21630 return result; 21631 } 21632 return parseEtsTypeReferenceWorker(pos, name); 21633 } 21634 function parseEtsTypeReferenceWorker(pos, name) { 21635 return finishVirtualNode( 21636 factory2.createTypeReferenceNode( 21637 finishVirtualNode(factory2.createIdentifier(name), pos, pos) 21638 ), 21639 pos, 21640 pos 21641 ); 21642 } 21643 function parseTypeAnnotation() { 21644 return parseOptional(58 /* ColonToken */) ? parseType() : void 0; 21645 } 21646 function isStartOfLeftHandSideExpression() { 21647 switch (token()) { 21648 case 109 /* ThisKeyword */: 21649 case 107 /* SuperKeyword */: 21650 case 105 /* NullKeyword */: 21651 case 111 /* TrueKeyword */: 21652 case 96 /* FalseKeyword */: 21653 case 8 /* NumericLiteral */: 21654 case 9 /* BigIntLiteral */: 21655 case 10 /* StringLiteral */: 21656 case 14 /* NoSubstitutionTemplateLiteral */: 21657 case 15 /* TemplateHead */: 21658 case 20 /* OpenParenToken */: 21659 case 22 /* OpenBracketToken */: 21660 case 18 /* OpenBraceToken */: 21661 case 99 /* FunctionKeyword */: 21662 case 84 /* ClassKeyword */: 21663 case 104 /* NewKeyword */: 21664 case 43 /* SlashToken */: 21665 case 68 /* SlashEqualsToken */: 21666 case 79 /* Identifier */: 21667 return true; 21668 case 85 /* StructKeyword */: 21669 return inEtsContext(); 21670 case 101 /* ImportKeyword */: 21671 return lookAhead(nextTokenIsOpenParenOrLessThanOrDot); 21672 default: 21673 return isIdentifier2(); 21674 } 21675 } 21676 function isStartOfExpression() { 21677 if (isStartOfLeftHandSideExpression()) { 21678 return true; 21679 } 21680 switch (token()) { 21681 case 39 /* PlusToken */: 21682 case 40 /* MinusToken */: 21683 case 54 /* TildeToken */: 21684 case 53 /* ExclamationToken */: 21685 case 90 /* DeleteKeyword */: 21686 case 113 /* TypeOfKeyword */: 21687 case 115 /* VoidKeyword */: 21688 case 45 /* PlusPlusToken */: 21689 case 46 /* MinusMinusToken */: 21690 case 29 /* LessThanToken */: 21691 case 134 /* AwaitKeyword */: 21692 case 126 /* YieldKeyword */: 21693 case 80 /* PrivateIdentifier */: 21694 return true; 21695 case 24 /* DotToken */: 21696 return isValidExtendOrStylesContext(); 21697 default: 21698 if (isBinaryOperator2()) { 21699 return true; 21700 } 21701 return isIdentifier2(); 21702 } 21703 } 21704 function isValidExtendOrStylesContext() { 21705 return inEtsExtendComponentsContext() && !!extendEtsComponentDeclaration || inEtsStylesComponentsContext() && !!stylesEtsComponentDeclaration; 21706 } 21707 function isStartOfExpressionStatement() { 21708 return token() !== 18 /* OpenBraceToken */ && token() !== 99 /* FunctionKeyword */ && token() !== 84 /* ClassKeyword */ && (!inEtsContext() || token() !== 85 /* StructKeyword */) && token() !== 59 /* AtToken */ && isStartOfExpression(); 21709 } 21710 function parseExpression() { 21711 const saveDecoratorContext = inDecoratorContext(); 21712 if (saveDecoratorContext) { 21713 setDecoratorContext(false); 21714 } 21715 const pos = getNodePos(); 21716 let expr = parseAssignmentExpressionOrHigher(true); 21717 let operatorToken; 21718 while (operatorToken = parseOptionalToken(27 /* CommaToken */)) { 21719 expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(true), pos); 21720 } 21721 if (saveDecoratorContext) { 21722 setDecoratorContext(true); 21723 } 21724 return expr; 21725 } 21726 function parseInitializer() { 21727 return parseOptional(63 /* EqualsToken */) ? parseAssignmentExpressionOrHigher(true) : void 0; 21728 } 21729 function parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction) { 21730 if (isYieldExpression()) { 21731 return parseYieldExpression(); 21732 } 21733 const arrowExpression = tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) || tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction); 21734 if (arrowExpression) { 21735 return arrowExpression; 21736 } 21737 const pos = getNodePos(); 21738 const expr = parseBinaryExpressionOrHigher(0 /* Lowest */); 21739 if (expr.kind === 79 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) { 21740 return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, void 0); 21741 } 21742 if (isLeftHandSideExpression(expr) && isAssignmentOperator(reScanGreaterToken())) { 21743 return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction), pos); 21744 } 21745 if ((inBuildContext() || inBuilderContext()) && inUICallbackContext() && isCallExpression(expr) && token() === 18 /* OpenBraceToken */) { 21746 return makeEtsComponentExpression(expr, pos); 21747 } 21748 return parseConditionalExpressionRest(expr, pos, allowReturnTypeInArrowFunction); 21749 } 21750 function makeEtsComponentExpression(expression, pos) { 21751 const name = expression.expression; 21752 const body = parseFunctionBlock(0 /* None */); 21753 return finishNode(factory2.createEtsComponentExpression(name, expression.arguments, body), pos); 21754 } 21755 function isYieldExpression() { 21756 if (token() === 126 /* YieldKeyword */) { 21757 if (inYieldContext()) { 21758 return true; 21759 } 21760 return lookAhead(nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine); 21761 } 21762 return false; 21763 } 21764 function nextTokenIsIdentifierOnSameLine() { 21765 nextToken(); 21766 return !scanner.hasPrecedingLineBreak() && isIdentifier2(); 21767 } 21768 function parseYieldExpression() { 21769 const pos = getNodePos(); 21770 nextToken(); 21771 if (!scanner.hasPrecedingLineBreak() && (token() === 41 /* AsteriskToken */ || isStartOfExpression())) { 21772 return finishNode( 21773 factory2.createYieldExpression( 21774 parseOptionalToken(41 /* AsteriskToken */), 21775 parseAssignmentExpressionOrHigher(true) 21776 ), 21777 pos 21778 ); 21779 } else { 21780 return finishNode(factory2.createYieldExpression(void 0, void 0), pos); 21781 } 21782 } 21783 function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, asyncModifier) { 21784 Debug.assert(token() === 38 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); 21785 const parameter = factory2.createParameterDeclaration( 21786 void 0, 21787 void 0, 21788 identifier, 21789 void 0, 21790 void 0, 21791 void 0 21792 ); 21793 finishNode(parameter, identifier.pos); 21794 const parameters = createNodeArray([parameter], parameter.pos, parameter.end); 21795 const equalsGreaterThanToken = parseExpectedToken(38 /* EqualsGreaterThanToken */); 21796 let originUIContextFlag = inUICallbackContext(); 21797 let originNoEtsComponentContextFlag = inNoEtsComponentContext(); 21798 setUICallbackContext(inSyntaxComponentContext() && !inSyntaxDataSourceContext()); 21799 if (inSyntaxComponentContext() && !inSyntaxDataSourceContext()) { 21800 setSyntaxComponentContext(false); 21801 } 21802 setNoEtsComponentContext(!inUICallbackContext()); 21803 const body = parseArrowFunctionExpressionBody(!!asyncModifier, allowReturnTypeInArrowFunction); 21804 const node = factory2.createArrowFunction(asyncModifier, void 0, parameters, void 0, equalsGreaterThanToken, body); 21805 setUICallbackContext(originUIContextFlag); 21806 setNoEtsComponentContext(originNoEtsComponentContextFlag); 21807 return addJSDocComment(finishNode(node, pos)); 21808 } 21809 function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { 21810 const triState = isParenthesizedArrowFunctionExpression(); 21811 if (triState === Tristate.False) { 21812 return void 0; 21813 } 21814 return triState === Tristate.True ? parseParenthesizedArrowFunctionExpression(true, true) : tryParse(() => parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction)); 21815 } 21816 function isParenthesizedArrowFunctionExpression() { 21817 if (token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */ || token() === 133 /* AsyncKeyword */) { 21818 return lookAhead(isParenthesizedArrowFunctionExpressionWorker); 21819 } 21820 if (token() === 38 /* EqualsGreaterThanToken */) { 21821 return Tristate.True; 21822 } 21823 return Tristate.False; 21824 } 21825 function isParenthesizedArrowFunctionExpressionWorker() { 21826 if (token() === 133 /* AsyncKeyword */) { 21827 nextToken(); 21828 if (scanner.hasPrecedingLineBreak()) { 21829 return Tristate.False; 21830 } 21831 if (token() !== 20 /* OpenParenToken */ && token() !== 29 /* LessThanToken */) { 21832 return Tristate.False; 21833 } 21834 } 21835 const first2 = token(); 21836 const second = nextToken(); 21837 if (first2 === 20 /* OpenParenToken */) { 21838 if (second === 21 /* CloseParenToken */) { 21839 const third = nextToken(); 21840 switch (third) { 21841 case 38 /* EqualsGreaterThanToken */: 21842 case 58 /* ColonToken */: 21843 case 18 /* OpenBraceToken */: 21844 return Tristate.True; 21845 default: 21846 return Tristate.False; 21847 } 21848 } 21849 if (second === 22 /* OpenBracketToken */ || second === 18 /* OpenBraceToken */) { 21850 return Tristate.Unknown; 21851 } 21852 if (second === 25 /* DotDotDotToken */) { 21853 return Tristate.True; 21854 } 21855 if (isModifierKind(second) && second !== 133 /* AsyncKeyword */ && lookAhead(nextTokenIsIdentifier)) { 21856 if (nextToken() === 129 /* AsKeyword */) { 21857 return Tristate.False; 21858 } 21859 return Tristate.True; 21860 } 21861 if (!isIdentifier2() && second !== 109 /* ThisKeyword */) { 21862 return Tristate.False; 21863 } 21864 switch (nextToken()) { 21865 case 58 /* ColonToken */: 21866 return Tristate.True; 21867 case 57 /* QuestionToken */: 21868 nextToken(); 21869 if (token() === 58 /* ColonToken */ || token() === 27 /* CommaToken */ || token() === 63 /* EqualsToken */ || token() === 21 /* CloseParenToken */) { 21870 return Tristate.True; 21871 } 21872 return Tristate.False; 21873 case 27 /* CommaToken */: 21874 case 63 /* EqualsToken */: 21875 case 21 /* CloseParenToken */: 21876 return Tristate.Unknown; 21877 } 21878 return Tristate.False; 21879 } else { 21880 Debug.assert(first2 === 29 /* LessThanToken */); 21881 if (!isIdentifier2()) { 21882 return Tristate.False; 21883 } 21884 if (languageVariant === 1 /* JSX */) { 21885 const isArrowFunctionInJsx = lookAhead(() => { 21886 const third = nextToken(); 21887 if (third === 95 /* ExtendsKeyword */) { 21888 const fourth = nextToken(); 21889 switch (fourth) { 21890 case 63 /* EqualsToken */: 21891 case 31 /* GreaterThanToken */: 21892 return false; 21893 default: 21894 return true; 21895 } 21896 } else if (third === 27 /* CommaToken */ || third === 63 /* EqualsToken */) { 21897 return true; 21898 } 21899 return false; 21900 }); 21901 if (isArrowFunctionInJsx) { 21902 return Tristate.True; 21903 } 21904 return Tristate.False; 21905 } 21906 return Tristate.Unknown; 21907 } 21908 } 21909 function parsePossibleParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) { 21910 const tokenPos = scanner.getTokenPos(); 21911 if (notParenthesizedArrow == null ? void 0 : notParenthesizedArrow.has(tokenPos)) { 21912 return void 0; 21913 } 21914 const result = parseParenthesizedArrowFunctionExpression(false, allowReturnTypeInArrowFunction); 21915 if (!result) { 21916 (notParenthesizedArrow || (notParenthesizedArrow = new Set2())).add(tokenPos); 21917 } 21918 return result; 21919 } 21920 function tryParseAsyncSimpleArrowFunctionExpression(allowReturnTypeInArrowFunction) { 21921 if (token() === 133 /* AsyncKeyword */) { 21922 if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === Tristate.True) { 21923 const pos = getNodePos(); 21924 const asyncModifier = parseModifiersForArrowFunction(); 21925 const expr = parseBinaryExpressionOrHigher(0 /* Lowest */); 21926 return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, asyncModifier); 21927 } 21928 } 21929 return void 0; 21930 } 21931 function isUnParenthesizedAsyncArrowFunctionWorker() { 21932 if (token() === 133 /* AsyncKeyword */) { 21933 nextToken(); 21934 if (scanner.hasPrecedingLineBreak() || token() === 38 /* EqualsGreaterThanToken */) { 21935 return Tristate.False; 21936 } 21937 const expr = parseBinaryExpressionOrHigher(0 /* Lowest */); 21938 if (!scanner.hasPrecedingLineBreak() && expr.kind === 79 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) { 21939 return Tristate.True; 21940 } 21941 } 21942 return Tristate.False; 21943 } 21944 function parseParenthesizedArrowFunctionExpression(allowAmbiguity, allowReturnTypeInArrowFunction) { 21945 const pos = getNodePos(); 21946 const hasJSDoc = hasPrecedingJSDocComment(); 21947 const modifiers = parseModifiersForArrowFunction(); 21948 const isAsync = some(modifiers, isAsyncModifier) ? 2 /* Await */ : 0 /* None */; 21949 const typeParameters = parseTypeParameters(); 21950 let parameters; 21951 if (!parseExpected(20 /* OpenParenToken */)) { 21952 if (!allowAmbiguity) { 21953 return void 0; 21954 } 21955 parameters = createMissingList(); 21956 } else { 21957 if (!allowAmbiguity) { 21958 const maybeParameters = parseParametersWorker(isAsync, allowAmbiguity); 21959 if (!maybeParameters) { 21960 return void 0; 21961 } 21962 parameters = maybeParameters; 21963 } else { 21964 parameters = parseParametersWorker(isAsync, allowAmbiguity); 21965 } 21966 if (!parseExpected(21 /* CloseParenToken */) && !allowAmbiguity) { 21967 return void 0; 21968 } 21969 } 21970 const hasReturnColon = token() === 58 /* ColonToken */; 21971 const type = parseReturnType(58 /* ColonToken */, false); 21972 if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) { 21973 return void 0; 21974 } 21975 let unwrappedType = type; 21976 while ((unwrappedType == null ? void 0 : unwrappedType.kind) === 196 /* ParenthesizedType */) { 21977 unwrappedType = unwrappedType.type; 21978 } 21979 const hasJSDocFunctionType = unwrappedType && isJSDocFunctionType(unwrappedType); 21980 if (!allowAmbiguity && token() !== 38 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) { 21981 return void 0; 21982 } 21983 const lastToken = token(); 21984 const equalsGreaterThanToken = parseExpectedToken(38 /* EqualsGreaterThanToken */); 21985 let originUIContextFlag = inUICallbackContext(); 21986 let originNoEtsComponentContextFlag = inNoEtsComponentContext(); 21987 setUICallbackContext(inSyntaxComponentContext() && !inSyntaxDataSourceContext()); 21988 if (inSyntaxComponentContext() && !inSyntaxDataSourceContext()) { 21989 setSyntaxComponentContext(false); 21990 } 21991 setNoEtsComponentContext(!inUICallbackContext()); 21992 const body = lastToken === 38 /* EqualsGreaterThanToken */ || lastToken === 18 /* OpenBraceToken */ ? parseArrowFunctionExpressionBody(some(modifiers, isAsyncModifier), allowReturnTypeInArrowFunction) : parseIdentifier(); 21993 setUICallbackContext(originUIContextFlag); 21994 setNoEtsComponentContext(originNoEtsComponentContextFlag); 21995 if (!allowReturnTypeInArrowFunction && hasReturnColon) { 21996 if (token() !== 58 /* ColonToken */) { 21997 return void 0; 21998 } 21999 } 22000 const node = factory2.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body); 22001 return withJSDoc(finishNode(node, pos), hasJSDoc); 22002 } 22003 function parseArrowFunctionExpressionBody(isAsync, allowReturnTypeInArrowFunction) { 22004 if (token() === 18 /* OpenBraceToken */) { 22005 return parseFunctionBlock(isAsync ? 2 /* Await */ : 0 /* None */); 22006 } 22007 if (token() !== 26 /* SemicolonToken */ && token() !== 99 /* FunctionKeyword */ && token() !== 84 /* ClassKeyword */ && (!inEtsContext() || token() !== 85 /* StructKeyword */) && isStartOfStatement() && !isStartOfExpressionStatement()) { 22008 return parseFunctionBlock(16 /* IgnoreMissingOpenBrace */ | (isAsync ? 2 /* Await */ : 0 /* None */)); 22009 } 22010 const savedTopLevel = topLevel; 22011 topLevel = false; 22012 const node = isAsync ? doInAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction)) : doOutsideOfAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction)); 22013 topLevel = savedTopLevel; 22014 return node; 22015 } 22016 function parseConditionalExpressionRest(leftOperand, pos, allowReturnTypeInArrowFunction) { 22017 const questionToken = parseOptionalToken(57 /* QuestionToken */); 22018 if (!questionToken) { 22019 return leftOperand; 22020 } 22021 let colonToken; 22022 return finishNode( 22023 factory2.createConditionalExpression( 22024 leftOperand, 22025 questionToken, 22026 doOutsideOfContext(disallowInAndDecoratorContext, () => parseAssignmentExpressionOrHigher(false)), 22027 colonToken = parseExpectedToken(58 /* ColonToken */), 22028 nodeIsPresent(colonToken) ? parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction) : createMissingNode(79 /* Identifier */, false, Diagnostics._0_expected, tokenToString(58 /* ColonToken */)) 22029 ), 22030 pos 22031 ); 22032 } 22033 function parseBinaryExpressionOrHigher(precedence) { 22034 const pos = getNodePos(); 22035 const leftOperand = parseUnaryExpressionOrHigher(); 22036 return parseBinaryExpressionRest(precedence, leftOperand, pos); 22037 } 22038 function isInOrOfKeyword(t) { 22039 return t === 102 /* InKeyword */ || t === 164 /* OfKeyword */; 22040 } 22041 function parseBinaryExpressionRest(precedence, leftOperand, pos) { 22042 while (true) { 22043 reScanGreaterToken(); 22044 const newPrecedence = getBinaryOperatorPrecedence(token()); 22045 const consumeCurrentOperator = token() === 42 /* AsteriskAsteriskToken */ ? newPrecedence >= precedence : newPrecedence > precedence; 22046 if (!consumeCurrentOperator) { 22047 break; 22048 } 22049 if (token() === 102 /* InKeyword */ && inDisallowInContext()) { 22050 break; 22051 } 22052 if (token() === 129 /* AsKeyword */ || token() === 151 /* SatisfiesKeyword */) { 22053 if (scanner.hasPrecedingLineBreak()) { 22054 break; 22055 } else { 22056 const keywordKind = token(); 22057 nextToken(); 22058 leftOperand = keywordKind === 151 /* SatisfiesKeyword */ ? makeSatisfiesExpression(leftOperand, parseType()) : makeAsExpression(leftOperand, parseType()); 22059 } 22060 } else { 22061 leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence), pos); 22062 } 22063 } 22064 return leftOperand; 22065 } 22066 function isBinaryOperator2() { 22067 if (inDisallowInContext() && token() === 102 /* InKeyword */) { 22068 return false; 22069 } 22070 return getBinaryOperatorPrecedence(token()) > 0; 22071 } 22072 function makeSatisfiesExpression(left, right) { 22073 return finishNode(factory2.createSatisfiesExpression(left, right), left.pos); 22074 } 22075 function makeBinaryExpression(left, operatorToken, right, pos) { 22076 return finishNode(factory2.createBinaryExpression(left, operatorToken, right), pos); 22077 } 22078 function makeAsExpression(left, right) { 22079 return finishNode(factory2.createAsExpression(left, right), left.pos); 22080 } 22081 function parsePrefixUnaryExpression() { 22082 const pos = getNodePos(); 22083 return finishNode(factory2.createPrefixUnaryExpression(token(), nextTokenAnd(parseSimpleUnaryExpression)), pos); 22084 } 22085 function parseDeleteExpression() { 22086 const pos = getNodePos(); 22087 return finishNode(factory2.createDeleteExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos); 22088 } 22089 function parseTypeOfExpression() { 22090 const pos = getNodePos(); 22091 return finishNode(factory2.createTypeOfExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos); 22092 } 22093 function parseVoidExpression() { 22094 const pos = getNodePos(); 22095 return finishNode(factory2.createVoidExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos); 22096 } 22097 function isAwaitExpression() { 22098 if (token() === 134 /* AwaitKeyword */) { 22099 if (inAwaitContext()) { 22100 return true; 22101 } 22102 return lookAhead(nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine); 22103 } 22104 return false; 22105 } 22106 function parseAwaitExpression() { 22107 const pos = getNodePos(); 22108 return finishNode(factory2.createAwaitExpression(nextTokenAnd(parseSimpleUnaryExpression)), pos); 22109 } 22110 function parseUnaryExpressionOrHigher() { 22111 if (isUpdateExpression()) { 22112 const pos = getNodePos(); 22113 const updateExpression = parseUpdateExpression(); 22114 return token() === 42 /* AsteriskAsteriskToken */ ? parseBinaryExpressionRest(getBinaryOperatorPrecedence(token()), updateExpression, pos) : updateExpression; 22115 } 22116 const unaryOperator = token(); 22117 const simpleUnaryExpression = parseSimpleUnaryExpression(); 22118 if (token() === 42 /* AsteriskAsteriskToken */) { 22119 const pos = skipTrivia(sourceText, simpleUnaryExpression.pos); 22120 const { end } = simpleUnaryExpression; 22121 if (simpleUnaryExpression.kind === 216 /* TypeAssertionExpression */) { 22122 parseErrorAt(pos, end, Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); 22123 } else { 22124 parseErrorAt(pos, end, Diagnostics.An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses, tokenToString(unaryOperator)); 22125 } 22126 } 22127 return simpleUnaryExpression; 22128 } 22129 function parseSimpleUnaryExpression() { 22130 switch (token()) { 22131 case 39 /* PlusToken */: 22132 case 40 /* MinusToken */: 22133 case 54 /* TildeToken */: 22134 case 53 /* ExclamationToken */: 22135 return parsePrefixUnaryExpression(); 22136 case 90 /* DeleteKeyword */: 22137 return parseDeleteExpression(); 22138 case 113 /* TypeOfKeyword */: 22139 return parseTypeOfExpression(); 22140 case 115 /* VoidKeyword */: 22141 return parseVoidExpression(); 22142 case 29 /* LessThanToken */: 22143 return parseTypeAssertion(); 22144 case 134 /* AwaitKeyword */: 22145 if (isAwaitExpression()) { 22146 return parseAwaitExpression(); 22147 } 22148 default: 22149 return parseUpdateExpression(); 22150 } 22151 } 22152 function isUpdateExpression() { 22153 switch (token()) { 22154 case 39 /* PlusToken */: 22155 case 40 /* MinusToken */: 22156 case 54 /* TildeToken */: 22157 case 53 /* ExclamationToken */: 22158 case 90 /* DeleteKeyword */: 22159 case 113 /* TypeOfKeyword */: 22160 case 115 /* VoidKeyword */: 22161 case 134 /* AwaitKeyword */: 22162 return false; 22163 case 29 /* LessThanToken */: 22164 if (languageVariant !== 1 /* JSX */) { 22165 return false; 22166 } 22167 default: 22168 return true; 22169 } 22170 } 22171 function parseUpdateExpression() { 22172 if (token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) { 22173 const pos = getNodePos(); 22174 return finishNode(factory2.createPrefixUnaryExpression(token(), nextTokenAnd(parseLeftHandSideExpressionOrHigher)), pos); 22175 } else if (languageVariant === 1 /* JSX */ && token() === 29 /* LessThanToken */ && lookAhead(nextTokenIsIdentifierOrKeywordOrGreaterThan)) { 22176 return parseJsxElementOrSelfClosingElementOrFragment(true); 22177 } 22178 const expression = parseLeftHandSideExpressionOrHigher(); 22179 Debug.assert(isLeftHandSideExpression(expression)); 22180 if ((token() === 45 /* PlusPlusToken */ || token() === 46 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { 22181 const operator = token(); 22182 nextToken(); 22183 return finishNode(factory2.createPostfixUnaryExpression(expression, operator), expression.pos); 22184 } 22185 return expression; 22186 } 22187 function parseLeftHandSideExpressionOrHigher() { 22188 const pos = getNodePos(); 22189 let expression; 22190 if (token() === 101 /* ImportKeyword */) { 22191 if (lookAhead(nextTokenIsOpenParenOrLessThan)) { 22192 sourceFlags |= 2097152 /* PossiblyContainsDynamicImport */; 22193 expression = parseTokenNode(); 22194 } else if (lookAhead(nextTokenIsDot)) { 22195 nextToken(); 22196 nextToken(); 22197 expression = finishNode(factory2.createMetaProperty(101 /* ImportKeyword */, parseIdentifierName()), pos); 22198 sourceFlags |= 4194304 /* PossiblyContainsImportMeta */; 22199 } else { 22200 expression = parseMemberExpressionOrHigher(); 22201 } 22202 } else { 22203 expression = token() === 107 /* SuperKeyword */ ? parseSuperExpression() : parseMemberExpressionOrHigher(); 22204 } 22205 return parseCallExpressionRest(pos, expression); 22206 } 22207 function parseMemberExpressionOrHigher() { 22208 const pos = getNodePos(); 22209 let expression; 22210 if (inEtsExtendComponentsContext() && extendEtsComponentDeclaration && token() === 24 /* DotToken */) { 22211 expression = finishVirtualNode(factory2.createIdentifier(extendEtsComponentDeclaration.instance, void 0, 79 /* Identifier */), pos, pos); 22212 } else if (inEtsStylesComponentsContext() && stylesEtsComponentDeclaration && token() === 24 /* DotToken */) { 22213 expression = finishVirtualNode(factory2.createIdentifier(stylesEtsComponentDeclaration.instance, void 0, 79 /* Identifier */), pos, pos); 22214 } else if (inEtsStateStylesContext() && stateStylesRootNode && token() === 24 /* DotToken */) { 22215 expression = finishVirtualNode(factory2.createIdentifier(`${stateStylesRootNode}Instance`, void 0, 79 /* Identifier */), pos, pos); 22216 } else { 22217 expression = parsePrimaryExpression(); 22218 } 22219 return parseMemberExpressionRest(pos, expression, true); 22220 } 22221 function parseSuperExpression() { 22222 const pos = getNodePos(); 22223 let expression = parseTokenNode(); 22224 if (token() === 29 /* LessThanToken */) { 22225 const startPos = getNodePos(); 22226 const typeArguments = tryParse(parseTypeArgumentsInExpression); 22227 if (typeArguments !== void 0) { 22228 parseErrorAt(startPos, getNodePos(), Diagnostics.super_may_not_use_type_arguments); 22229 if (!isTemplateStartOfTaggedTemplate()) { 22230 expression = factory2.createExpressionWithTypeArguments(expression, typeArguments); 22231 } 22232 } 22233 } 22234 if (token() === 20 /* OpenParenToken */ || token() === 24 /* DotToken */ || token() === 22 /* OpenBracketToken */) { 22235 return expression; 22236 } 22237 parseExpectedToken(24 /* DotToken */, Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); 22238 return finishNode(factory2.createPropertyAccessExpression(expression, parseRightSideOfDot(true, true)), pos); 22239 } 22240 function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition, openingTag) { 22241 const pos = getNodePos(); 22242 const opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); 22243 let result; 22244 if (opening.kind === 289 /* JsxOpeningElement */) { 22245 let children = parseJsxChildren(opening); 22246 let closingElement; 22247 const lastChild = children[children.length - 1]; 22248 if ((lastChild == null ? void 0 : lastChild.kind) === 287 /* JsxElement */ && !tagNamesAreEquivalent(lastChild.openingElement.tagName, lastChild.closingElement.tagName) && tagNamesAreEquivalent(opening.tagName, lastChild.closingElement.tagName)) { 22249 const end = lastChild.children.end; 22250 const newLast = finishNode( 22251 factory2.createJsxElement( 22252 lastChild.openingElement, 22253 lastChild.children, 22254 finishNode(factory2.createJsxClosingElement(finishNode(factory2.createIdentifier(""), end, end)), end, end) 22255 ), 22256 lastChild.openingElement.pos, 22257 end 22258 ); 22259 children = createNodeArray([...children.slice(0, children.length - 1), newLast], children.pos, end); 22260 closingElement = lastChild.closingElement; 22261 } else { 22262 closingElement = parseJsxClosingElement(opening, inExpressionContext); 22263 if (!tagNamesAreEquivalent(opening.tagName, closingElement.tagName)) { 22264 if (openingTag && isJsxOpeningElement(openingTag) && tagNamesAreEquivalent(closingElement.tagName, openingTag.tagName)) { 22265 parseErrorAtRange(opening.tagName, Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, getTextOfNodeFromSourceText(sourceText, opening.tagName)); 22266 } else { 22267 parseErrorAtRange(closingElement.tagName, Diagnostics.Expected_corresponding_JSX_closing_tag_for_0, getTextOfNodeFromSourceText(sourceText, opening.tagName)); 22268 } 22269 } 22270 } 22271 result = finishNode(factory2.createJsxElement(opening, children, closingElement), pos); 22272 } else if (opening.kind === 292 /* JsxOpeningFragment */) { 22273 result = finishNode(factory2.createJsxFragment(opening, parseJsxChildren(opening), parseJsxClosingFragment(inExpressionContext)), pos); 22274 } else { 22275 Debug.assert(opening.kind === 288 /* JsxSelfClosingElement */); 22276 result = opening; 22277 } 22278 if (inExpressionContext && token() === 29 /* LessThanToken */) { 22279 const topBadPos = typeof topInvalidNodePosition === "undefined" ? result.pos : topInvalidNodePosition; 22280 const invalidElement = tryParse(() => parseJsxElementOrSelfClosingElementOrFragment(true, topBadPos)); 22281 if (invalidElement) { 22282 const operatorToken = createMissingNode(27 /* CommaToken */, false); 22283 setTextRangePosWidth(operatorToken, invalidElement.pos, 0); 22284 parseErrorAt(skipTrivia(sourceText, topBadPos), invalidElement.end, Diagnostics.JSX_expressions_must_have_one_parent_element); 22285 return finishNode(factory2.createBinaryExpression(result, operatorToken, invalidElement), pos); 22286 } 22287 } 22288 return result; 22289 } 22290 function parseJsxText() { 22291 const pos = getNodePos(); 22292 const node = factory2.createJsxText(scanner.getTokenValue(), currentToken === 12 /* JsxTextAllWhiteSpaces */); 22293 currentToken = scanner.scanJsxToken(); 22294 return finishNode(node, pos); 22295 } 22296 function parseJsxChild(openingTag, token2) { 22297 switch (token2) { 22298 case 1 /* EndOfFileToken */: 22299 if (isJsxOpeningFragment(openingTag)) { 22300 parseErrorAtRange(openingTag, Diagnostics.JSX_fragment_has_no_corresponding_closing_tag); 22301 } else { 22302 const tag = openingTag.tagName; 22303 const start = skipTrivia(sourceText, tag.pos); 22304 parseErrorAt(start, tag.end, Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, getTextOfNodeFromSourceText(sourceText, openingTag.tagName)); 22305 } 22306 return void 0; 22307 case 30 /* LessThanSlashToken */: 22308 case 7 /* ConflictMarkerTrivia */: 22309 return void 0; 22310 case 11 /* JsxText */: 22311 case 12 /* JsxTextAllWhiteSpaces */: 22312 return parseJsxText(); 22313 case 18 /* OpenBraceToken */: 22314 return parseJsxExpression(false); 22315 case 29 /* LessThanToken */: 22316 return parseJsxElementOrSelfClosingElementOrFragment(false, void 0, openingTag); 22317 default: 22318 return Debug.assertNever(token2); 22319 } 22320 } 22321 function parseJsxChildren(openingTag) { 22322 const list = []; 22323 const listPos = getNodePos(); 22324 const saveParsingContext = parsingContext; 22325 parsingContext |= 1 << ParsingContext.JsxChildren; 22326 while (true) { 22327 const child = parseJsxChild(openingTag, currentToken = scanner.reScanJsxToken()); 22328 if (!child) 22329 break; 22330 list.push(child); 22331 if (isJsxOpeningElement(openingTag) && (child == null ? void 0 : child.kind) === 287 /* JsxElement */ && !tagNamesAreEquivalent(child.openingElement.tagName, child.closingElement.tagName) && tagNamesAreEquivalent(openingTag.tagName, child.closingElement.tagName)) { 22332 break; 22333 } 22334 } 22335 parsingContext = saveParsingContext; 22336 return createNodeArray(list, listPos); 22337 } 22338 function parseJsxAttributes() { 22339 const pos = getNodePos(); 22340 return finishNode(factory2.createJsxAttributes(parseList(ParsingContext.JsxAttributes, parseJsxAttribute)), pos); 22341 } 22342 function parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext) { 22343 const pos = getNodePos(); 22344 parseExpected(29 /* LessThanToken */); 22345 if (token() === 31 /* GreaterThanToken */) { 22346 scanJsxText(); 22347 return finishNode(factory2.createJsxOpeningFragment(), pos); 22348 } 22349 const tagName = parseJsxElementName(); 22350 const typeArguments = (contextFlags & 262144 /* JavaScriptFile */) === 0 ? tryParseTypeArguments() : void 0; 22351 const attributes = parseJsxAttributes(); 22352 let node; 22353 if (token() === 31 /* GreaterThanToken */) { 22354 scanJsxText(); 22355 node = factory2.createJsxOpeningElement(tagName, typeArguments, attributes); 22356 } else { 22357 parseExpected(43 /* SlashToken */); 22358 if (parseExpected(31 /* GreaterThanToken */, void 0, false)) { 22359 if (inExpressionContext) { 22360 nextToken(); 22361 } else { 22362 scanJsxText(); 22363 } 22364 } 22365 node = factory2.createJsxSelfClosingElement(tagName, typeArguments, attributes); 22366 } 22367 return finishNode(node, pos); 22368 } 22369 function parseJsxElementName() { 22370 const pos = getNodePos(); 22371 scanJsxIdentifier(); 22372 let expression = token() === 109 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); 22373 while (parseOptional(24 /* DotToken */)) { 22374 expression = finishNode(factory2.createPropertyAccessExpression(expression, parseRightSideOfDot(true, false)), pos); 22375 } 22376 return expression; 22377 } 22378 function parseJsxExpression(inExpressionContext) { 22379 const pos = getNodePos(); 22380 if (!parseExpected(18 /* OpenBraceToken */)) { 22381 return void 0; 22382 } 22383 let dotDotDotToken; 22384 let expression; 22385 if (token() !== 19 /* CloseBraceToken */) { 22386 dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); 22387 expression = parseExpression(); 22388 } 22389 if (inExpressionContext) { 22390 parseExpected(19 /* CloseBraceToken */); 22391 } else { 22392 if (parseExpected(19 /* CloseBraceToken */, void 0, false)) { 22393 scanJsxText(); 22394 } 22395 } 22396 return finishNode(factory2.createJsxExpression(dotDotDotToken, expression), pos); 22397 } 22398 function parseJsxAttribute() { 22399 if (token() === 18 /* OpenBraceToken */) { 22400 return parseJsxSpreadAttribute(); 22401 } 22402 scanJsxIdentifier(); 22403 const pos = getNodePos(); 22404 return finishNode(factory2.createJsxAttribute(parseIdentifierName(), parseJsxAttributeValue()), pos); 22405 } 22406 function parseJsxAttributeValue() { 22407 if (token() === 63 /* EqualsToken */) { 22408 if (scanJsxAttributeValue() === 10 /* StringLiteral */) { 22409 return parseLiteralNode(); 22410 } 22411 if (token() === 18 /* OpenBraceToken */) { 22412 return parseJsxExpression(true); 22413 } 22414 if (token() === 29 /* LessThanToken */) { 22415 return parseJsxElementOrSelfClosingElementOrFragment(true); 22416 } 22417 parseErrorAtCurrentToken(Diagnostics.or_JSX_element_expected); 22418 } 22419 return void 0; 22420 } 22421 function parseJsxSpreadAttribute() { 22422 const pos = getNodePos(); 22423 parseExpected(18 /* OpenBraceToken */); 22424 parseExpected(25 /* DotDotDotToken */); 22425 const expression = parseExpression(); 22426 parseExpected(19 /* CloseBraceToken */); 22427 return finishNode(factory2.createJsxSpreadAttribute(expression), pos); 22428 } 22429 function parseJsxClosingElement(open, inExpressionContext) { 22430 const pos = getNodePos(); 22431 parseExpected(30 /* LessThanSlashToken */); 22432 const tagName = parseJsxElementName(); 22433 if (parseExpected(31 /* GreaterThanToken */, void 0, false)) { 22434 if (inExpressionContext || !tagNamesAreEquivalent(open.tagName, tagName)) { 22435 nextToken(); 22436 } else { 22437 scanJsxText(); 22438 } 22439 } 22440 return finishNode(factory2.createJsxClosingElement(tagName), pos); 22441 } 22442 function parseJsxClosingFragment(inExpressionContext) { 22443 const pos = getNodePos(); 22444 parseExpected(30 /* LessThanSlashToken */); 22445 if (tokenIsIdentifierOrKeyword(token())) { 22446 parseErrorAtRange(parseJsxElementName(), Diagnostics.Expected_corresponding_closing_tag_for_JSX_fragment); 22447 } 22448 if (parseExpected(31 /* GreaterThanToken */, void 0, false)) { 22449 if (inExpressionContext) { 22450 nextToken(); 22451 } else { 22452 scanJsxText(); 22453 } 22454 } 22455 return finishNode(factory2.createJsxJsxClosingFragment(), pos); 22456 } 22457 function parseTypeAssertion() { 22458 const pos = getNodePos(); 22459 parseExpected(29 /* LessThanToken */); 22460 const type = parseType(); 22461 parseExpected(31 /* GreaterThanToken */); 22462 const expression = parseSimpleUnaryExpression(); 22463 return finishNode(factory2.createTypeAssertion(type, expression), pos); 22464 } 22465 function nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate() { 22466 nextToken(); 22467 return tokenIsIdentifierOrKeyword(token()) || token() === 22 /* OpenBracketToken */ || isTemplateStartOfTaggedTemplate(); 22468 } 22469 function isStartOfOptionalPropertyOrElementAccessChain() { 22470 return token() === 28 /* QuestionDotToken */ && lookAhead(nextTokenIsIdentifierOrKeywordOrOpenBracketOrTemplate); 22471 } 22472 function tryReparseOptionalChain(node) { 22473 if (node.flags & 32 /* OptionalChain */) { 22474 return true; 22475 } 22476 if (isNonNullExpression(node)) { 22477 let expr = node.expression; 22478 while (isNonNullExpression(expr) && !(expr.flags & 32 /* OptionalChain */)) { 22479 expr = expr.expression; 22480 } 22481 if (expr.flags & 32 /* OptionalChain */) { 22482 while (isNonNullExpression(node)) { 22483 node.flags |= 32 /* OptionalChain */; 22484 node = node.expression; 22485 } 22486 return true; 22487 } 22488 } 22489 return false; 22490 } 22491 function parsePropertyAccessExpressionRest(pos, expression, questionDotToken) { 22492 const name = parseRightSideOfDot(true, true); 22493 const isOptionalChain2 = questionDotToken || tryReparseOptionalChain(expression); 22494 const propertyAccess = isOptionalChain2 ? factory2.createPropertyAccessChain(expression, questionDotToken, name) : factory2.createPropertyAccessExpression(expression, name); 22495 if (isOptionalChain2 && isPrivateIdentifier(propertyAccess.name)) { 22496 parseErrorAtRange(propertyAccess.name, Diagnostics.An_optional_chain_cannot_contain_private_identifiers); 22497 } 22498 if (isExpressionWithTypeArguments(expression) && expression.typeArguments) { 22499 const pos2 = expression.typeArguments.pos - 1; 22500 const end = skipTrivia(sourceText, expression.typeArguments.end) + 1; 22501 parseErrorAt(pos2, end, Diagnostics.An_instantiation_expression_cannot_be_followed_by_a_property_access); 22502 } 22503 return finishNode(propertyAccess, pos); 22504 } 22505 function parseElementAccessExpressionRest(pos, expression, questionDotToken) { 22506 let argumentExpression; 22507 if (token() === 23 /* CloseBracketToken */) { 22508 argumentExpression = createMissingNode(79 /* Identifier */, true, Diagnostics.An_element_access_expression_should_take_an_argument); 22509 } else { 22510 const argument = allowInAnd(parseExpression); 22511 if (isStringOrNumericLiteralLike(argument)) { 22512 argument.text = internIdentifier(argument.text); 22513 } 22514 argumentExpression = argument; 22515 } 22516 parseExpected(23 /* CloseBracketToken */); 22517 const indexedAccess = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createElementAccessChain(expression, questionDotToken, argumentExpression) : factory2.createElementAccessExpression(expression, argumentExpression); 22518 return finishNode(indexedAccess, pos); 22519 } 22520 function parseMemberExpressionRest(pos, expression, allowOptionalChain) { 22521 while (true) { 22522 let questionDotToken; 22523 let isPropertyAccess = false; 22524 if (allowOptionalChain && isStartOfOptionalPropertyOrElementAccessChain()) { 22525 questionDotToken = parseExpectedToken(28 /* QuestionDotToken */); 22526 isPropertyAccess = tokenIsIdentifierOrKeyword(token()); 22527 } else { 22528 isPropertyAccess = parseOptional(24 /* DotToken */); 22529 } 22530 if (isPropertyAccess) { 22531 expression = parsePropertyAccessExpressionRest(pos, expression, questionDotToken); 22532 continue; 22533 } 22534 if ((questionDotToken || !inDecoratorContext()) && parseOptional(22 /* OpenBracketToken */)) { 22535 expression = parseElementAccessExpressionRest(pos, expression, questionDotToken); 22536 continue; 22537 } 22538 if (isTemplateStartOfTaggedTemplate()) { 22539 expression = !questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */ ? parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) : parseTaggedTemplateRest(pos, expression, questionDotToken, void 0); 22540 continue; 22541 } 22542 if (!questionDotToken) { 22543 if (token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { 22544 nextToken(); 22545 expression = finishNode(factory2.createNonNullExpression(expression), pos); 22546 continue; 22547 } 22548 const typeArguments = tryParse(parseTypeArgumentsInExpression); 22549 if (typeArguments) { 22550 expression = finishNode(factory2.createExpressionWithTypeArguments(expression, typeArguments), pos); 22551 continue; 22552 } 22553 } 22554 return expression; 22555 } 22556 } 22557 function isTemplateStartOfTaggedTemplate() { 22558 return token() === 14 /* NoSubstitutionTemplateLiteral */ || token() === 15 /* TemplateHead */; 22559 } 22560 function parseTaggedTemplateRest(pos, tag, questionDotToken, typeArguments) { 22561 const tagExpression = factory2.createTaggedTemplateExpression( 22562 tag, 22563 typeArguments, 22564 token() === 14 /* NoSubstitutionTemplateLiteral */ ? (reScanTemplateHeadOrNoSubstitutionTemplate(), parseLiteralNode()) : parseTemplateExpression(true) 22565 ); 22566 if (questionDotToken || tag.flags & 32 /* OptionalChain */) { 22567 tagExpression.flags |= 32 /* OptionalChain */; 22568 } 22569 tagExpression.questionDotToken = questionDotToken; 22570 return finishNode(tagExpression, pos); 22571 } 22572 function parseCallExpressionRest(pos, expression) { 22573 var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n; 22574 let currentNodeName; 22575 while (true) { 22576 expression = parseMemberExpressionRest(pos, expression, true); 22577 let typeArguments; 22578 const questionDotToken = parseOptionalToken(28 /* QuestionDotToken */); 22579 if (questionDotToken) { 22580 typeArguments = tryParse(parseTypeArgumentsInExpression); 22581 if (isTemplateStartOfTaggedTemplate()) { 22582 expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments); 22583 continue; 22584 } 22585 } 22586 if (typeArguments || token() === 20 /* OpenParenToken */) { 22587 if (!questionDotToken && expression.kind === 234 /* ExpressionWithTypeArguments */) { 22588 typeArguments = expression.typeArguments; 22589 expression = expression.expression; 22590 } 22591 if (isValidVirtualTypeArgumentsContext() && isPropertyAccessExpression(expression)) { 22592 const [rootNode, type] = getRootComponent(expression, sourceFileCompilerOptions); 22593 if (rootNode && type) { 22594 let rootNodeName = ""; 22595 if (type === "otherType") { 22596 rootNodeName = "Common"; 22597 } else { 22598 rootNodeName = rootNode.expression.escapedText.toString(); 22599 } 22600 currentNodeName = getTextOfPropertyName(expression.name).toString(); 22601 if (currentNodeName === ((_b = (_a2 = sourceFileCompilerOptions == null ? void 0 : sourceFileCompilerOptions.ets) == null ? void 0 : _a2.styles) == null ? void 0 : _b.property)) { 22602 setEtsStateStylesContext(true); 22603 stateStylesRootNode = rootNodeName; 22604 } else { 22605 setEtsStateStylesContext(false); 22606 stateStylesRootNode = void 0; 22607 } 22608 const syntaxComponents = (_e = (_d = (_c = sourceFileCompilerOptions == null ? void 0 : sourceFileCompilerOptions.ets) == null ? void 0 : _c.syntaxComponents) == null ? void 0 : _d.attrUICallback) == null ? void 0 : _e.filter( 22609 (item) => item.name === rootNodeName 22610 ); 22611 if (type === "callExpressionComponentType" && syntaxComponents && syntaxComponents.length && ((_g = (_f = syntaxComponents[0]) == null ? void 0 : _f.attributes) == null ? void 0 : _g.includes(currentNodeName))) { 22612 setSyntaxComponentContext(true); 22613 setFirstArgumentExpression(true); 22614 if (currentNodeName === "each") { 22615 setRepeatEachRest(true); 22616 } 22617 } else if (type === "etsComponentType") { 22618 typeArguments = parseEtsTypeArguments(pos, `${rootNodeName}Attribute`); 22619 } 22620 } else if (inEtsStateStylesContext() && stateStylesRootNode) { 22621 typeArguments = parseEtsTypeArguments(pos, `${stateStylesRootNode}Attribute`); 22622 } else if (inEtsStylesComponentsContext() || inEtsExtendComponentsContext()) { 22623 const virtualNode = getVirtualEtsComponent(expression); 22624 if (virtualNode) { 22625 let rootNodeName = virtualNode.expression.escapedText.toString(); 22626 currentNodeName = getTextOfPropertyName(expression.name).toString(); 22627 if (currentNodeName === ((_i = (_h = sourceFileCompilerOptions == null ? void 0 : sourceFileCompilerOptions.ets) == null ? void 0 : _h.styles) == null ? void 0 : _i.property)) { 22628 setEtsStateStylesContext(true); 22629 rootNodeName = rootNodeName.replace("Instance", ""); 22630 stateStylesRootNode = rootNodeName; 22631 typeArguments = parseEtsTypeArguments(pos, `${rootNodeName}Attribute`); 22632 } 22633 } 22634 } 22635 } 22636 if (isValidVirtualTypeArgumentsContext() && isIdentifier(expression) && ((_l = (_k = (_j = sourceFileCompilerOptions == null ? void 0 : sourceFileCompilerOptions.ets) == null ? void 0 : _j.syntaxComponents) == null ? void 0 : _k.paramsUICallback) == null ? void 0 : _l.includes(expression.escapedText.toString()))) { 22637 setSyntaxComponentContext(true); 22638 setFirstArgumentExpression(true); 22639 } 22640 const argumentList = parseArgumentList(); 22641 const callExpr = questionDotToken || tryReparseOptionalChain(expression) ? factory2.createCallChain(expression, questionDotToken, typeArguments, argumentList) : factory2.createCallExpression(expression, typeArguments, argumentList); 22642 expression = finishNode(callExpr, pos); 22643 continue; 22644 } 22645 if (questionDotToken) { 22646 const name = createMissingNode(79 /* Identifier */, false, Diagnostics.Identifier_expected); 22647 expression = finishNode(factory2.createPropertyAccessChain(expression, questionDotToken, name), pos); 22648 } 22649 break; 22650 } 22651 if (currentNodeName === ((_n = (_m = sourceFileCompilerOptions == null ? void 0 : sourceFileCompilerOptions.ets) == null ? void 0 : _m.styles) == null ? void 0 : _n.property)) { 22652 setEtsStateStylesContext(false); 22653 stateStylesRootNode = void 0; 22654 } 22655 return expression; 22656 } 22657 function isValidVirtualTypeArgumentsContext() { 22658 return inBuildContext() || inBuilderContext() || inEtsStylesComponentsContext() || inEtsExtendComponentsContext(); 22659 } 22660 function parseArgumentList() { 22661 parseExpected(20 /* OpenParenToken */); 22662 const result = parseDelimitedList(ParsingContext.ArgumentExpressions, parseArgumentExpression); 22663 parseExpected(21 /* CloseParenToken */); 22664 return result; 22665 } 22666 function parseTypeArgumentsInExpression() { 22667 if ((contextFlags & 262144 /* JavaScriptFile */) !== 0) { 22668 return void 0; 22669 } 22670 if (reScanLessThanToken() !== 29 /* LessThanToken */) { 22671 return void 0; 22672 } 22673 nextToken(); 22674 const typeArguments = parseDelimitedList(ParsingContext.TypeArguments, parseType); 22675 if (reScanGreaterToken() !== 31 /* GreaterThanToken */) { 22676 return void 0; 22677 } 22678 nextToken(); 22679 return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : void 0; 22680 } 22681 function canFollowTypeArgumentsInExpression() { 22682 switch (token()) { 22683 case 20 /* OpenParenToken */: 22684 case 14 /* NoSubstitutionTemplateLiteral */: 22685 case 15 /* TemplateHead */: 22686 return true; 22687 case 29 /* LessThanToken */: 22688 case 31 /* GreaterThanToken */: 22689 case 39 /* PlusToken */: 22690 case 40 /* MinusToken */: 22691 return false; 22692 } 22693 return scanner.hasPrecedingLineBreak() || isBinaryOperator2() || !isStartOfExpression(); 22694 } 22695 function isCurrentTokenAnEtsComponentExpression() { 22696 var _a2, _b; 22697 if (!inEtsComponentsContext() || inNoEtsComponentContext()) { 22698 return false; 22699 } 22700 const components = (_b = (_a2 = sourceFileCompilerOptions.ets) == null ? void 0 : _a2.components) != null ? _b : []; 22701 return components.includes(scanner.getTokenText()); 22702 } 22703 function parseEtsComponentExpression() { 22704 const pos = getNodePos(); 22705 const name = parseBindingIdentifier(); 22706 const argumentList = parseArgumentList(); 22707 const body = token() === 18 /* OpenBraceToken */ ? parseFunctionBlock(0 /* None */) : void 0; 22708 const node = factory2.createEtsComponentExpression(name, argumentList, body); 22709 return finishNode(node, pos); 22710 } 22711 function parsePrimaryExpression() { 22712 switch (token()) { 22713 case 8 /* NumericLiteral */: 22714 case 9 /* BigIntLiteral */: 22715 case 10 /* StringLiteral */: 22716 case 14 /* NoSubstitutionTemplateLiteral */: 22717 return parseLiteralNode(); 22718 case 109 /* ThisKeyword */: 22719 case 107 /* SuperKeyword */: 22720 case 105 /* NullKeyword */: 22721 case 111 /* TrueKeyword */: 22722 case 96 /* FalseKeyword */: 22723 return parseTokenNode(); 22724 case 20 /* OpenParenToken */: 22725 return parseParenthesizedExpression(); 22726 case 22 /* OpenBracketToken */: 22727 return parseArrayLiteralExpression(); 22728 case 18 /* OpenBraceToken */: 22729 return parseObjectLiteralExpression(); 22730 case 133 /* AsyncKeyword */: 22731 if (!lookAhead(nextTokenIsFunctionKeywordOnSameLine)) { 22732 break; 22733 } 22734 return parseFunctionExpression(); 22735 case 84 /* ClassKeyword */: 22736 return parseClassExpression(); 22737 case 99 /* FunctionKeyword */: 22738 return parseFunctionExpression(); 22739 case 104 /* NewKeyword */: 22740 return parseNewExpressionOrNewDotTarget(); 22741 case 43 /* SlashToken */: 22742 case 68 /* SlashEqualsToken */: 22743 if (reScanSlashToken() === 13 /* RegularExpressionLiteral */) { 22744 return parseLiteralNode(); 22745 } 22746 break; 22747 case 15 /* TemplateHead */: 22748 return parseTemplateExpression(false); 22749 case 80 /* PrivateIdentifier */: 22750 return parsePrivateIdentifier(); 22751 } 22752 if (isCurrentTokenAnEtsComponentExpression() && !inEtsNewExpressionContext()) { 22753 return parseEtsComponentExpression(); 22754 } 22755 return parseIdentifier(Diagnostics.Expression_expected); 22756 } 22757 function parseParenthesizedExpression() { 22758 const pos = getNodePos(); 22759 const hasJSDoc = hasPrecedingJSDocComment(); 22760 parseExpected(20 /* OpenParenToken */); 22761 const expression = allowInAnd(parseExpression); 22762 parseExpected(21 /* CloseParenToken */); 22763 return withJSDoc(finishNode(factory2.createParenthesizedExpression(expression), pos), hasJSDoc); 22764 } 22765 function parseSpreadElement() { 22766 const pos = getNodePos(); 22767 parseExpected(25 /* DotDotDotToken */); 22768 const expression = parseAssignmentExpressionOrHigher(true); 22769 return finishNode(factory2.createSpreadElement(expression), pos); 22770 } 22771 function parseArgumentOrArrayLiteralElement() { 22772 return token() === 25 /* DotDotDotToken */ ? parseSpreadElement() : token() === 27 /* CommaToken */ ? finishNode(factory2.createOmittedExpression(), getNodePos()) : parseAssignmentExpressionOrHigher(true); 22773 } 22774 function parseArgumentExpression() { 22775 let resetSyntaxDataSourceContextFlag = false; 22776 let resetRepeatEachContextFlag = false; 22777 if (inSyntaxComponentContext() && !inSyntaxDataSourceContext() && getFirstArgumentExpression()) { 22778 setFirstArgumentExpression(false); 22779 if (!getRepeatEachRest()) { 22780 setSyntaxDataSourceContext(true); 22781 resetSyntaxDataSourceContextFlag = true; 22782 } else { 22783 resetRepeatEachContextFlag = true; 22784 } 22785 } 22786 const argumentExpressionResult = doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); 22787 if (resetSyntaxDataSourceContextFlag) { 22788 setSyntaxDataSourceContext(false); 22789 } 22790 if (resetRepeatEachContextFlag) { 22791 setRepeatEachRest(false); 22792 } 22793 return argumentExpressionResult; 22794 } 22795 function parseArrayLiteralExpression() { 22796 const pos = getNodePos(); 22797 const openBracketPosition = scanner.getTokenPos(); 22798 const openBracketParsed = parseExpected(22 /* OpenBracketToken */); 22799 const multiLine = scanner.hasPrecedingLineBreak(); 22800 const elements = parseDelimitedList(ParsingContext.ArrayLiteralMembers, parseArgumentOrArrayLiteralElement); 22801 parseExpectedMatchingBrackets(22 /* OpenBracketToken */, 23 /* CloseBracketToken */, openBracketParsed, openBracketPosition); 22802 return finishNode(factory2.createArrayLiteralExpression(elements, multiLine), pos); 22803 } 22804 function parseObjectLiteralElement() { 22805 const pos = getNodePos(); 22806 const hasJSDoc = hasPrecedingJSDocComment(); 22807 if (parseOptionalToken(25 /* DotDotDotToken */)) { 22808 const expression = parseAssignmentExpressionOrHigher(true); 22809 return withJSDoc(finishNode(factory2.createSpreadAssignment(expression), pos), hasJSDoc); 22810 } 22811 const decorators = parseDecorators(); 22812 const modifiers = parseModifiers(); 22813 if (parseContextualModifier(138 /* GetKeyword */)) { 22814 return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 177 /* GetAccessor */, 0 /* None */); 22815 } 22816 if (parseContextualModifier(152 /* SetKeyword */)) { 22817 return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 178 /* SetAccessor */, 0 /* None */); 22818 } 22819 const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); 22820 const tokenIsIdentifier = isIdentifier2(); 22821 const name = parsePropertyName(); 22822 const questionToken = parseOptionalToken(57 /* QuestionToken */); 22823 const exclamationToken = parseOptionalToken(53 /* ExclamationToken */); 22824 if (asteriskToken || token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { 22825 return parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name, questionToken, exclamationToken); 22826 } 22827 let node; 22828 const isShorthandPropertyAssignment2 = tokenIsIdentifier && token() !== 58 /* ColonToken */; 22829 if (isShorthandPropertyAssignment2) { 22830 const equalsToken = parseOptionalToken(63 /* EqualsToken */); 22831 const objectAssignmentInitializer = equalsToken ? allowInAnd(() => parseAssignmentExpressionOrHigher(true)) : void 0; 22832 node = factory2.createShorthandPropertyAssignment(name, objectAssignmentInitializer); 22833 node.equalsToken = equalsToken; 22834 } else { 22835 parseExpected(58 /* ColonToken */); 22836 const initializer = allowInAnd(() => parseAssignmentExpressionOrHigher(true)); 22837 node = factory2.createPropertyAssignment(name, initializer); 22838 } 22839 node.illegalDecorators = decorators; 22840 node.modifiers = modifiers; 22841 node.questionToken = questionToken; 22842 node.exclamationToken = exclamationToken; 22843 return withJSDoc(finishNode(node, pos), hasJSDoc); 22844 } 22845 function parseObjectLiteralExpression() { 22846 const pos = getNodePos(); 22847 const openBracePosition = scanner.getTokenPos(); 22848 const openBraceParsed = parseExpected(18 /* OpenBraceToken */); 22849 const multiLine = scanner.hasPrecedingLineBreak(); 22850 const properties = parseDelimitedList(ParsingContext.ObjectLiteralMembers, parseObjectLiteralElement, true); 22851 parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition); 22852 return finishNode(factory2.createObjectLiteralExpression(properties, multiLine), pos); 22853 } 22854 function parseFunctionExpression() { 22855 const savedDecoratorContext = inDecoratorContext(); 22856 setDecoratorContext(false); 22857 const pos = getNodePos(); 22858 const hasJSDoc = hasPrecedingJSDocComment(); 22859 const modifiers = parseModifiers(); 22860 parseExpected(99 /* FunctionKeyword */); 22861 const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); 22862 const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; 22863 const isAsync = some(modifiers, isAsyncModifier) ? 2 /* Await */ : 0 /* None */; 22864 const name = isGenerator && isAsync ? doInYieldAndAwaitContext(parseOptionalBindingIdentifier) : isGenerator ? doInYieldContext(parseOptionalBindingIdentifier) : isAsync ? doInAwaitContext(parseOptionalBindingIdentifier) : parseOptionalBindingIdentifier(); 22865 const typeParameters = parseTypeParameters(); 22866 const parameters = parseParameters(isGenerator | isAsync); 22867 const type = parseReturnType(58 /* ColonToken */, false); 22868 const body = parseFunctionBlock(isGenerator | isAsync); 22869 setDecoratorContext(savedDecoratorContext); 22870 const node = factory2.createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body); 22871 return withJSDoc(finishNode(node, pos), hasJSDoc); 22872 } 22873 function parseOptionalBindingIdentifier() { 22874 return isBindingIdentifier() ? parseBindingIdentifier() : void 0; 22875 } 22876 function parseNewExpressionOrNewDotTarget() { 22877 setEtsNewExpressionContext(inEtsComponentsContext()); 22878 const pos = getNodePos(); 22879 parseExpected(104 /* NewKeyword */); 22880 if (parseOptional(24 /* DotToken */)) { 22881 const name = parseIdentifierName(); 22882 return finishNode(factory2.createMetaProperty(104 /* NewKeyword */, name), pos); 22883 } 22884 const expressionPos = getNodePos(); 22885 let expression = parseMemberExpressionRest(expressionPos, parsePrimaryExpression(), false); 22886 let typeArguments; 22887 if (expression.kind === 234 /* ExpressionWithTypeArguments */) { 22888 typeArguments = expression.typeArguments; 22889 expression = expression.expression; 22890 } 22891 if (token() === 28 /* QuestionDotToken */) { 22892 parseErrorAtCurrentToken(Diagnostics.Invalid_optional_chain_from_new_expression_Did_you_mean_to_call_0, getTextOfNodeFromSourceText(sourceText, expression)); 22893 } 22894 const argumentList = token() === 20 /* OpenParenToken */ ? parseArgumentList() : void 0; 22895 setEtsNewExpressionContext(false); 22896 return finishNode(factory2.createNewExpression(expression, typeArguments, argumentList), pos); 22897 } 22898 function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { 22899 const pos = getNodePos(); 22900 const hasJSDoc = hasPrecedingJSDocComment(); 22901 const openBracePosition = scanner.getTokenPos(); 22902 const openBraceParsed = parseExpected(18 /* OpenBraceToken */, diagnosticMessage); 22903 if (openBraceParsed || ignoreMissingOpenBrace) { 22904 const multiLine = scanner.hasPrecedingLineBreak(); 22905 const statements = parseList(ParsingContext.BlockStatements, parseStatement); 22906 parseExpectedMatchingBrackets(18 /* OpenBraceToken */, 19 /* CloseBraceToken */, openBraceParsed, openBracePosition); 22907 const result = withJSDoc(finishNode(factory2.createBlock(statements, multiLine), pos), hasJSDoc); 22908 if (token() === 63 /* EqualsToken */) { 22909 parseErrorAtCurrentToken(Diagnostics.Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses); 22910 nextToken(); 22911 } 22912 return result; 22913 } else { 22914 const statements = createMissingList(); 22915 return withJSDoc(finishNode(factory2.createBlock(statements, void 0), pos), hasJSDoc); 22916 } 22917 } 22918 function parseFunctionBlock(flags, diagnosticMessage) { 22919 const savedYieldContext = inYieldContext(); 22920 setYieldContext(!!(flags & 1 /* Yield */)); 22921 const savedAwaitContext = inAwaitContext(); 22922 setAwaitContext(!!(flags & 2 /* Await */)); 22923 const savedTopLevel = topLevel; 22924 topLevel = false; 22925 const saveDecoratorContext = inDecoratorContext(); 22926 if (saveDecoratorContext) { 22927 setDecoratorContext(false); 22928 } 22929 const block = parseBlock(!!(flags & 16 /* IgnoreMissingOpenBrace */), diagnosticMessage); 22930 if (saveDecoratorContext) { 22931 setDecoratorContext(true); 22932 } 22933 topLevel = savedTopLevel; 22934 setYieldContext(savedYieldContext); 22935 setAwaitContext(savedAwaitContext); 22936 return block; 22937 } 22938 function parseEmptyStatement() { 22939 const pos = getNodePos(); 22940 const hasJSDoc = hasPrecedingJSDocComment(); 22941 parseExpected(26 /* SemicolonToken */); 22942 return withJSDoc(finishNode(factory2.createEmptyStatement(), pos), hasJSDoc); 22943 } 22944 function parseIfStatement() { 22945 const pos = getNodePos(); 22946 const hasJSDoc = hasPrecedingJSDocComment(); 22947 parseExpected(100 /* IfKeyword */); 22948 const openParenPosition = scanner.getTokenPos(); 22949 const openParenParsed = parseExpected(20 /* OpenParenToken */); 22950 const expression = allowInAnd(parseExpression); 22951 parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition); 22952 const thenStatement = parseStatement(); 22953 const elseStatement = parseOptional(92 /* ElseKeyword */) ? parseStatement() : void 0; 22954 return withJSDoc(finishNode(factory2.createIfStatement(expression, thenStatement, elseStatement), pos), hasJSDoc); 22955 } 22956 function parseDoStatement() { 22957 const pos = getNodePos(); 22958 const hasJSDoc = hasPrecedingJSDocComment(); 22959 parseExpected(91 /* DoKeyword */); 22960 const statement = parseStatement(); 22961 parseExpected(116 /* WhileKeyword */); 22962 const openParenPosition = scanner.getTokenPos(); 22963 const openParenParsed = parseExpected(20 /* OpenParenToken */); 22964 const expression = allowInAnd(parseExpression); 22965 parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition); 22966 parseOptional(26 /* SemicolonToken */); 22967 return withJSDoc(finishNode(factory2.createDoStatement(statement, expression), pos), hasJSDoc); 22968 } 22969 function parseWhileStatement() { 22970 const pos = getNodePos(); 22971 const hasJSDoc = hasPrecedingJSDocComment(); 22972 parseExpected(116 /* WhileKeyword */); 22973 const openParenPosition = scanner.getTokenPos(); 22974 const openParenParsed = parseExpected(20 /* OpenParenToken */); 22975 const expression = allowInAnd(parseExpression); 22976 parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition); 22977 const statement = parseStatement(); 22978 return withJSDoc(finishNode(factory2.createWhileStatement(expression, statement), pos), hasJSDoc); 22979 } 22980 function parseForOrForInOrForOfStatement() { 22981 const pos = getNodePos(); 22982 const hasJSDoc = hasPrecedingJSDocComment(); 22983 parseExpected(98 /* ForKeyword */); 22984 const awaitToken = parseOptionalToken(134 /* AwaitKeyword */); 22985 parseExpected(20 /* OpenParenToken */); 22986 let initializer; 22987 if (token() !== 26 /* SemicolonToken */) { 22988 if (token() === 114 /* VarKeyword */ || token() === 120 /* LetKeyword */ || token() === 86 /* ConstKeyword */) { 22989 initializer = parseVariableDeclarationList(true); 22990 } else { 22991 initializer = disallowInAnd(parseExpression); 22992 } 22993 } 22994 let node; 22995 if (awaitToken ? parseExpected(164 /* OfKeyword */) : parseOptional(164 /* OfKeyword */)) { 22996 const expression = allowInAnd(() => parseAssignmentExpressionOrHigher(true)); 22997 parseExpected(21 /* CloseParenToken */); 22998 node = factory2.createForOfStatement(awaitToken, initializer, expression, parseStatement()); 22999 } else if (parseOptional(102 /* InKeyword */)) { 23000 const expression = allowInAnd(parseExpression); 23001 parseExpected(21 /* CloseParenToken */); 23002 node = factory2.createForInStatement(initializer, expression, parseStatement()); 23003 } else { 23004 parseExpected(26 /* SemicolonToken */); 23005 const condition = token() !== 26 /* SemicolonToken */ && token() !== 21 /* CloseParenToken */ ? allowInAnd(parseExpression) : void 0; 23006 parseExpected(26 /* SemicolonToken */); 23007 const incrementor = token() !== 21 /* CloseParenToken */ ? allowInAnd(parseExpression) : void 0; 23008 parseExpected(21 /* CloseParenToken */); 23009 node = factory2.createForStatement(initializer, condition, incrementor, parseStatement()); 23010 } 23011 return withJSDoc(finishNode(node, pos), hasJSDoc); 23012 } 23013 function parseBreakOrContinueStatement(kind) { 23014 const pos = getNodePos(); 23015 const hasJSDoc = hasPrecedingJSDocComment(); 23016 parseExpected(kind === 253 /* BreakStatement */ ? 81 /* BreakKeyword */ : 87 /* ContinueKeyword */); 23017 const label = canParseSemicolon() ? void 0 : parseIdentifier(); 23018 parseSemicolon(); 23019 const node = kind === 253 /* BreakStatement */ ? factory2.createBreakStatement(label) : factory2.createContinueStatement(label); 23020 return withJSDoc(finishNode(node, pos), hasJSDoc); 23021 } 23022 function parseReturnStatement() { 23023 const pos = getNodePos(); 23024 const hasJSDoc = hasPrecedingJSDocComment(); 23025 parseExpected(106 /* ReturnKeyword */); 23026 const expression = canParseSemicolon() ? void 0 : allowInAnd(parseExpression); 23027 parseSemicolon(); 23028 return withJSDoc(finishNode(factory2.createReturnStatement(expression), pos), hasJSDoc); 23029 } 23030 function parseWithStatement() { 23031 const pos = getNodePos(); 23032 const hasJSDoc = hasPrecedingJSDocComment(); 23033 parseExpected(117 /* WithKeyword */); 23034 const openParenPosition = scanner.getTokenPos(); 23035 const openParenParsed = parseExpected(20 /* OpenParenToken */); 23036 const expression = allowInAnd(parseExpression); 23037 parseExpectedMatchingBrackets(20 /* OpenParenToken */, 21 /* CloseParenToken */, openParenParsed, openParenPosition); 23038 const statement = doInsideOfContext(33554432 /* InWithStatement */, parseStatement); 23039 return withJSDoc(finishNode(factory2.createWithStatement(expression, statement), pos), hasJSDoc); 23040 } 23041 function parseCaseClause() { 23042 const pos = getNodePos(); 23043 const hasJSDoc = hasPrecedingJSDocComment(); 23044 parseExpected(82 /* CaseKeyword */); 23045 const expression = allowInAnd(parseExpression); 23046 parseExpected(58 /* ColonToken */); 23047 const statements = parseList(ParsingContext.SwitchClauseStatements, parseStatement); 23048 return withJSDoc(finishNode(factory2.createCaseClause(expression, statements), pos), hasJSDoc); 23049 } 23050 function parseDefaultClause() { 23051 const pos = getNodePos(); 23052 parseExpected(89 /* DefaultKeyword */); 23053 parseExpected(58 /* ColonToken */); 23054 const statements = parseList(ParsingContext.SwitchClauseStatements, parseStatement); 23055 return finishNode(factory2.createDefaultClause(statements), pos); 23056 } 23057 function parseCaseOrDefaultClause() { 23058 return token() === 82 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); 23059 } 23060 function parseCaseBlock() { 23061 const pos = getNodePos(); 23062 parseExpected(18 /* OpenBraceToken */); 23063 const clauses = parseList(ParsingContext.SwitchClauses, parseCaseOrDefaultClause); 23064 parseExpected(19 /* CloseBraceToken */); 23065 return finishNode(factory2.createCaseBlock(clauses), pos); 23066 } 23067 function parseSwitchStatement() { 23068 const pos = getNodePos(); 23069 const hasJSDoc = hasPrecedingJSDocComment(); 23070 parseExpected(108 /* SwitchKeyword */); 23071 parseExpected(20 /* OpenParenToken */); 23072 const expression = allowInAnd(parseExpression); 23073 parseExpected(21 /* CloseParenToken */); 23074 const caseBlock = parseCaseBlock(); 23075 return withJSDoc(finishNode(factory2.createSwitchStatement(expression, caseBlock), pos), hasJSDoc); 23076 } 23077 function parseThrowStatement() { 23078 const pos = getNodePos(); 23079 const hasJSDoc = hasPrecedingJSDocComment(); 23080 parseExpected(110 /* ThrowKeyword */); 23081 let expression = scanner.hasPrecedingLineBreak() ? void 0 : allowInAnd(parseExpression); 23082 if (expression === void 0) { 23083 identifierCount++; 23084 expression = finishNode(factory2.createIdentifier(""), getNodePos()); 23085 } 23086 if (!tryParseSemicolon()) { 23087 parseErrorForMissingSemicolonAfter(expression); 23088 } 23089 return withJSDoc(finishNode(factory2.createThrowStatement(expression), pos), hasJSDoc); 23090 } 23091 function parseTryStatement() { 23092 const pos = getNodePos(); 23093 const hasJSDoc = hasPrecedingJSDocComment(); 23094 parseExpected(112 /* TryKeyword */); 23095 const tryBlock = parseBlock(false); 23096 const catchClause = token() === 83 /* CatchKeyword */ ? parseCatchClause() : void 0; 23097 let finallyBlock; 23098 if (!catchClause || token() === 97 /* FinallyKeyword */) { 23099 parseExpected(97 /* FinallyKeyword */, Diagnostics.catch_or_finally_expected); 23100 finallyBlock = parseBlock(false); 23101 } 23102 return withJSDoc(finishNode(factory2.createTryStatement(tryBlock, catchClause, finallyBlock), pos), hasJSDoc); 23103 } 23104 function parseCatchClause() { 23105 const pos = getNodePos(); 23106 parseExpected(83 /* CatchKeyword */); 23107 let variableDeclaration; 23108 if (parseOptional(20 /* OpenParenToken */)) { 23109 variableDeclaration = parseVariableDeclaration(); 23110 parseExpected(21 /* CloseParenToken */); 23111 } else { 23112 variableDeclaration = void 0; 23113 } 23114 const block = parseBlock(false); 23115 return finishNode(factory2.createCatchClause(variableDeclaration, block), pos); 23116 } 23117 function parseDebuggerStatement() { 23118 const pos = getNodePos(); 23119 const hasJSDoc = hasPrecedingJSDocComment(); 23120 parseExpected(88 /* DebuggerKeyword */); 23121 parseSemicolon(); 23122 return withJSDoc(finishNode(factory2.createDebuggerStatement(), pos), hasJSDoc); 23123 } 23124 function parseExpressionOrLabeledStatement() { 23125 const pos = getNodePos(); 23126 let hasJSDoc = hasPrecedingJSDocComment(); 23127 let node; 23128 const hasParen = token() === 20 /* OpenParenToken */; 23129 const expression = allowInAnd(parseExpression); 23130 if (isIdentifier(expression) && parseOptional(58 /* ColonToken */)) { 23131 node = factory2.createLabeledStatement(expression, parseStatement()); 23132 } else { 23133 if (!tryParseSemicolon()) { 23134 parseErrorForMissingSemicolonAfter(expression); 23135 } 23136 node = factory2.createExpressionStatement(expression); 23137 if (hasParen) { 23138 hasJSDoc = false; 23139 } 23140 } 23141 return withJSDoc(finishNode(node, pos), hasJSDoc); 23142 } 23143 function nextTokenIsIdentifierOrKeywordOnSameLine() { 23144 nextToken(); 23145 return tokenIsIdentifierOrKeyword(token()) && !scanner.hasPrecedingLineBreak(); 23146 } 23147 function nextTokenIsClassKeywordOnSameLine() { 23148 nextToken(); 23149 return token() === 84 /* ClassKeyword */ && !scanner.hasPrecedingLineBreak(); 23150 } 23151 function nextTokenIsFunctionKeywordOnSameLine() { 23152 nextToken(); 23153 return token() === 99 /* FunctionKeyword */ && !scanner.hasPrecedingLineBreak(); 23154 } 23155 function nextTokenIsIdentifierOrKeywordOrLiteralOnSameLine() { 23156 nextToken(); 23157 return (tokenIsIdentifierOrKeyword(token()) || token() === 8 /* NumericLiteral */ || token() === 9 /* BigIntLiteral */ || token() === 10 /* StringLiteral */) && !scanner.hasPrecedingLineBreak(); 23158 } 23159 function isDeclaration2() { 23160 while (true) { 23161 switch (token()) { 23162 case 114 /* VarKeyword */: 23163 case 120 /* LetKeyword */: 23164 case 86 /* ConstKeyword */: 23165 case 99 /* FunctionKeyword */: 23166 case 84 /* ClassKeyword */: 23167 case 93 /* EnumKeyword */: 23168 return true; 23169 case 85 /* StructKeyword */: 23170 return inEtsContext(); 23171 case 59 /* AtToken */: 23172 return inAllowAnnotationContext() && nextToken() === 119 /* InterfaceKeyword */; 23173 case 119 /* InterfaceKeyword */: 23174 case 155 /* TypeKeyword */: 23175 return nextTokenIsIdentifierOnSameLine(); 23176 case 143 /* ModuleKeyword */: 23177 case 144 /* NamespaceKeyword */: 23178 return nextTokenIsIdentifierOrStringLiteralOnSameLine(); 23179 case 127 /* AbstractKeyword */: 23180 case 128 /* AccessorKeyword */: 23181 case 133 /* AsyncKeyword */: 23182 case 137 /* DeclareKeyword */: 23183 case 122 /* PrivateKeyword */: 23184 case 123 /* ProtectedKeyword */: 23185 case 124 /* PublicKeyword */: 23186 case 147 /* ReadonlyKeyword */: 23187 nextToken(); 23188 if (scanner.hasPrecedingLineBreak()) { 23189 return false; 23190 } 23191 continue; 23192 case 161 /* GlobalKeyword */: 23193 nextToken(); 23194 return token() === 18 /* OpenBraceToken */ || token() === 79 /* Identifier */ || token() === 94 /* ExportKeyword */; 23195 case 101 /* ImportKeyword */: 23196 nextToken(); 23197 return token() === 10 /* StringLiteral */ || token() === 41 /* AsteriskToken */ || token() === 18 /* OpenBraceToken */ || tokenIsIdentifierOrKeyword(token()); 23198 case 94 /* ExportKeyword */: 23199 let currentToken2 = nextToken(); 23200 if (currentToken2 === 155 /* TypeKeyword */) { 23201 currentToken2 = lookAhead(nextToken); 23202 } 23203 if (currentToken2 === 63 /* EqualsToken */ || currentToken2 === 41 /* AsteriskToken */ || currentToken2 === 18 /* OpenBraceToken */ || currentToken2 === 89 /* DefaultKeyword */ || currentToken2 === 129 /* AsKeyword */) { 23204 return true; 23205 } 23206 continue; 23207 case 125 /* StaticKeyword */: 23208 nextToken(); 23209 continue; 23210 default: 23211 return false; 23212 } 23213 } 23214 } 23215 function isStartOfDeclaration() { 23216 return lookAhead(isDeclaration2); 23217 } 23218 function isStartOfStatement() { 23219 switch (token()) { 23220 case 59 /* AtToken */: 23221 case 26 /* SemicolonToken */: 23222 case 18 /* OpenBraceToken */: 23223 case 114 /* VarKeyword */: 23224 case 120 /* LetKeyword */: 23225 case 99 /* FunctionKeyword */: 23226 case 84 /* ClassKeyword */: 23227 case 93 /* EnumKeyword */: 23228 case 100 /* IfKeyword */: 23229 case 91 /* DoKeyword */: 23230 case 116 /* WhileKeyword */: 23231 case 98 /* ForKeyword */: 23232 case 87 /* ContinueKeyword */: 23233 case 81 /* BreakKeyword */: 23234 case 106 /* ReturnKeyword */: 23235 case 117 /* WithKeyword */: 23236 case 108 /* SwitchKeyword */: 23237 case 110 /* ThrowKeyword */: 23238 case 112 /* TryKeyword */: 23239 case 88 /* DebuggerKeyword */: 23240 case 83 /* CatchKeyword */: 23241 case 97 /* FinallyKeyword */: 23242 return true; 23243 case 85 /* StructKeyword */: 23244 return inEtsContext(); 23245 case 101 /* ImportKeyword */: 23246 return isStartOfDeclaration() || lookAhead(nextTokenIsOpenParenOrLessThanOrDot); 23247 case 86 /* ConstKeyword */: 23248 case 94 /* ExportKeyword */: 23249 return isStartOfDeclaration(); 23250 case 133 /* AsyncKeyword */: 23251 case 137 /* DeclareKeyword */: 23252 case 119 /* InterfaceKeyword */: 23253 case 143 /* ModuleKeyword */: 23254 case 144 /* NamespaceKeyword */: 23255 case 155 /* TypeKeyword */: 23256 case 161 /* GlobalKeyword */: 23257 return true; 23258 case 128 /* AccessorKeyword */: 23259 case 124 /* PublicKeyword */: 23260 case 122 /* PrivateKeyword */: 23261 case 123 /* ProtectedKeyword */: 23262 case 125 /* StaticKeyword */: 23263 case 147 /* ReadonlyKeyword */: 23264 return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); 23265 default: 23266 return isStartOfExpression(); 23267 } 23268 } 23269 function nextTokenIsBindingIdentifierOrStartOfDestructuring() { 23270 nextToken(); 23271 return isBindingIdentifier() || token() === 18 /* OpenBraceToken */ || token() === 22 /* OpenBracketToken */; 23272 } 23273 function isLetDeclaration() { 23274 return lookAhead(nextTokenIsBindingIdentifierOrStartOfDestructuring); 23275 } 23276 function parseStatement() { 23277 switch (token()) { 23278 case 26 /* SemicolonToken */: 23279 return parseEmptyStatement(); 23280 case 18 /* OpenBraceToken */: 23281 return parseBlock(false); 23282 case 114 /* VarKeyword */: 23283 return parseVariableStatement(getNodePos(), hasPrecedingJSDocComment(), void 0, void 0); 23284 case 120 /* LetKeyword */: 23285 if (isLetDeclaration()) { 23286 return parseVariableStatement(getNodePos(), hasPrecedingJSDocComment(), void 0, void 0); 23287 } 23288 break; 23289 case 99 /* FunctionKeyword */: 23290 return parseFunctionDeclaration(getNodePos(), hasPrecedingJSDocComment(), void 0, void 0); 23291 case 85 /* StructKeyword */: 23292 if (inEtsContext()) { 23293 return parseStructDeclaration(getNodePos(), hasPrecedingJSDocComment(), void 0, void 0); 23294 } 23295 break; 23296 case 84 /* ClassKeyword */: 23297 return parseClassDeclaration(getNodePos(), hasPrecedingJSDocComment(), void 0, void 0); 23298 case 100 /* IfKeyword */: 23299 return parseIfStatement(); 23300 case 91 /* DoKeyword */: 23301 return parseDoStatement(); 23302 case 116 /* WhileKeyword */: 23303 return parseWhileStatement(); 23304 case 98 /* ForKeyword */: 23305 return parseForOrForInOrForOfStatement(); 23306 case 87 /* ContinueKeyword */: 23307 return parseBreakOrContinueStatement(252 /* ContinueStatement */); 23308 case 81 /* BreakKeyword */: 23309 return parseBreakOrContinueStatement(253 /* BreakStatement */); 23310 case 106 /* ReturnKeyword */: 23311 return parseReturnStatement(); 23312 case 117 /* WithKeyword */: 23313 return parseWithStatement(); 23314 case 108 /* SwitchKeyword */: 23315 return parseSwitchStatement(); 23316 case 110 /* ThrowKeyword */: 23317 return parseThrowStatement(); 23318 case 112 /* TryKeyword */: 23319 case 83 /* CatchKeyword */: 23320 case 97 /* FinallyKeyword */: 23321 return parseTryStatement(); 23322 case 88 /* DebuggerKeyword */: 23323 return parseDebuggerStatement(); 23324 case 59 /* AtToken */: 23325 return parseDeclaration(); 23326 case 133 /* AsyncKeyword */: 23327 case 119 /* InterfaceKeyword */: 23328 case 155 /* TypeKeyword */: 23329 case 143 /* ModuleKeyword */: 23330 case 144 /* NamespaceKeyword */: 23331 case 137 /* DeclareKeyword */: 23332 case 86 /* ConstKeyword */: 23333 case 93 /* EnumKeyword */: 23334 case 94 /* ExportKeyword */: 23335 case 101 /* ImportKeyword */: 23336 case 122 /* PrivateKeyword */: 23337 case 123 /* ProtectedKeyword */: 23338 case 124 /* PublicKeyword */: 23339 case 127 /* AbstractKeyword */: 23340 case 128 /* AccessorKeyword */: 23341 case 125 /* StaticKeyword */: 23342 case 147 /* ReadonlyKeyword */: 23343 case 161 /* GlobalKeyword */: 23344 if (isStartOfDeclaration()) { 23345 return parseDeclaration(); 23346 } 23347 break; 23348 } 23349 return parseExpressionOrLabeledStatement(); 23350 } 23351 function isDeclareModifier(modifier) { 23352 return modifier.kind === 137 /* DeclareKeyword */; 23353 } 23354 function parseAnnotationDeclaration(pos, hasJSDoc, decorators, modifiers) { 23355 const atTokenPos = scanner.getTokenPos(); 23356 parseExpected(59 /* AtToken */); 23357 const interfaceTokenPos = scanner.getTokenPos(); 23358 parseExpected(119 /* InterfaceKeyword */); 23359 if (interfaceTokenPos - atTokenPos > 1) { 23360 parseErrorAt(atTokenPos + 1, interfaceTokenPos, Diagnostics.In_annotation_declaration_any_symbols_between_and_interface_are_forbidden); 23361 } 23362 const name = createIdentifier(isBindingIdentifier()); 23363 let members; 23364 if (parseExpected(18 /* OpenBraceToken */)) { 23365 members = parseAnnotationMembers(); 23366 parseExpected(19 /* CloseBraceToken */); 23367 } else { 23368 members = createMissingList(); 23369 } 23370 const node = factory2.createAnnotationDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, members); 23371 return withJSDoc(finishNode(node, pos), hasJSDoc); 23372 } 23373 function parseDeclaration() { 23374 var _a2, _b; 23375 const pos = getNodePos(); 23376 const hasJSDoc = hasPrecedingJSDocComment(); 23377 const decorators = parseDecorators(); 23378 if (token() === 99 /* FunctionKeyword */ || token() === 94 /* ExportKeyword */) { 23379 if (hasEtsExtendDecoratorNames(decorators, sourceFileCompilerOptions)) { 23380 const extendEtsComponentDecoratorNames = getEtsExtendDecoratorsComponentNames(decorators, sourceFileCompilerOptions); 23381 if (extendEtsComponentDecoratorNames.length > 0) { 23382 (_a2 = sourceFileCompilerOptions.ets) == null ? void 0 : _a2.extend.components.forEach(({ name, type, instance }) => { 23383 if (name === last(extendEtsComponentDecoratorNames)) { 23384 extendEtsComponentDeclaration = { name, type, instance }; 23385 } 23386 }); 23387 } 23388 setEtsExtendComponentsContext(!!extendEtsComponentDeclaration); 23389 } else if (hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) { 23390 const stylesEtsComponentDecoratorNames = getEtsStylesDecoratorComponentNames(decorators, sourceFileCompilerOptions); 23391 if (stylesEtsComponentDecoratorNames.length > 0) { 23392 stylesEtsComponentDeclaration = (_b = sourceFileCompilerOptions.ets) == null ? void 0 : _b.styles.component; 23393 } 23394 setEtsStylesComponentsContext(!!stylesEtsComponentDeclaration); 23395 } else { 23396 setEtsComponentsContext(isTokenInsideBuilder(decorators, sourceFileCompilerOptions)); 23397 } 23398 } 23399 const modifiers = parseModifiers(); 23400 const isAmbient = some(modifiers, isDeclareModifier); 23401 if (isAmbient) { 23402 const node = tryReuseAmbientDeclaration(pos); 23403 if (node) { 23404 return node; 23405 } 23406 for (const m of modifiers) { 23407 m.flags |= 16777216 /* Ambient */; 23408 } 23409 return doInsideOfContext(16777216 /* Ambient */, () => parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers)); 23410 } else { 23411 return parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers); 23412 } 23413 } 23414 function tryReuseAmbientDeclaration(pos) { 23415 return doInsideOfContext(16777216 /* Ambient */, () => { 23416 const node = currentNode(parsingContext, pos); 23417 if (node) { 23418 return consumeNode(node); 23419 } 23420 }); 23421 } 23422 function parseDeclarationWorker(pos, hasJSDoc, decorators, modifiers) { 23423 switch (token()) { 23424 case 114 /* VarKeyword */: 23425 case 120 /* LetKeyword */: 23426 case 86 /* ConstKeyword */: 23427 return parseVariableStatement(pos, hasJSDoc, decorators, modifiers); 23428 case 99 /* FunctionKeyword */: 23429 return parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers); 23430 case 84 /* ClassKeyword */: 23431 return parseClassDeclaration(pos, hasJSDoc, decorators, modifiers); 23432 case 85 /* StructKeyword */: 23433 if (inEtsContext()) { 23434 return parseStructDeclaration(pos, hasJSDoc, decorators, modifiers); 23435 } 23436 return parseDeclarationDefault(pos, decorators, modifiers); 23437 case 59 /* AtToken */: 23438 if (inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */)) { 23439 return parseAnnotationDeclaration(pos, hasJSDoc, decorators, modifiers); 23440 } 23441 return parseDeclarationDefault(pos, decorators, modifiers); 23442 case 119 /* InterfaceKeyword */: 23443 return parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers); 23444 case 155 /* TypeKeyword */: 23445 return parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers); 23446 case 93 /* EnumKeyword */: 23447 return parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers); 23448 case 161 /* GlobalKeyword */: 23449 case 143 /* ModuleKeyword */: 23450 case 144 /* NamespaceKeyword */: 23451 return parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers); 23452 case 101 /* ImportKeyword */: 23453 return parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers); 23454 case 94 /* ExportKeyword */: 23455 nextToken(); 23456 switch (token()) { 23457 case 89 /* DefaultKeyword */: 23458 case 63 /* EqualsToken */: 23459 return parseExportAssignment(pos, hasJSDoc, decorators, modifiers); 23460 case 129 /* AsKeyword */: 23461 return parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers); 23462 default: 23463 return parseExportDeclaration(pos, hasJSDoc, decorators, modifiers); 23464 } 23465 default: 23466 return parseDeclarationDefault(pos, decorators, modifiers); 23467 } 23468 } 23469 function parseDeclarationDefault(pos, decorators, modifiers) { 23470 if (decorators || modifiers) { 23471 const missing = createMissingNode(285 /* MissingDeclaration */, true, Diagnostics.Declaration_expected); 23472 setTextRangePos(missing, pos); 23473 missing.illegalDecorators = decorators; 23474 missing.modifiers = modifiers; 23475 return missing; 23476 } 23477 return void 0; 23478 } 23479 function nextTokenIsIdentifierOrStringLiteralOnSameLine() { 23480 nextToken(); 23481 return !scanner.hasPrecedingLineBreak() && (isIdentifier2() || token() === 10 /* StringLiteral */); 23482 } 23483 function parseFunctionBlockOrSemicolon(flags, diagnosticMessage) { 23484 if (token() !== 18 /* OpenBraceToken */) { 23485 if (flags & 4 /* Type */) { 23486 parseTypeMemberSemicolon(); 23487 return; 23488 } 23489 if (canParseSemicolon()) { 23490 parseSemicolon(); 23491 return; 23492 } 23493 } 23494 return parseFunctionBlock(flags, diagnosticMessage); 23495 } 23496 function parseArrayBindingElement() { 23497 const pos = getNodePos(); 23498 if (token() === 27 /* CommaToken */) { 23499 return finishNode(factory2.createOmittedExpression(), pos); 23500 } 23501 const dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); 23502 const name = parseIdentifierOrPattern(); 23503 const initializer = parseInitializer(); 23504 return finishNode(factory2.createBindingElement(dotDotDotToken, void 0, name, initializer), pos); 23505 } 23506 function parseObjectBindingElement() { 23507 const pos = getNodePos(); 23508 const dotDotDotToken = parseOptionalToken(25 /* DotDotDotToken */); 23509 const tokenIsIdentifier = isBindingIdentifier(); 23510 let propertyName = parsePropertyName(); 23511 let name; 23512 if (tokenIsIdentifier && token() !== 58 /* ColonToken */) { 23513 name = propertyName; 23514 propertyName = void 0; 23515 } else { 23516 parseExpected(58 /* ColonToken */); 23517 name = parseIdentifierOrPattern(); 23518 } 23519 const initializer = parseInitializer(); 23520 return finishNode(factory2.createBindingElement(dotDotDotToken, propertyName, name, initializer), pos); 23521 } 23522 function parseObjectBindingPattern() { 23523 const pos = getNodePos(); 23524 parseExpected(18 /* OpenBraceToken */); 23525 const elements = parseDelimitedList(ParsingContext.ObjectBindingElements, parseObjectBindingElement); 23526 parseExpected(19 /* CloseBraceToken */); 23527 return finishNode(factory2.createObjectBindingPattern(elements), pos); 23528 } 23529 function parseArrayBindingPattern() { 23530 const pos = getNodePos(); 23531 parseExpected(22 /* OpenBracketToken */); 23532 const elements = parseDelimitedList(ParsingContext.ArrayBindingElements, parseArrayBindingElement); 23533 parseExpected(23 /* CloseBracketToken */); 23534 return finishNode(factory2.createArrayBindingPattern(elements), pos); 23535 } 23536 function isBindingIdentifierOrPrivateIdentifierOrPattern() { 23537 return token() === 18 /* OpenBraceToken */ || token() === 22 /* OpenBracketToken */ || token() === 80 /* PrivateIdentifier */ || isBindingIdentifier(); 23538 } 23539 function parseIdentifierOrPattern(privateIdentifierDiagnosticMessage) { 23540 if (token() === 22 /* OpenBracketToken */) { 23541 return parseArrayBindingPattern(); 23542 } 23543 if (token() === 18 /* OpenBraceToken */) { 23544 return parseObjectBindingPattern(); 23545 } 23546 return parseBindingIdentifier(privateIdentifierDiagnosticMessage); 23547 } 23548 function parseVariableDeclarationAllowExclamation() { 23549 return parseVariableDeclaration(true); 23550 } 23551 function parseVariableDeclaration(allowExclamation) { 23552 const pos = getNodePos(); 23553 const hasJSDoc = hasPrecedingJSDocComment(); 23554 const name = parseIdentifierOrPattern(Diagnostics.Private_identifiers_are_not_allowed_in_variable_declarations); 23555 let exclamationToken; 23556 if (allowExclamation && name.kind === 79 /* Identifier */ && token() === 53 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { 23557 exclamationToken = parseTokenNode(); 23558 } 23559 const type = parseTypeAnnotation(); 23560 const initializer = isInOrOfKeyword(token()) ? void 0 : parseInitializer(); 23561 const node = factory2.createVariableDeclaration(name, exclamationToken, type, initializer); 23562 return withJSDoc(finishNode(node, pos), hasJSDoc); 23563 } 23564 function parseVariableDeclarationList(inForStatementInitializer) { 23565 const pos = getNodePos(); 23566 let flags = 0; 23567 switch (token()) { 23568 case 114 /* VarKeyword */: 23569 break; 23570 case 120 /* LetKeyword */: 23571 flags |= 1 /* Let */; 23572 break; 23573 case 86 /* ConstKeyword */: 23574 flags |= 2 /* Const */; 23575 break; 23576 default: 23577 Debug.fail(); 23578 } 23579 nextToken(); 23580 let declarations; 23581 if (token() === 164 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { 23582 declarations = createMissingList(); 23583 } else { 23584 const savedDisallowIn = inDisallowInContext(); 23585 setDisallowInContext(inForStatementInitializer); 23586 declarations = parseDelimitedList( 23587 ParsingContext.VariableDeclarations, 23588 inForStatementInitializer ? parseVariableDeclaration : parseVariableDeclarationAllowExclamation 23589 ); 23590 setDisallowInContext(savedDisallowIn); 23591 } 23592 return finishNode(factory2.createVariableDeclarationList(declarations, flags), pos); 23593 } 23594 function canFollowContextualOfKeyword() { 23595 return nextTokenIsIdentifier() && nextToken() === 21 /* CloseParenToken */; 23596 } 23597 function parseVariableStatement(pos, hasJSDoc, decorators, modifiers) { 23598 const declarationList = parseVariableDeclarationList(false); 23599 parseSemicolon(); 23600 const node = factory2.createVariableStatement(modifiers, declarationList); 23601 node.illegalDecorators = decorators; 23602 return withJSDoc(finishNode(node, pos), hasJSDoc); 23603 } 23604 function parseFunctionDeclaration(pos, hasJSDoc, decorators, modifiers) { 23605 const savedAwaitContext = inAwaitContext(); 23606 const modifierFlags = modifiersToFlags(modifiers); 23607 parseExpected(99 /* FunctionKeyword */); 23608 const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); 23609 const name = modifierFlags & 1024 /* Default */ ? parseOptionalBindingIdentifier() : parseBindingIdentifier(); 23610 if (name && hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) { 23611 fileStylesComponents.set(name.escapedText.toString(), 263 /* FunctionDeclaration */); 23612 } 23613 const originalUICallbackContext = inUICallbackContext(); 23614 setEtsBuilderContext(hasEtsBuilderDecoratorNames(decorators, sourceFileCompilerOptions)); 23615 setUICallbackContext(inBuilderContext()); 23616 const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; 23617 const isAsync = modifierFlags & 512 /* Async */ ? 2 /* Await */ : 0 /* None */; 23618 const typeParameters = inEtsStylesComponentsContext() && stylesEtsComponentDeclaration ? parseEtsTypeParameters(scanner.getStartPos()) : parseTypeParameters(); 23619 if (modifierFlags & 1 /* Export */) 23620 setAwaitContext(true); 23621 const parameters = parseParameters(isGenerator | isAsync); 23622 const typeStartPos = scanner.getStartPos(); 23623 const type = getFunctionDeclarationReturnType(); 23624 const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, Diagnostics.or_expected); 23625 setEtsBuilderContext(false); 23626 setUICallbackContext(originalUICallbackContext); 23627 setEtsExtendComponentsContext(false); 23628 extendEtsComponentDeclaration = void 0; 23629 setEtsStylesComponentsContext(false); 23630 stylesEtsComponentDeclaration = void 0; 23631 setEtsComponentsContext(inBuildContext()); 23632 setAwaitContext(savedAwaitContext); 23633 const node = factory2.createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body); 23634 node.illegalDecorators = decorators; 23635 return withJSDoc(finishNode(node, pos), hasJSDoc); 23636 function getFunctionDeclarationReturnType() { 23637 let returnType = parseReturnType(58 /* ColonToken */, false); 23638 if (!returnType && extendEtsComponentDeclaration && inEtsExtendComponentsContext()) { 23639 returnType = finishVirtualNode( 23640 factory2.createTypeReferenceNode( 23641 finishVirtualNode(factory2.createIdentifier(extendEtsComponentDeclaration.type), typeStartPos, typeStartPos) 23642 ), 23643 typeStartPos, 23644 typeStartPos 23645 ); 23646 } 23647 if (!returnType && stylesEtsComponentDeclaration && inEtsStylesComponentsContext()) { 23648 returnType = finishVirtualNode( 23649 factory2.createTypeReferenceNode( 23650 finishVirtualNode(factory2.createIdentifier(stylesEtsComponentDeclaration.type), typeStartPos, typeStartPos) 23651 ), 23652 typeStartPos, 23653 typeStartPos 23654 ); 23655 } 23656 return returnType; 23657 } 23658 } 23659 function parseConstructorName() { 23660 if (token() === 136 /* ConstructorKeyword */) { 23661 return parseExpected(136 /* ConstructorKeyword */); 23662 } 23663 if (token() === 10 /* StringLiteral */ && lookAhead(nextToken) === 20 /* OpenParenToken */) { 23664 return tryParse(() => { 23665 const literalNode = parseLiteralNode(); 23666 return literalNode.text === "constructor" ? literalNode : void 0; 23667 }); 23668 } 23669 } 23670 function tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers) { 23671 return tryParse(() => { 23672 if (parseConstructorName()) { 23673 const typeParameters = parseTypeParameters(); 23674 const parameters = parseParameters(0 /* None */); 23675 const type = parseReturnType(58 /* ColonToken */, false); 23676 const body = parseFunctionBlockOrSemicolon(0 /* None */, Diagnostics.or_expected); 23677 const node = factory2.createConstructorDeclaration(modifiers, parameters, body); 23678 node.illegalDecorators = decorators; 23679 node.typeParameters = typeParameters; 23680 node.type = type; 23681 return withJSDoc(finishNode(node, pos), hasJSDoc); 23682 } 23683 }); 23684 } 23685 function isTokenInsideStructBuild(methodName) { 23686 var _a2, _b, _c, _d; 23687 const renderMethod = (_d = (_c = (_b = (_a2 = sourceFileCompilerOptions.ets) == null ? void 0 : _a2.render) == null ? void 0 : _b.method) == null ? void 0 : _c.find((render) => render === "build")) != null ? _d : "build"; 23688 if (methodName.kind === 79 /* Identifier */ && methodName.escapedText === renderMethod) { 23689 return true; 23690 } 23691 return false; 23692 } 23693 function isTokenInsideStructBuilder(decorators) { 23694 return isTokenInsideBuilder(decorators, sourceFileCompilerOptions); 23695 } 23696 function isTokenInsideStructPageTransition(methodName) { 23697 var _a2, _b, _c, _d; 23698 const renderMethod = (_d = (_c = (_b = (_a2 = sourceFileCompilerOptions.ets) == null ? void 0 : _a2.render) == null ? void 0 : _b.method) == null ? void 0 : _c.find((render) => render === "pageTransition")) != null ? _d : "pageTransition"; 23699 if (methodName.kind === 79 /* Identifier */ && methodName.escapedText === renderMethod) { 23700 return true; 23701 } 23702 return false; 23703 } 23704 function parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name, questionToken, exclamationToken, diagnosticMessage) { 23705 var _a2, _b, _c, _d, _e; 23706 const methodName = (_a2 = getPropertyNameForPropertyNameNode(name)) == null ? void 0 : _a2.toString(); 23707 const orignalEtsBuildContext = inBuildContext(); 23708 const orignalEtsBuilderContext = inBuilderContext(); 23709 const orignalUICallbackContext = inUICallbackContext(); 23710 setEtsBuildContext(methodName === ((_d = (_c = (_b = sourceFileCompilerOptions == null ? void 0 : sourceFileCompilerOptions.ets) == null ? void 0 : _b.render) == null ? void 0 : _c.method) == null ? void 0 : _d.find((render) => render === "build"))); 23711 setEtsBuilderContext(hasEtsBuilderDecoratorNames(decorators, sourceFileCompilerOptions)); 23712 setUICallbackContext(inBuildContext() || inBuilderContext()); 23713 if (inStructContext() && hasEtsStylesDecoratorNames(decorators, sourceFileCompilerOptions)) { 23714 if (methodName && currentStructName) { 23715 structStylesComponents.set(methodName, { structName: currentStructName, kind: 174 /* MethodDeclaration */ }); 23716 } 23717 const stylesEtsComponentDecoratorNames = getEtsStylesDecoratorComponentNames(decorators, sourceFileCompilerOptions); 23718 if (stylesEtsComponentDecoratorNames.length > 0) { 23719 stylesEtsComponentDeclaration = (_e = sourceFileCompilerOptions.ets) == null ? void 0 : _e.styles.component; 23720 } 23721 setEtsStylesComponentsContext(!!stylesEtsComponentDeclaration); 23722 } 23723 const orignalEtsComponentsContext = inEtsComponentsContext(); 23724 setEtsComponentsContext(inStructContext() && (isTokenInsideStructBuild(name) || isTokenInsideStructBuilder(decorators) || isTokenInsideStructPageTransition(name))); 23725 const isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; 23726 const isAsync = some(modifiers, isAsyncModifier) ? 2 /* Await */ : 0 /* None */; 23727 const typeParameters = inEtsStylesComponentsContext() && stylesEtsComponentDeclaration ? parseEtsTypeParameters(pos) : parseTypeParameters(); 23728 const parameters = parseParameters(isGenerator | isAsync); 23729 const typeStartPos = scanner.getStartPos(); 23730 const type = getMethodDeclarationReturnType(); 23731 const body = parseFunctionBlockOrSemicolon(isGenerator | isAsync, diagnosticMessage); 23732 const node = factory2.createMethodDeclaration( 23733 combineDecoratorsAndModifiers(decorators, modifiers), 23734 asteriskToken, 23735 name, 23736 questionToken, 23737 typeParameters, 23738 parameters, 23739 type, 23740 body 23741 ); 23742 node.exclamationToken = exclamationToken; 23743 setEtsBuildContext(orignalEtsBuildContext); 23744 setEtsBuilderContext(orignalEtsBuilderContext); 23745 setUICallbackContext(orignalUICallbackContext); 23746 setEtsStylesComponentsContext(false); 23747 stylesEtsComponentDeclaration = void 0; 23748 setEtsComponentsContext(orignalEtsComponentsContext); 23749 return withJSDoc(finishNode(node, pos), hasJSDoc); 23750 function getMethodDeclarationReturnType() { 23751 let returnType = parseReturnType(58 /* ColonToken */, false); 23752 if (!returnType && stylesEtsComponentDeclaration && inEtsStylesComponentsContext()) { 23753 returnType = finishVirtualNode( 23754 factory2.createTypeReferenceNode( 23755 finishVirtualNode(factory2.createIdentifier(stylesEtsComponentDeclaration.type), typeStartPos, typeStartPos) 23756 ), 23757 typeStartPos, 23758 typeStartPos 23759 ); 23760 } 23761 return returnType; 23762 } 23763 } 23764 function parseAnnotationPropertyDeclaration(pos, hasJSDoc, name) { 23765 const type = parseTypeAnnotation(); 23766 const initializer = doOutsideOfContext(8192 /* YieldContext */ | 32768 /* AwaitContext */ | 4096 /* DisallowInContext */, parseInitializer); 23767 parseSemicolonAfterPropertyName(name, type, initializer); 23768 const node = factory2.createAnnotationPropertyDeclaration( 23769 name, 23770 type, 23771 initializer 23772 ); 23773 return withJSDoc(finishNode(node, pos), hasJSDoc); 23774 } 23775 function parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, questionToken) { 23776 const exclamationToken = !questionToken && !scanner.hasPrecedingLineBreak() ? parseOptionalToken(53 /* ExclamationToken */) : void 0; 23777 const type = parseTypeAnnotation(); 23778 const initializer = doOutsideOfContext(8192 /* YieldContext */ | 32768 /* AwaitContext */ | 4096 /* DisallowInContext */, parseInitializer); 23779 parseSemicolonAfterPropertyName(name, type, initializer); 23780 const node = factory2.createPropertyDeclaration( 23781 combineDecoratorsAndModifiers(decorators, modifiers), 23782 name, 23783 questionToken || exclamationToken, 23784 type, 23785 initializer 23786 ); 23787 return withJSDoc(finishNode(node, pos), hasJSDoc); 23788 } 23789 function parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers) { 23790 const asteriskToken = parseOptionalToken(41 /* AsteriskToken */); 23791 const name = parsePropertyName(); 23792 const questionToken = parseOptionalToken(57 /* QuestionToken */); 23793 if (asteriskToken || token() === 20 /* OpenParenToken */ || token() === 29 /* LessThanToken */) { 23794 return parseMethodDeclaration(pos, hasJSDoc, decorators, modifiers, asteriskToken, name, questionToken, void 0, Diagnostics.or_expected); 23795 } 23796 return parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, questionToken); 23797 } 23798 function parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, kind, flags) { 23799 const name = parsePropertyName(); 23800 const typeParameters = parseTypeParameters(); 23801 const parameters = parseParameters(0 /* None */); 23802 const type = parseReturnType(58 /* ColonToken */, false); 23803 const body = parseFunctionBlockOrSemicolon(flags); 23804 const node = kind === 177 /* GetAccessor */ ? factory2.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body) : factory2.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body); 23805 node.typeParameters = typeParameters; 23806 if (isSetAccessorDeclaration(node)) 23807 node.type = type; 23808 return withJSDoc(finishNode(node, pos), hasJSDoc); 23809 } 23810 function isAnnotationMemberStart() { 23811 let idToken; 23812 if (token() === 59 /* AtToken */) { 23813 return false; 23814 } 23815 if (isModifierKind(token())) { 23816 return false; 23817 } 23818 if (token() === 41 /* AsteriskToken */) { 23819 return false; 23820 } 23821 if (isLiteralPropertyName()) { 23822 idToken = token(); 23823 nextToken(); 23824 } 23825 if (token() === 22 /* OpenBracketToken */) { 23826 return false; 23827 } 23828 if (idToken !== void 0) { 23829 if (isKeyword(idToken)) { 23830 return false; 23831 } 23832 switch (token()) { 23833 case 58 /* ColonToken */: 23834 case 63 /* EqualsToken */: 23835 return true; 23836 default: 23837 return canParseSemicolon(); 23838 } 23839 } 23840 return false; 23841 } 23842 function isClassMemberStart() { 23843 let idToken; 23844 if (token() === 59 /* AtToken */) { 23845 if (inAllowAnnotationContext() && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */)) { 23846 return false; 23847 } 23848 return true; 23849 } 23850 while (isModifierKind(token())) { 23851 idToken = token(); 23852 if (isClassMemberModifier(idToken)) { 23853 return true; 23854 } 23855 nextToken(); 23856 } 23857 if (token() === 41 /* AsteriskToken */) { 23858 return true; 23859 } 23860 if (isLiteralPropertyName()) { 23861 idToken = token(); 23862 nextToken(); 23863 } 23864 if (token() === 22 /* OpenBracketToken */) { 23865 return true; 23866 } 23867 if (idToken !== void 0) { 23868 if (!isKeyword(idToken) || idToken === 152 /* SetKeyword */ || idToken === 138 /* GetKeyword */) { 23869 return true; 23870 } 23871 switch (token()) { 23872 case 20 /* OpenParenToken */: 23873 case 29 /* LessThanToken */: 23874 case 53 /* ExclamationToken */: 23875 case 58 /* ColonToken */: 23876 case 63 /* EqualsToken */: 23877 case 57 /* QuestionToken */: 23878 return true; 23879 default: 23880 return canParseSemicolon(); 23881 } 23882 } 23883 return false; 23884 } 23885 function parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers) { 23886 parseExpectedToken(125 /* StaticKeyword */); 23887 const body = parseClassStaticBlockBody(); 23888 const node = withJSDoc(finishNode(factory2.createClassStaticBlockDeclaration(body), pos), hasJSDoc); 23889 node.illegalDecorators = decorators; 23890 node.modifiers = modifiers; 23891 return node; 23892 } 23893 function parseClassStaticBlockBody() { 23894 const savedYieldContext = inYieldContext(); 23895 const savedAwaitContext = inAwaitContext(); 23896 setYieldContext(false); 23897 setAwaitContext(true); 23898 const body = parseBlock(false); 23899 setYieldContext(savedYieldContext); 23900 setAwaitContext(savedAwaitContext); 23901 return body; 23902 } 23903 function parseDecoratorExpression() { 23904 if (inAwaitContext() && token() === 134 /* AwaitKeyword */) { 23905 const pos = getNodePos(); 23906 const awaitExpression = parseIdentifier(Diagnostics.Expression_expected); 23907 nextToken(); 23908 const memberExpression = parseMemberExpressionRest(pos, awaitExpression, true); 23909 return parseCallExpressionRest(pos, memberExpression); 23910 } 23911 return parseLeftHandSideExpressionOrHigher(); 23912 } 23913 function tryParseDecorator() { 23914 const pos = getNodePos(); 23915 if (inAllowAnnotationContext() && token() === 59 /* AtToken */ && lookAhead(() => nextToken() === 119 /* InterfaceKeyword */)) { 23916 return void 0; 23917 } 23918 if (!parseOptional(59 /* AtToken */)) { 23919 return void 0; 23920 } 23921 const expression = doInDecoratorContext(parseDecoratorExpression); 23922 return finishNode(factory2.createDecorator(expression), pos); 23923 } 23924 function parseDecorators() { 23925 const pos = getNodePos(); 23926 let list, decorator; 23927 while (decorator = tryParseDecorator()) { 23928 list = append(list, decorator); 23929 } 23930 return list && createNodeArray(list, pos); 23931 } 23932 function tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) { 23933 const pos = getNodePos(); 23934 const kind = token(); 23935 if (token() === 86 /* ConstKeyword */ && permitInvalidConstAsModifier) { 23936 if (!tryParse(nextTokenIsOnSameLineAndCanFollowModifier)) { 23937 return void 0; 23938 } 23939 } else if (stopOnStartOfClassStaticBlock && token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) { 23940 return void 0; 23941 } else if (hasSeenStaticModifier && token() === 125 /* StaticKeyword */) { 23942 return void 0; 23943 } else { 23944 if (!parseAnyContextualModifier()) { 23945 return void 0; 23946 } 23947 } 23948 return finishNode(factory2.createToken(kind), pos); 23949 } 23950 function combineDecoratorsAndModifiers(decorators, modifiers) { 23951 if (!decorators) 23952 return modifiers; 23953 if (!modifiers) 23954 return decorators; 23955 const decoratorsAndModifiers = factory2.createNodeArray(concatenate(decorators, modifiers)); 23956 setTextRangePosEnd(decoratorsAndModifiers, decorators.pos, modifiers.end); 23957 return decoratorsAndModifiers; 23958 } 23959 function hasParamAndNoOnceDecorator(decorators) { 23960 let hasParamDecorator = false; 23961 let hasOnceDecorator = false; 23962 decorators == null ? void 0 : decorators.forEach((decorator) => { 23963 if (!isIdentifier(decorator.expression)) { 23964 return; 23965 } 23966 if (decorator.expression.escapedText === "Param") { 23967 hasParamDecorator = true; 23968 } else if (decorator.expression.escapedText === "Once") { 23969 hasOnceDecorator = true; 23970 } 23971 }); 23972 return hasParamDecorator && !hasOnceDecorator; 23973 } 23974 function parseModifiers(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, shouldAddReadonly) { 23975 const pos = getNodePos(); 23976 let list, modifier, hasSeenStatic = false; 23977 let hasReadonly = false; 23978 while (modifier = tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) { 23979 if (modifier.kind === 125 /* StaticKeyword */) 23980 hasSeenStatic = true; 23981 if (modifier.kind === 147 /* ReadonlyKeyword */) { 23982 hasReadonly = true; 23983 } 23984 list = append(list, modifier); 23985 } 23986 if (shouldAddReadonly && !hasReadonly) { 23987 const readonlyModifier = finishVirtualNode(factory2.createToken(147 /* ReadonlyKeyword */)); 23988 list = append(list, readonlyModifier); 23989 } 23990 return list && createNodeArray(list, pos); 23991 } 23992 function parseModifiersForArrowFunction() { 23993 let modifiers; 23994 if (token() === 133 /* AsyncKeyword */) { 23995 const pos = getNodePos(); 23996 nextToken(); 23997 const modifier = finishNode(factory2.createToken(133 /* AsyncKeyword */), pos); 23998 modifiers = createNodeArray([modifier], pos); 23999 } 24000 return modifiers; 24001 } 24002 function parseClassElement() { 24003 const pos = getNodePos(); 24004 if (token() === 26 /* SemicolonToken */) { 24005 nextToken(); 24006 return finishNode(factory2.createSemicolonClassElement(), pos); 24007 } 24008 const hasJSDoc = hasPrecedingJSDocComment(); 24009 const decorators = parseDecorators(); 24010 const shouldAddReadonly = inStructContext() && hasParamAndNoOnceDecorator(decorators); 24011 const modifiers = parseModifiers(true, true, shouldAddReadonly); 24012 if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) { 24013 return parseClassStaticBlockDeclaration(pos, hasJSDoc, decorators, modifiers); 24014 } 24015 if (parseContextualModifier(138 /* GetKeyword */)) { 24016 return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 177 /* GetAccessor */, 0 /* None */); 24017 } 24018 if (parseContextualModifier(152 /* SetKeyword */)) { 24019 return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, 178 /* SetAccessor */, 0 /* None */); 24020 } 24021 if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { 24022 const constructorDeclaration = tryParseConstructorDeclaration(pos, hasJSDoc, decorators, modifiers); 24023 if (constructorDeclaration) { 24024 return constructorDeclaration; 24025 } 24026 } 24027 if (isIndexSignature()) { 24028 return parseIndexSignatureDeclaration(pos, hasJSDoc, decorators, modifiers); 24029 } 24030 if (tokenIsIdentifierOrKeyword(token()) || token() === 10 /* StringLiteral */ || token() === 8 /* NumericLiteral */ || token() === 41 /* AsteriskToken */ || token() === 22 /* OpenBracketToken */) { 24031 const isAmbient = some(modifiers, isDeclareModifier); 24032 if (isAmbient) { 24033 for (const m of modifiers) { 24034 m.flags |= 16777216 /* Ambient */; 24035 } 24036 return doInsideOfContext(16777216 /* Ambient */, () => parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers)); 24037 } else { 24038 return parsePropertyOrMethodDeclaration(pos, hasJSDoc, decorators, modifiers); 24039 } 24040 } 24041 if (decorators || modifiers) { 24042 const name = createMissingNode(79 /* Identifier */, true, Diagnostics.Declaration_expected); 24043 return parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, void 0); 24044 } 24045 return Debug.fail("Should not have attempted to parse class member declaration."); 24046 } 24047 function parseAnnotationElement() { 24048 const pos = getNodePos(); 24049 if (token() === 26 /* SemicolonToken */) { 24050 parseErrorAt(pos, pos, Diagnostics.Unexpected_keyword_or_identifier); 24051 } 24052 const hasJSDoc = hasPrecedingJSDocComment(); 24053 if (token() === 125 /* StaticKeyword */ && lookAhead(nextTokenIsOpenBrace)) { 24054 return createMissingNode( 24055 172 /* AnnotationPropertyDeclaration */, 24056 true, 24057 Diagnostics.Unexpected_keyword_or_identifier 24058 ); 24059 } 24060 if (parseContextualModifier(138 /* GetKeyword */)) { 24061 return createMissingNode( 24062 172 /* AnnotationPropertyDeclaration */, 24063 true, 24064 Diagnostics.Unexpected_keyword_or_identifier 24065 ); 24066 } 24067 if (parseContextualModifier(152 /* SetKeyword */)) { 24068 return createMissingNode( 24069 172 /* AnnotationPropertyDeclaration */, 24070 true, 24071 Diagnostics.Unexpected_keyword_or_identifier 24072 ); 24073 } 24074 if (token() === 136 /* ConstructorKeyword */ || token() === 10 /* StringLiteral */) { 24075 return createMissingNode( 24076 172 /* AnnotationPropertyDeclaration */, 24077 true, 24078 Diagnostics.Unexpected_keyword_or_identifier 24079 ); 24080 } 24081 if (isIndexSignature()) { 24082 return createMissingNode( 24083 172 /* AnnotationPropertyDeclaration */, 24084 true, 24085 Diagnostics.Unexpected_keyword_or_identifier 24086 ); 24087 } 24088 if (tokenIsIdentifierOrKeyword(token())) { 24089 const name = parsePropertyName(); 24090 return parseAnnotationPropertyDeclaration(pos, hasJSDoc, name); 24091 } 24092 return Debug.fail("Should not have attempted to parse annotation member declaration."); 24093 } 24094 function parseClassExpression() { 24095 return parseClassDeclarationOrExpression(getNodePos(), hasPrecedingJSDocComment(), void 0, void 0, 232 /* ClassExpression */); 24096 } 24097 function parseClassDeclaration(pos, hasJSDoc, decorators, modifiers) { 24098 return parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, 264 /* ClassDeclaration */); 24099 } 24100 function parseStructDeclaration(pos, hasJSDoc, decorators, modifiers) { 24101 return parseStructDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers); 24102 } 24103 function parseClassDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers, kind) { 24104 const savedAwaitContext = inAwaitContext(); 24105 parseExpected(84 /* ClassKeyword */); 24106 const name = parseNameOfClassDeclarationOrExpression(); 24107 const typeParameters = parseTypeParameters(); 24108 if (some(modifiers, isExportModifier)) 24109 setAwaitContext(true); 24110 const heritageClauses = parseHeritageClauses(); 24111 let members; 24112 if (parseExpected(18 /* OpenBraceToken */)) { 24113 members = parseClassMembers(); 24114 parseExpected(19 /* CloseBraceToken */); 24115 } else { 24116 members = createMissingList(); 24117 } 24118 setAwaitContext(savedAwaitContext); 24119 const node = kind === 264 /* ClassDeclaration */ ? factory2.createClassDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members) : factory2.createClassExpression(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members); 24120 return withJSDoc(finishNode(node, pos), hasJSDoc); 24121 } 24122 function parseStructDeclarationOrExpression(pos, hasJSDoc, decorators, modifiers) { 24123 var _a2; 24124 const savedAwaitContext = inAwaitContext(); 24125 parseExpected(85 /* StructKeyword */); 24126 setStructContext(true); 24127 const name = parseNameOfClassDeclarationOrExpression(); 24128 const typeParameters = parseTypeParameters(); 24129 if (some(modifiers, isExportModifier)) 24130 setAwaitContext(true); 24131 let heritageClauses = parseHeritageClauses(); 24132 const customComponent = (_a2 = sourceFileCompilerOptions.ets) == null ? void 0 : _a2.customComponent; 24133 if (!heritageClauses && customComponent) { 24134 heritageClauses = createVirtualHeritageClauses(customComponent); 24135 } 24136 let members; 24137 if (parseExpected(18 /* OpenBraceToken */)) { 24138 members = parseStructMembers(pos); 24139 parseExpected(19 /* CloseBraceToken */); 24140 } else { 24141 members = createMissingList(); 24142 } 24143 setAwaitContext(savedAwaitContext); 24144 const node = factory2.createStructDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, typeParameters, heritageClauses, members); 24145 structStylesComponents.clear(); 24146 setStructContext(false); 24147 return withJSDoc(finishNode(node, pos), hasJSDoc); 24148 } 24149 function createVirtualHeritageClauses(customComponent) { 24150 const curPos = getNodePos(); 24151 const clause = factory2.createHeritageClause( 24152 95 /* ExtendsKeyword */, 24153 createNodeArray([finishNode(factory2.createExpressionWithTypeArguments( 24154 finishNode(factory2.createIdentifier(customComponent), curPos, void 0, true), 24155 void 0 24156 ), curPos)], curPos, void 0, false) 24157 ); 24158 return createNodeArray([finishNode(clause, curPos, void 0, true)], curPos, void 0, false); 24159 } 24160 function parseNameOfClassDeclarationOrExpression() { 24161 return isBindingIdentifier() && !isImplementsClause() ? createIdentifier(isBindingIdentifier()) : void 0; 24162 } 24163 function isImplementsClause() { 24164 return token() === 118 /* ImplementsKeyword */ && lookAhead(nextTokenIsIdentifierOrKeyword); 24165 } 24166 function parseHeritageClauses() { 24167 if (isHeritageClause2()) { 24168 return parseList(ParsingContext.HeritageClauses, parseHeritageClause); 24169 } 24170 return void 0; 24171 } 24172 function parseHeritageClause() { 24173 const pos = getNodePos(); 24174 const tok = token(); 24175 Debug.assert(tok === 95 /* ExtendsKeyword */ || tok === 118 /* ImplementsKeyword */); 24176 nextToken(); 24177 const types = parseDelimitedList(ParsingContext.HeritageClauseElement, parseExpressionWithTypeArguments); 24178 return finishNode(factory2.createHeritageClause(tok, types), pos); 24179 } 24180 function parseExpressionWithTypeArguments() { 24181 const pos = getNodePos(); 24182 const expression = parseLeftHandSideExpressionOrHigher(); 24183 if (expression.kind === 234 /* ExpressionWithTypeArguments */) { 24184 return expression; 24185 } 24186 const typeArguments = tryParseTypeArguments(); 24187 return finishNode(factory2.createExpressionWithTypeArguments(expression, typeArguments), pos); 24188 } 24189 function tryParseTypeArguments() { 24190 return token() === 29 /* LessThanToken */ ? parseBracketedList(ParsingContext.TypeArguments, parseType, 29 /* LessThanToken */, 31 /* GreaterThanToken */) : void 0; 24191 } 24192 function isHeritageClause2() { 24193 return token() === 95 /* ExtendsKeyword */ || token() === 118 /* ImplementsKeyword */; 24194 } 24195 function parseClassMembers() { 24196 return parseList(ParsingContext.ClassMembers, parseClassElement); 24197 } 24198 function parseAnnotationMembers() { 24199 return parseList(ParsingContext.AnnotationMembers, parseAnnotationElement); 24200 } 24201 function parseStructMembers(pos) { 24202 const structMembers = parseList(ParsingContext.ClassMembers, parseClassElement); 24203 const virtualStructMembers = []; 24204 const virtualParameterProperties = []; 24205 structMembers.forEach((member) => { 24206 virtualStructMembers.push(member); 24207 if (member.kind === 171 /* PropertyDeclaration */) { 24208 const property = member; 24209 virtualParameterProperties.push( 24210 finishVirtualNode( 24211 factory2.createPropertySignature(getModifiers(property), property.name, factory2.createToken(57 /* QuestionToken */), property.type) 24212 ) 24213 ); 24214 } 24215 }); 24216 const parameters = []; 24217 if (virtualParameterProperties.length) { 24218 const type = finishVirtualNode(factory2.createTypeLiteralNode(createNodeArray(virtualParameterProperties, 0, 0))); 24219 parameters.push( 24220 finishVirtualNode( 24221 factory2.createParameterDeclaration( 24222 void 0, 24223 void 0, 24224 finishVirtualNode(factory2.createIdentifier("value")), 24225 factory2.createToken(57 /* QuestionToken */), 24226 type 24227 ) 24228 ) 24229 ); 24230 } 24231 parameters.push( 24232 finishVirtualNode( 24233 factory2.createParameterDeclaration( 24234 void 0, 24235 void 0, 24236 finishVirtualNode(factory2.createIdentifier("##storage")), 24237 factory2.createToken(57 /* QuestionToken */), 24238 finishVirtualNode(factory2.createTypeReferenceNode(finishVirtualNode(factory2.createIdentifier("LocalStorage")))) 24239 ) 24240 ) 24241 ); 24242 const emptyBody = finishVirtualNode(factory2.createBlock(createNodeArray([], 0, 0))); 24243 const virtualConstructor = factory2.createConstructorDeclaration(void 0, createNodeArray(parameters, 0, 0), emptyBody); 24244 virtualStructMembers.unshift(finishVirtualNode(virtualConstructor, pos, pos)); 24245 return createNodeArray(virtualStructMembers, structMembers.pos); 24246 } 24247 function finishVirtualNode(node, start = 0, end = 0) { 24248 return finishNode(node, start, end, true); 24249 } 24250 function parseInterfaceDeclaration(pos, hasJSDoc, decorators, modifiers) { 24251 parseExpected(119 /* InterfaceKeyword */); 24252 const name = parseIdentifier(); 24253 const typeParameters = parseTypeParameters(); 24254 const heritageClauses = parseHeritageClauses(); 24255 const members = parseObjectTypeMembers(); 24256 const node = factory2.createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members); 24257 node.illegalDecorators = decorators; 24258 return withJSDoc(finishNode(node, pos), hasJSDoc); 24259 } 24260 function parseTypeAliasDeclaration(pos, hasJSDoc, decorators, modifiers) { 24261 parseExpected(155 /* TypeKeyword */); 24262 const name = parseIdentifier(); 24263 const typeParameters = parseTypeParameters(); 24264 parseExpected(63 /* EqualsToken */); 24265 const type = token() === 140 /* IntrinsicKeyword */ && tryParse(parseKeywordAndNoDot) || parseType(); 24266 parseSemicolon(); 24267 const node = factory2.createTypeAliasDeclaration(modifiers, name, typeParameters, type); 24268 node.illegalDecorators = decorators; 24269 return withJSDoc(finishNode(node, pos), hasJSDoc); 24270 } 24271 function parseEnumMember() { 24272 const pos = getNodePos(); 24273 const hasJSDoc = hasPrecedingJSDocComment(); 24274 const name = parsePropertyName(); 24275 const initializer = allowInAnd(parseInitializer); 24276 return withJSDoc(finishNode(factory2.createEnumMember(name, initializer), pos), hasJSDoc); 24277 } 24278 function parseEnumDeclaration(pos, hasJSDoc, decorators, modifiers) { 24279 parseExpected(93 /* EnumKeyword */); 24280 const name = parseIdentifier(); 24281 let members; 24282 if (parseExpected(18 /* OpenBraceToken */)) { 24283 members = doOutsideOfYieldAndAwaitContext(() => parseDelimitedList(ParsingContext.EnumMembers, parseEnumMember)); 24284 parseExpected(19 /* CloseBraceToken */); 24285 } else { 24286 members = createMissingList(); 24287 } 24288 const node = factory2.createEnumDeclaration(modifiers, name, members); 24289 node.illegalDecorators = decorators; 24290 return withJSDoc(finishNode(node, pos), hasJSDoc); 24291 } 24292 function parseModuleBlock() { 24293 const pos = getNodePos(); 24294 let statements; 24295 if (parseExpected(18 /* OpenBraceToken */)) { 24296 statements = parseList(ParsingContext.BlockStatements, parseStatement); 24297 parseExpected(19 /* CloseBraceToken */); 24298 } else { 24299 statements = createMissingList(); 24300 } 24301 return finishNode(factory2.createModuleBlock(statements), pos); 24302 } 24303 function parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags) { 24304 const namespaceFlag = flags & 16 /* Namespace */; 24305 const name = parseIdentifier(); 24306 const body = parseOptional(24 /* DotToken */) ? parseModuleOrNamespaceDeclaration(getNodePos(), false, void 0, void 0, 4 /* NestedNamespace */ | namespaceFlag) : parseModuleBlock(); 24307 const node = factory2.createModuleDeclaration(modifiers, name, body, flags); 24308 node.illegalDecorators = decorators; 24309 return withJSDoc(finishNode(node, pos), hasJSDoc); 24310 } 24311 function parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { 24312 let flags = 0; 24313 let name; 24314 if (token() === 161 /* GlobalKeyword */) { 24315 name = parseIdentifier(); 24316 flags |= 1024 /* GlobalAugmentation */; 24317 } else { 24318 name = parseLiteralNode(); 24319 name.text = internIdentifier(name.text); 24320 } 24321 let body; 24322 if (token() === 18 /* OpenBraceToken */) { 24323 body = parseModuleBlock(); 24324 } else { 24325 parseSemicolon(); 24326 } 24327 const node = factory2.createModuleDeclaration(modifiers, name, body, flags); 24328 node.illegalDecorators = decorators; 24329 return withJSDoc(finishNode(node, pos), hasJSDoc); 24330 } 24331 function parseModuleDeclaration(pos, hasJSDoc, decorators, modifiers) { 24332 let flags = 0; 24333 if (token() === 161 /* GlobalKeyword */) { 24334 return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); 24335 } else if (parseOptional(144 /* NamespaceKeyword */)) { 24336 flags |= 16 /* Namespace */; 24337 } else { 24338 parseExpected(143 /* ModuleKeyword */); 24339 if (token() === 10 /* StringLiteral */) { 24340 return parseAmbientExternalModuleDeclaration(pos, hasJSDoc, decorators, modifiers); 24341 } 24342 } 24343 return parseModuleOrNamespaceDeclaration(pos, hasJSDoc, decorators, modifiers, flags); 24344 } 24345 function isExternalModuleReference2() { 24346 return token() === 148 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); 24347 } 24348 function nextTokenIsOpenParen() { 24349 return nextToken() === 20 /* OpenParenToken */; 24350 } 24351 function nextTokenIsOpenBrace() { 24352 return nextToken() === 18 /* OpenBraceToken */; 24353 } 24354 function nextTokenIsSlash() { 24355 return nextToken() === 43 /* SlashToken */; 24356 } 24357 function parseNamespaceExportDeclaration(pos, hasJSDoc, decorators, modifiers) { 24358 parseExpected(129 /* AsKeyword */); 24359 parseExpected(144 /* NamespaceKeyword */); 24360 const name = parseIdentifier(); 24361 parseSemicolon(); 24362 const node = factory2.createNamespaceExportDeclaration(name); 24363 node.illegalDecorators = decorators; 24364 node.modifiers = modifiers; 24365 return withJSDoc(finishNode(node, pos), hasJSDoc); 24366 } 24367 function parseImportDeclarationOrImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers) { 24368 parseExpected(101 /* ImportKeyword */); 24369 const afterImportPos = scanner.getStartPos(); 24370 let identifier; 24371 if (isIdentifier2()) { 24372 identifier = parseIdentifier(); 24373 } 24374 let isTypeOnly = false; 24375 let isLazy = false; 24376 if (token() !== 160 /* FromKeyword */ && (identifier == null ? void 0 : identifier.escapedText) === "type" && (isIdentifier2() || tokenAfterImportDefinitelyProducesImportDeclaration())) { 24377 isTypeOnly = true; 24378 identifier = isIdentifier2() ? parseIdentifier() : void 0; 24379 } else if (isSetLazy(identifier)) { 24380 isLazy = true; 24381 identifier = isIdentifier2() ? parseIdentifier() : void 0; 24382 } 24383 if (identifier && !tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration()) { 24384 return parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly); 24385 } 24386 let importClause; 24387 if (identifier || token() === 41 /* AsteriskToken */ || token() === 18 /* OpenBraceToken */) { 24388 importClause = parseImportClause(identifier, afterImportPos, isTypeOnly); 24389 importClause.isLazy = isLazy; 24390 parseExpected(160 /* FromKeyword */); 24391 } 24392 const moduleSpecifier = parseModuleSpecifier(); 24393 let assertClause; 24394 if (token() === 131 /* AssertKeyword */ && !scanner.hasPrecedingLineBreak()) { 24395 assertClause = parseAssertClause(); 24396 } 24397 parseSemicolon(); 24398 const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause); 24399 node.illegalDecorators = decorators; 24400 return withJSDoc(finishNode(node, pos), hasJSDoc); 24401 } 24402 function isSetLazy(identifier) { 24403 return (identifier == null ? void 0 : identifier.escapedText) === "lazy" && (token() === 18 /* OpenBraceToken */ || isIdentifier2() && lookAhead(() => nextToken() === 160 /* FromKeyword */) || isIdentifier2() && lookAhead(() => nextToken() === 27 /* CommaToken */ && nextToken() === 18 /* OpenBraceToken */)); 24404 } 24405 function parseAssertEntry() { 24406 const pos = getNodePos(); 24407 const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(10 /* StringLiteral */); 24408 parseExpected(58 /* ColonToken */); 24409 const value = parseAssignmentExpressionOrHigher(true); 24410 return finishNode(factory2.createAssertEntry(name, value), pos); 24411 } 24412 function parseAssertClause(skipAssertKeyword) { 24413 const pos = getNodePos(); 24414 if (!skipAssertKeyword) { 24415 parseExpected(131 /* AssertKeyword */); 24416 } 24417 const openBracePosition = scanner.getTokenPos(); 24418 if (parseExpected(18 /* OpenBraceToken */)) { 24419 const multiLine = scanner.hasPrecedingLineBreak(); 24420 const elements = parseDelimitedList(ParsingContext.AssertEntries, parseAssertEntry, true); 24421 if (!parseExpected(19 /* CloseBraceToken */)) { 24422 const lastError = lastOrUndefined(parseDiagnostics); 24423 if (lastError && lastError.code === Diagnostics._0_expected.code) { 24424 addRelatedInfo( 24425 lastError, 24426 createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}") 24427 ); 24428 } 24429 } 24430 return finishNode(factory2.createAssertClause(elements, multiLine), pos); 24431 } else { 24432 const elements = createNodeArray([], getNodePos(), void 0, false); 24433 return finishNode(factory2.createAssertClause(elements, false), pos); 24434 } 24435 } 24436 function tokenAfterImportDefinitelyProducesImportDeclaration() { 24437 return token() === 41 /* AsteriskToken */ || token() === 18 /* OpenBraceToken */; 24438 } 24439 function tokenAfterImportedIdentifierDefinitelyProducesImportDeclaration() { 24440 return token() === 27 /* CommaToken */ || token() === 160 /* FromKeyword */; 24441 } 24442 function parseImportEqualsDeclaration(pos, hasJSDoc, decorators, modifiers, identifier, isTypeOnly) { 24443 parseExpected(63 /* EqualsToken */); 24444 const moduleReference = parseModuleReference(); 24445 parseSemicolon(); 24446 const node = factory2.createImportEqualsDeclaration(modifiers, isTypeOnly, identifier, moduleReference); 24447 node.illegalDecorators = decorators; 24448 const finished = withJSDoc(finishNode(node, pos), hasJSDoc); 24449 return finished; 24450 } 24451 function parseImportClause(identifier, pos, isTypeOnly) { 24452 let namedBindings; 24453 if (!identifier || parseOptional(27 /* CommaToken */)) { 24454 namedBindings = token() === 41 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(278 /* NamedImports */); 24455 } 24456 return finishNode(factory2.createImportClause(isTypeOnly, identifier, namedBindings), pos); 24457 } 24458 function parseModuleReference() { 24459 return isExternalModuleReference2() ? parseExternalModuleReference() : parseEntityName(false); 24460 } 24461 function parseExternalModuleReference() { 24462 const pos = getNodePos(); 24463 parseExpected(148 /* RequireKeyword */); 24464 parseExpected(20 /* OpenParenToken */); 24465 const expression = parseModuleSpecifier(); 24466 parseExpected(21 /* CloseParenToken */); 24467 return finishNode(factory2.createExternalModuleReference(expression), pos); 24468 } 24469 function parseModuleSpecifier() { 24470 if (token() === 10 /* StringLiteral */) { 24471 const result = parseLiteralNode(); 24472 result.text = internIdentifier(result.text); 24473 return result; 24474 } else { 24475 return parseExpression(); 24476 } 24477 } 24478 function parseNamespaceImport() { 24479 const pos = getNodePos(); 24480 parseExpected(41 /* AsteriskToken */); 24481 parseExpected(129 /* AsKeyword */); 24482 const name = parseIdentifier(); 24483 return finishNode(factory2.createNamespaceImport(name), pos); 24484 } 24485 function parseNamedImportsOrExports(kind) { 24486 const pos = getNodePos(); 24487 const node = kind === 278 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseImportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(ParsingContext.ImportOrExportSpecifiers, parseExportSpecifier, 18 /* OpenBraceToken */, 19 /* CloseBraceToken */)); 24488 return finishNode(node, pos); 24489 } 24490 function parseExportSpecifier() { 24491 const hasJSDoc = hasPrecedingJSDocComment(); 24492 return withJSDoc(parseImportOrExportSpecifier(284 /* ExportSpecifier */), hasJSDoc); 24493 } 24494 function parseImportSpecifier() { 24495 return parseImportOrExportSpecifier(279 /* ImportSpecifier */); 24496 } 24497 function parseImportOrExportSpecifier(kind) { 24498 const pos = getNodePos(); 24499 let checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2(); 24500 let checkIdentifierStart = scanner.getTokenPos(); 24501 let checkIdentifierEnd = scanner.getTextPos(); 24502 let isTypeOnly = false; 24503 let propertyName; 24504 let canParseAsKeyword = true; 24505 let name = parseIdentifierName(); 24506 if (name.escapedText === "type") { 24507 if (token() === 129 /* AsKeyword */) { 24508 const firstAs = parseIdentifierName(); 24509 if (token() === 129 /* AsKeyword */) { 24510 const secondAs = parseIdentifierName(); 24511 if (tokenIsIdentifierOrKeyword(token())) { 24512 isTypeOnly = true; 24513 propertyName = firstAs; 24514 name = parseNameWithKeywordCheck(); 24515 canParseAsKeyword = false; 24516 } else { 24517 propertyName = name; 24518 name = secondAs; 24519 canParseAsKeyword = false; 24520 } 24521 } else if (tokenIsIdentifierOrKeyword(token())) { 24522 propertyName = name; 24523 canParseAsKeyword = false; 24524 name = parseNameWithKeywordCheck(); 24525 } else { 24526 isTypeOnly = true; 24527 name = firstAs; 24528 } 24529 } else if (tokenIsIdentifierOrKeyword(token())) { 24530 isTypeOnly = true; 24531 name = parseNameWithKeywordCheck(); 24532 } 24533 } 24534 if (canParseAsKeyword && token() === 129 /* AsKeyword */) { 24535 propertyName = name; 24536 parseExpected(129 /* AsKeyword */); 24537 name = parseNameWithKeywordCheck(); 24538 } 24539 if (kind === 279 /* ImportSpecifier */ && checkIdentifierIsKeyword) { 24540 parseErrorAt(checkIdentifierStart, checkIdentifierEnd, Diagnostics.Identifier_expected); 24541 } 24542 const node = kind === 279 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name); 24543 return finishNode(node, pos); 24544 function parseNameWithKeywordCheck() { 24545 checkIdentifierIsKeyword = isKeyword(token()) && !isIdentifier2(); 24546 checkIdentifierStart = scanner.getTokenPos(); 24547 checkIdentifierEnd = scanner.getTextPos(); 24548 return parseIdentifierName(); 24549 } 24550 } 24551 function parseNamespaceExport(pos) { 24552 return finishNode(factory2.createNamespaceExport(parseIdentifierName()), pos); 24553 } 24554 function parseExportDeclaration(pos, hasJSDoc, decorators, modifiers) { 24555 const savedAwaitContext = inAwaitContext(); 24556 setAwaitContext(true); 24557 let exportClause; 24558 let moduleSpecifier; 24559 let assertClause; 24560 const isTypeOnly = parseOptional(155 /* TypeKeyword */); 24561 const namespaceExportPos = getNodePos(); 24562 if (parseOptional(41 /* AsteriskToken */)) { 24563 if (parseOptional(129 /* AsKeyword */)) { 24564 exportClause = parseNamespaceExport(namespaceExportPos); 24565 } 24566 parseExpected(160 /* FromKeyword */); 24567 moduleSpecifier = parseModuleSpecifier(); 24568 } else { 24569 exportClause = parseNamedImportsOrExports(282 /* NamedExports */); 24570 if (token() === 160 /* FromKeyword */ || token() === 10 /* StringLiteral */ && !scanner.hasPrecedingLineBreak()) { 24571 parseExpected(160 /* FromKeyword */); 24572 moduleSpecifier = parseModuleSpecifier(); 24573 } 24574 } 24575 if (moduleSpecifier && token() === 131 /* AssertKeyword */ && !scanner.hasPrecedingLineBreak()) { 24576 assertClause = parseAssertClause(); 24577 } 24578 parseSemicolon(); 24579 setAwaitContext(savedAwaitContext); 24580 const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); 24581 node.illegalDecorators = decorators; 24582 return withJSDoc(finishNode(node, pos), hasJSDoc); 24583 } 24584 function parseExportAssignment(pos, hasJSDoc, decorators, modifiers) { 24585 const savedAwaitContext = inAwaitContext(); 24586 setAwaitContext(true); 24587 let isExportEquals; 24588 if (parseOptional(63 /* EqualsToken */)) { 24589 isExportEquals = true; 24590 } else { 24591 parseExpected(89 /* DefaultKeyword */); 24592 } 24593 const expression = parseAssignmentExpressionOrHigher(true); 24594 parseSemicolon(); 24595 setAwaitContext(savedAwaitContext); 24596 const node = factory2.createExportAssignment(modifiers, isExportEquals, expression); 24597 node.illegalDecorators = decorators; 24598 return withJSDoc(finishNode(node, pos), hasJSDoc); 24599 } 24600 let ParsingContext; 24601 ((ParsingContext2) => { 24602 ParsingContext2[ParsingContext2["SourceElements"] = 0] = "SourceElements"; 24603 ParsingContext2[ParsingContext2["BlockStatements"] = 1] = "BlockStatements"; 24604 ParsingContext2[ParsingContext2["SwitchClauses"] = 2] = "SwitchClauses"; 24605 ParsingContext2[ParsingContext2["SwitchClauseStatements"] = 3] = "SwitchClauseStatements"; 24606 ParsingContext2[ParsingContext2["TypeMembers"] = 4] = "TypeMembers"; 24607 ParsingContext2[ParsingContext2["ClassMembers"] = 5] = "ClassMembers"; 24608 ParsingContext2[ParsingContext2["AnnotationMembers"] = 6] = "AnnotationMembers"; 24609 ParsingContext2[ParsingContext2["EnumMembers"] = 7] = "EnumMembers"; 24610 ParsingContext2[ParsingContext2["HeritageClauseElement"] = 8] = "HeritageClauseElement"; 24611 ParsingContext2[ParsingContext2["VariableDeclarations"] = 9] = "VariableDeclarations"; 24612 ParsingContext2[ParsingContext2["ObjectBindingElements"] = 10] = "ObjectBindingElements"; 24613 ParsingContext2[ParsingContext2["ArrayBindingElements"] = 11] = "ArrayBindingElements"; 24614 ParsingContext2[ParsingContext2["ArgumentExpressions"] = 12] = "ArgumentExpressions"; 24615 ParsingContext2[ParsingContext2["ObjectLiteralMembers"] = 13] = "ObjectLiteralMembers"; 24616 ParsingContext2[ParsingContext2["JsxAttributes"] = 14] = "JsxAttributes"; 24617 ParsingContext2[ParsingContext2["JsxChildren"] = 15] = "JsxChildren"; 24618 ParsingContext2[ParsingContext2["ArrayLiteralMembers"] = 16] = "ArrayLiteralMembers"; 24619 ParsingContext2[ParsingContext2["Parameters"] = 17] = "Parameters"; 24620 ParsingContext2[ParsingContext2["JSDocParameters"] = 18] = "JSDocParameters"; 24621 ParsingContext2[ParsingContext2["RestProperties"] = 19] = "RestProperties"; 24622 ParsingContext2[ParsingContext2["TypeParameters"] = 20] = "TypeParameters"; 24623 ParsingContext2[ParsingContext2["TypeArguments"] = 21] = "TypeArguments"; 24624 ParsingContext2[ParsingContext2["TupleElementTypes"] = 22] = "TupleElementTypes"; 24625 ParsingContext2[ParsingContext2["HeritageClauses"] = 23] = "HeritageClauses"; 24626 ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 24] = "ImportOrExportSpecifiers"; 24627 ParsingContext2[ParsingContext2["AssertEntries"] = 25] = "AssertEntries"; 24628 ParsingContext2[ParsingContext2["Count"] = 26] = "Count"; 24629 })(ParsingContext || (ParsingContext = {})); 24630 let Tristate; 24631 ((Tristate2) => { 24632 Tristate2[Tristate2["False"] = 0] = "False"; 24633 Tristate2[Tristate2["True"] = 1] = "True"; 24634 Tristate2[Tristate2["Unknown"] = 2] = "Unknown"; 24635 })(Tristate || (Tristate = {})); 24636 let JSDocParser; 24637 ((JSDocParser2) => { 24638 function parseJSDocTypeExpressionForTests(content, start, length2) { 24639 initializeState("file.js", content, 99 /* Latest */, void 0, 1 /* JS */); 24640 scanner.setText(content, start, length2); 24641 currentToken = scanner.scan(); 24642 const jsDocTypeExpression = parseJSDocTypeExpression(); 24643 const sourceFile = createSourceFile2("file.js", 99 /* Latest */, 1 /* JS */, false, [], factory2.createToken(1 /* EndOfFileToken */), 0 /* None */, noop); 24644 const diagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile); 24645 if (jsDocDiagnostics) { 24646 sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile); 24647 } 24648 clearState(); 24649 return jsDocTypeExpression ? { jsDocTypeExpression, diagnostics } : void 0; 24650 } 24651 JSDocParser2.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; 24652 function parseJSDocTypeExpression(mayOmitBraces) { 24653 const pos = getNodePos(); 24654 const hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(18 /* OpenBraceToken */); 24655 const type = doInsideOfContext(8388608 /* JSDoc */, parseJSDocType); 24656 if (!mayOmitBraces || hasBrace) { 24657 parseExpectedJSDoc(19 /* CloseBraceToken */); 24658 } 24659 const result = factory2.createJSDocTypeExpression(type); 24660 fixupParentReferences(result); 24661 return finishNode(result, pos); 24662 } 24663 JSDocParser2.parseJSDocTypeExpression = parseJSDocTypeExpression; 24664 function parseJSDocNameReference() { 24665 const pos = getNodePos(); 24666 const hasBrace = parseOptional(18 /* OpenBraceToken */); 24667 const p2 = getNodePos(); 24668 let entityName = parseEntityName(false); 24669 while (token() === 80 /* PrivateIdentifier */) { 24670 reScanHashToken(); 24671 nextTokenJSDoc(); 24672 entityName = finishNode(factory2.createJSDocMemberName(entityName, parseIdentifier()), p2); 24673 } 24674 if (hasBrace) { 24675 parseExpectedJSDoc(19 /* CloseBraceToken */); 24676 } 24677 const result = factory2.createJSDocNameReference(entityName); 24678 fixupParentReferences(result); 24679 return finishNode(result, pos); 24680 } 24681 JSDocParser2.parseJSDocNameReference = parseJSDocNameReference; 24682 function parseIsolatedJSDocComment(content, start, length2) { 24683 initializeState("", content, 99 /* Latest */, void 0, 1 /* JS */); 24684 const jsDoc = doInsideOfContext(8388608 /* JSDoc */, () => parseJSDocCommentWorker(start, length2)); 24685 const sourceFile = { languageVariant: 0 /* Standard */, text: content }; 24686 const diagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile); 24687 clearState(); 24688 return jsDoc ? { jsDoc, diagnostics } : void 0; 24689 } 24690 JSDocParser2.parseIsolatedJSDocComment = parseIsolatedJSDocComment; 24691 function parseJSDocComment(parent, start, length2) { 24692 const saveToken = currentToken; 24693 const saveParseDiagnosticsLength = parseDiagnostics.length; 24694 const saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; 24695 const comment = doInsideOfContext(8388608 /* JSDoc */, () => parseJSDocCommentWorker(start, length2)); 24696 setParent(comment, parent); 24697 if (contextFlags & 262144 /* JavaScriptFile */) { 24698 if (!jsDocDiagnostics) { 24699 jsDocDiagnostics = []; 24700 } 24701 jsDocDiagnostics.push(...parseDiagnostics); 24702 } 24703 currentToken = saveToken; 24704 parseDiagnostics.length = saveParseDiagnosticsLength; 24705 parseErrorBeforeNextFinishedNode = saveParseErrorBeforeNextFinishedNode; 24706 return comment; 24707 } 24708 JSDocParser2.parseJSDocComment = parseJSDocComment; 24709 let JSDocState; 24710 ((JSDocState2) => { 24711 JSDocState2[JSDocState2["BeginningOfLine"] = 0] = "BeginningOfLine"; 24712 JSDocState2[JSDocState2["SawAsterisk"] = 1] = "SawAsterisk"; 24713 JSDocState2[JSDocState2["SavingComments"] = 2] = "SavingComments"; 24714 JSDocState2[JSDocState2["SavingBackticks"] = 3] = "SavingBackticks"; 24715 })(JSDocState || (JSDocState = {})); 24716 let PropertyLikeParse; 24717 ((PropertyLikeParse2) => { 24718 PropertyLikeParse2[PropertyLikeParse2["Property"] = 1] = "Property"; 24719 PropertyLikeParse2[PropertyLikeParse2["Parameter"] = 2] = "Parameter"; 24720 PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter"; 24721 })(PropertyLikeParse || (PropertyLikeParse = {})); 24722 function parseJSDocCommentWorker(start = 0, length2) { 24723 const content = sourceText; 24724 const end = length2 === void 0 ? content.length : start + length2; 24725 length2 = end - start; 24726 Debug.assert(start >= 0); 24727 Debug.assert(start <= end); 24728 Debug.assert(end <= content.length); 24729 if (!isJSDocLikeText(content, start)) { 24730 return void 0; 24731 } 24732 let tags; 24733 let tagsPos; 24734 let tagsEnd; 24735 let linkEnd; 24736 let commentsPos; 24737 let comments = []; 24738 const parts = []; 24739 return scanner.scanRange(start + 3, length2 - 5, () => { 24740 let state = 1 /* SawAsterisk */; 24741 let margin; 24742 let indent2 = start - (content.lastIndexOf("\n", start) + 1) + 4; 24743 function pushComment(text) { 24744 if (!margin) { 24745 margin = indent2; 24746 } 24747 comments.push(text); 24748 indent2 += text.length; 24749 } 24750 nextTokenJSDoc(); 24751 while (parseOptionalJsdoc(5 /* WhitespaceTrivia */)) 24752 ; 24753 if (parseOptionalJsdoc(4 /* NewLineTrivia */)) { 24754 state = 0 /* BeginningOfLine */; 24755 indent2 = 0; 24756 } 24757 loop: 24758 while (true) { 24759 switch (token()) { 24760 case 59 /* AtToken */: 24761 if (state === 0 /* BeginningOfLine */ || state === 1 /* SawAsterisk */) { 24762 removeTrailingWhitespace(comments); 24763 if (!commentsPos) 24764 commentsPos = getNodePos(); 24765 addTag(parseTag(indent2)); 24766 state = 0 /* BeginningOfLine */; 24767 margin = void 0; 24768 } else { 24769 pushComment(scanner.getTokenText()); 24770 } 24771 break; 24772 case 4 /* NewLineTrivia */: 24773 comments.push(scanner.getTokenText()); 24774 state = 0 /* BeginningOfLine */; 24775 indent2 = 0; 24776 break; 24777 case 41 /* AsteriskToken */: 24778 const asterisk = scanner.getTokenText(); 24779 if (state === 1 /* SawAsterisk */ || state === 2 /* SavingComments */) { 24780 state = 2 /* SavingComments */; 24781 pushComment(asterisk); 24782 } else { 24783 state = 1 /* SawAsterisk */; 24784 indent2 += asterisk.length; 24785 } 24786 break; 24787 case 5 /* WhitespaceTrivia */: 24788 const whitespace = scanner.getTokenText(); 24789 if (state === 2 /* SavingComments */) { 24790 comments.push(whitespace); 24791 } else if (margin !== void 0 && indent2 + whitespace.length > margin) { 24792 comments.push(whitespace.slice(margin - indent2)); 24793 } 24794 indent2 += whitespace.length; 24795 break; 24796 case 1 /* EndOfFileToken */: 24797 break loop; 24798 case 18 /* OpenBraceToken */: 24799 state = 2 /* SavingComments */; 24800 const commentEnd = scanner.getStartPos(); 24801 const linkStart = scanner.getTextPos() - 1; 24802 const link = parseJSDocLink(linkStart); 24803 if (link) { 24804 if (!linkEnd) { 24805 removeLeadingNewlines(comments); 24806 } 24807 parts.push(finishNode(factory2.createJSDocText(comments.join("")), linkEnd != null ? linkEnd : start, commentEnd)); 24808 parts.push(link); 24809 comments = []; 24810 linkEnd = scanner.getTextPos(); 24811 break; 24812 } 24813 default: 24814 state = 2 /* SavingComments */; 24815 pushComment(scanner.getTokenText()); 24816 break; 24817 } 24818 nextTokenJSDoc(); 24819 } 24820 removeTrailingWhitespace(comments); 24821 if (parts.length && comments.length) { 24822 parts.push(finishNode(factory2.createJSDocText(comments.join("")), linkEnd != null ? linkEnd : start, commentsPos)); 24823 } 24824 if (parts.length && tags) 24825 Debug.assertIsDefined(commentsPos, "having parsed tags implies that the end of the comment span should be set"); 24826 const tagsArray = tags && createNodeArray(tags, tagsPos, tagsEnd); 24827 return finishNode(factory2.createJSDocComment(parts.length ? createNodeArray(parts, start, commentsPos) : comments.length ? comments.join("") : void 0, tagsArray), start, end); 24828 }); 24829 function removeLeadingNewlines(comments2) { 24830 while (comments2.length && (comments2[0] === "\n" || comments2[0] === "\r")) { 24831 comments2.shift(); 24832 } 24833 } 24834 function removeTrailingWhitespace(comments2) { 24835 while (comments2.length && comments2[comments2.length - 1].trim() === "") { 24836 comments2.pop(); 24837 } 24838 } 24839 function isNextNonwhitespaceTokenEndOfFile() { 24840 while (true) { 24841 nextTokenJSDoc(); 24842 if (token() === 1 /* EndOfFileToken */) { 24843 return true; 24844 } 24845 if (!(token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */)) { 24846 return false; 24847 } 24848 } 24849 } 24850 function skipWhitespace() { 24851 if (token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */) { 24852 if (lookAhead(isNextNonwhitespaceTokenEndOfFile)) { 24853 return; 24854 } 24855 } 24856 while (token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */) { 24857 nextTokenJSDoc(); 24858 } 24859 } 24860 function skipWhitespaceOrAsterisk() { 24861 if (token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */) { 24862 if (lookAhead(isNextNonwhitespaceTokenEndOfFile)) { 24863 return ""; 24864 } 24865 } 24866 let precedingLineBreak = scanner.hasPrecedingLineBreak(); 24867 let seenLineBreak = false; 24868 let indentText = ""; 24869 while (precedingLineBreak && token() === 41 /* AsteriskToken */ || token() === 5 /* WhitespaceTrivia */ || token() === 4 /* NewLineTrivia */) { 24870 indentText += scanner.getTokenText(); 24871 if (token() === 4 /* NewLineTrivia */) { 24872 precedingLineBreak = true; 24873 seenLineBreak = true; 24874 indentText = ""; 24875 } else if (token() === 41 /* AsteriskToken */) { 24876 precedingLineBreak = false; 24877 } 24878 nextTokenJSDoc(); 24879 } 24880 return seenLineBreak ? indentText : ""; 24881 } 24882 function parseTag(margin) { 24883 Debug.assert(token() === 59 /* AtToken */); 24884 const start2 = scanner.getTokenPos(); 24885 nextTokenJSDoc(); 24886 const tagName = parseJSDocIdentifierName(void 0); 24887 const indentText = skipWhitespaceOrAsterisk(); 24888 let tag; 24889 switch (tagName.escapedText) { 24890 case "author": 24891 tag = parseAuthorTag(start2, tagName, margin, indentText); 24892 break; 24893 case "implements": 24894 tag = parseImplementsTag(start2, tagName, margin, indentText); 24895 break; 24896 case "augments": 24897 case "extends": 24898 tag = parseAugmentsTag(start2, tagName, margin, indentText); 24899 break; 24900 case "class": 24901 case "constructor": 24902 tag = parseSimpleTag(start2, factory2.createJSDocClassTag, tagName, margin, indentText); 24903 break; 24904 case "public": 24905 tag = parseSimpleTag(start2, factory2.createJSDocPublicTag, tagName, margin, indentText); 24906 break; 24907 case "private": 24908 tag = parseSimpleTag(start2, factory2.createJSDocPrivateTag, tagName, margin, indentText); 24909 break; 24910 case "protected": 24911 tag = parseSimpleTag(start2, factory2.createJSDocProtectedTag, tagName, margin, indentText); 24912 break; 24913 case "readonly": 24914 tag = parseSimpleTag(start2, factory2.createJSDocReadonlyTag, tagName, margin, indentText); 24915 break; 24916 case "override": 24917 tag = parseSimpleTag(start2, factory2.createJSDocOverrideTag, tagName, margin, indentText); 24918 break; 24919 case "deprecated": 24920 hasDeprecatedTag = true; 24921 tag = parseSimpleTag(start2, factory2.createJSDocDeprecatedTag, tagName, margin, indentText); 24922 break; 24923 case "this": 24924 tag = parseThisTag(start2, tagName, margin, indentText); 24925 break; 24926 case "enum": 24927 tag = parseEnumTag(start2, tagName, margin, indentText); 24928 break; 24929 case "arg": 24930 case "argument": 24931 case "param": 24932 return parseParameterOrPropertyTag(start2, tagName, 2 /* Parameter */, margin); 24933 case "return": 24934 case "returns": 24935 tag = parseReturnTag(start2, tagName, margin, indentText); 24936 break; 24937 case "template": 24938 tag = parseTemplateTag(start2, tagName, margin, indentText); 24939 break; 24940 case "type": 24941 tag = parseTypeTag(start2, tagName, margin, indentText); 24942 break; 24943 case "typedef": 24944 tag = parseTypedefTag(start2, tagName, margin, indentText); 24945 break; 24946 case "callback": 24947 tag = parseCallbackTag(start2, tagName, margin, indentText); 24948 break; 24949 case "see": 24950 tag = parseSeeTag(start2, tagName, margin, indentText); 24951 break; 24952 default: 24953 tag = parseUnknownTag(start2, tagName, margin, indentText); 24954 break; 24955 } 24956 return tag; 24957 } 24958 function parseTrailingTagComments(pos, end2, margin, indentText) { 24959 if (!indentText) { 24960 margin += end2 - pos; 24961 } 24962 return parseTagComments(margin, indentText.slice(margin)); 24963 } 24964 function parseTagComments(indent2, initialMargin) { 24965 const commentsPos2 = getNodePos(); 24966 let comments2 = []; 24967 const parts2 = []; 24968 let linkEnd2; 24969 let state = 0 /* BeginningOfLine */; 24970 let previousWhitespace = true; 24971 let margin; 24972 function pushComment(text) { 24973 if (!margin) { 24974 margin = indent2; 24975 } 24976 comments2.push(text); 24977 indent2 += text.length; 24978 } 24979 if (initialMargin !== void 0) { 24980 if (initialMargin !== "") { 24981 pushComment(initialMargin); 24982 } 24983 state = 1 /* SawAsterisk */; 24984 } 24985 let tok = token(); 24986 loop: 24987 while (true) { 24988 switch (tok) { 24989 case 4 /* NewLineTrivia */: 24990 state = 0 /* BeginningOfLine */; 24991 comments2.push(scanner.getTokenText()); 24992 indent2 = 0; 24993 break; 24994 case 59 /* AtToken */: 24995 if (state === 3 /* SavingBackticks */ || state === 2 /* SavingComments */ && (!previousWhitespace || lookAhead(isNextJSDocTokenWhitespace))) { 24996 comments2.push(scanner.getTokenText()); 24997 break; 24998 } 24999 scanner.setTextPos(scanner.getTextPos() - 1); 25000 case 1 /* EndOfFileToken */: 25001 break loop; 25002 case 5 /* WhitespaceTrivia */: 25003 if (state === 2 /* SavingComments */ || state === 3 /* SavingBackticks */) { 25004 pushComment(scanner.getTokenText()); 25005 } else { 25006 const whitespace = scanner.getTokenText(); 25007 if (margin !== void 0 && indent2 + whitespace.length > margin) { 25008 comments2.push(whitespace.slice(margin - indent2)); 25009 } 25010 indent2 += whitespace.length; 25011 } 25012 break; 25013 case 18 /* OpenBraceToken */: 25014 state = 2 /* SavingComments */; 25015 const commentEnd = scanner.getStartPos(); 25016 const linkStart = scanner.getTextPos() - 1; 25017 const link = parseJSDocLink(linkStart); 25018 if (link) { 25019 parts2.push(finishNode(factory2.createJSDocText(comments2.join("")), linkEnd2 != null ? linkEnd2 : commentsPos2, commentEnd)); 25020 parts2.push(link); 25021 comments2 = []; 25022 linkEnd2 = scanner.getTextPos(); 25023 } else { 25024 pushComment(scanner.getTokenText()); 25025 } 25026 break; 25027 case 61 /* BacktickToken */: 25028 if (state === 3 /* SavingBackticks */) { 25029 state = 2 /* SavingComments */; 25030 } else { 25031 state = 3 /* SavingBackticks */; 25032 } 25033 pushComment(scanner.getTokenText()); 25034 break; 25035 case 41 /* AsteriskToken */: 25036 if (state === 0 /* BeginningOfLine */) { 25037 state = 1 /* SawAsterisk */; 25038 indent2 += 1; 25039 break; 25040 } 25041 default: 25042 if (state !== 3 /* SavingBackticks */) { 25043 state = 2 /* SavingComments */; 25044 } 25045 pushComment(scanner.getTokenText()); 25046 break; 25047 } 25048 previousWhitespace = token() === 5 /* WhitespaceTrivia */; 25049 tok = nextTokenJSDoc(); 25050 } 25051 removeLeadingNewlines(comments2); 25052 removeTrailingWhitespace(comments2); 25053 if (parts2.length) { 25054 if (comments2.length) { 25055 parts2.push(finishNode(factory2.createJSDocText(comments2.join("")), linkEnd2 != null ? linkEnd2 : commentsPos2)); 25056 } 25057 return createNodeArray(parts2, commentsPos2, scanner.getTextPos()); 25058 } else if (comments2.length) { 25059 return comments2.join(""); 25060 } 25061 } 25062 function isNextJSDocTokenWhitespace() { 25063 const next = nextTokenJSDoc(); 25064 return next === 5 /* WhitespaceTrivia */ || next === 4 /* NewLineTrivia */; 25065 } 25066 function parseJSDocLink(start2) { 25067 const linkType = tryParse(parseJSDocLinkPrefix); 25068 if (!linkType) { 25069 return void 0; 25070 } 25071 nextTokenJSDoc(); 25072 skipWhitespace(); 25073 const p2 = getNodePos(); 25074 let name = tokenIsIdentifierOrKeyword(token()) ? parseEntityName(true) : void 0; 25075 if (name) { 25076 while (token() === 80 /* PrivateIdentifier */) { 25077 reScanHashToken(); 25078 nextTokenJSDoc(); 25079 name = finishNode(factory2.createJSDocMemberName(name, parseIdentifier()), p2); 25080 } 25081 } 25082 const text = []; 25083 while (token() !== 19 /* CloseBraceToken */ && token() !== 4 /* NewLineTrivia */ && token() !== 1 /* EndOfFileToken */) { 25084 text.push(scanner.getTokenText()); 25085 nextTokenJSDoc(); 25086 } 25087 const create = linkType === "link" ? factory2.createJSDocLink : linkType === "linkcode" ? factory2.createJSDocLinkCode : factory2.createJSDocLinkPlain; 25088 return finishNode(create(name, text.join("")), start2, scanner.getTextPos()); 25089 } 25090 function parseJSDocLinkPrefix() { 25091 skipWhitespaceOrAsterisk(); 25092 if (token() === 18 /* OpenBraceToken */ && nextTokenJSDoc() === 59 /* AtToken */ && tokenIsIdentifierOrKeyword(nextTokenJSDoc())) { 25093 const kind = scanner.getTokenValue(); 25094 if (isJSDocLinkTag(kind)) 25095 return kind; 25096 } 25097 } 25098 function isJSDocLinkTag(kind) { 25099 return kind === "link" || kind === "linkcode" || kind === "linkplain"; 25100 } 25101 function parseUnknownTag(start2, tagName, indent2, indentText) { 25102 return finishNode(factory2.createJSDocUnknownTag(tagName, parseTrailingTagComments(start2, getNodePos(), indent2, indentText)), start2); 25103 } 25104 function addTag(tag) { 25105 if (!tag) { 25106 return; 25107 } 25108 if (!tags) { 25109 tags = [tag]; 25110 tagsPos = tag.pos; 25111 } else { 25112 tags.push(tag); 25113 } 25114 tagsEnd = tag.end; 25115 } 25116 function tryParseTypeExpression() { 25117 skipWhitespaceOrAsterisk(); 25118 return token() === 18 /* OpenBraceToken */ ? parseJSDocTypeExpression() : void 0; 25119 } 25120 function parseBracketNameInPropertyAndParamTag() { 25121 const isBracketed = parseOptionalJsdoc(22 /* OpenBracketToken */); 25122 if (isBracketed) { 25123 skipWhitespace(); 25124 } 25125 const isBackquoted = parseOptionalJsdoc(61 /* BacktickToken */); 25126 const name = parseJSDocEntityName(); 25127 if (isBackquoted) { 25128 parseExpectedTokenJSDoc(61 /* BacktickToken */); 25129 } 25130 if (isBracketed) { 25131 skipWhitespace(); 25132 if (parseOptionalToken(63 /* EqualsToken */)) { 25133 parseExpression(); 25134 } 25135 parseExpected(23 /* CloseBracketToken */); 25136 } 25137 return { name, isBracketed }; 25138 } 25139 function isObjectOrObjectArrayTypeReference(node) { 25140 switch (node.kind) { 25141 case 150 /* ObjectKeyword */: 25142 return true; 25143 case 188 /* ArrayType */: 25144 return isObjectOrObjectArrayTypeReference(node.elementType); 25145 default: 25146 return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments; 25147 } 25148 } 25149 function parseParameterOrPropertyTag(start2, tagName, target, indent2) { 25150 let typeExpression = tryParseTypeExpression(); 25151 let isNameFirst = !typeExpression; 25152 skipWhitespaceOrAsterisk(); 25153 const { name, isBracketed } = parseBracketNameInPropertyAndParamTag(); 25154 const indentText = skipWhitespaceOrAsterisk(); 25155 if (isNameFirst && !lookAhead(parseJSDocLinkPrefix)) { 25156 typeExpression = tryParseTypeExpression(); 25157 } 25158 const comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText); 25159 const nestedTypeLiteral = target !== 4 /* CallbackParameter */ && parseNestedTypeLiteral(typeExpression, name, target, indent2); 25160 if (nestedTypeLiteral) { 25161 typeExpression = nestedTypeLiteral; 25162 isNameFirst = true; 25163 } 25164 const result = target === 1 /* Property */ ? factory2.createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) : factory2.createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment); 25165 return finishNode(result, start2); 25166 } 25167 function parseNestedTypeLiteral(typeExpression, name, target, indent2) { 25168 if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { 25169 const pos = getNodePos(); 25170 let child; 25171 let children; 25172 while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent2, name))) { 25173 if (child.kind === 349 /* JSDocParameterTag */ || child.kind === 356 /* JSDocPropertyTag */) { 25174 children = append(children, child); 25175 } 25176 } 25177 if (children) { 25178 const literal = finishNode(factory2.createJSDocTypeLiteral(children, typeExpression.type.kind === 188 /* ArrayType */), pos); 25179 return finishNode(factory2.createJSDocTypeExpression(literal), pos); 25180 } 25181 } 25182 } 25183 function parseReturnTag(start2, tagName, indent2, indentText) { 25184 if (some(tags, isJSDocReturnTag)) { 25185 parseErrorAt(tagName.pos, scanner.getTokenPos(), Diagnostics._0_tag_already_specified, tagName.escapedText); 25186 } 25187 const typeExpression = tryParseTypeExpression(); 25188 return finishNode(factory2.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), indent2, indentText)), start2); 25189 } 25190 function parseTypeTag(start2, tagName, indent2, indentText) { 25191 if (some(tags, isJSDocTypeTag)) { 25192 parseErrorAt(tagName.pos, scanner.getTokenPos(), Diagnostics._0_tag_already_specified, tagName.escapedText); 25193 } 25194 const typeExpression = parseJSDocTypeExpression(true); 25195 const comments2 = indent2 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent2, indentText) : void 0; 25196 return finishNode(factory2.createJSDocTypeTag(tagName, typeExpression, comments2), start2); 25197 } 25198 function parseSeeTag(start2, tagName, indent2, indentText) { 25199 const isMarkdownOrJSDocLink = token() === 22 /* OpenBracketToken */ || lookAhead(() => nextTokenJSDoc() === 59 /* AtToken */ && tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && isJSDocLinkTag(scanner.getTokenValue())); 25200 const nameExpression = isMarkdownOrJSDocLink ? void 0 : parseJSDocNameReference(); 25201 const comments2 = indent2 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent2, indentText) : void 0; 25202 return finishNode(factory2.createJSDocSeeTag(tagName, nameExpression, comments2), start2); 25203 } 25204 function parseAuthorTag(start2, tagName, indent2, indentText) { 25205 const commentStart = getNodePos(); 25206 const textOnly = parseAuthorNameAndEmail(); 25207 let commentEnd = scanner.getStartPos(); 25208 const comments2 = parseTrailingTagComments(start2, commentEnd, indent2, indentText); 25209 if (!comments2) { 25210 commentEnd = scanner.getStartPos(); 25211 } 25212 const allParts = typeof comments2 !== "string" ? createNodeArray(concatenate([finishNode(textOnly, commentStart, commentEnd)], comments2), commentStart) : textOnly.text + comments2; 25213 return finishNode(factory2.createJSDocAuthorTag(tagName, allParts), start2); 25214 } 25215 function parseAuthorNameAndEmail() { 25216 const comments2 = []; 25217 let inEmail = false; 25218 let token2 = scanner.getToken(); 25219 while (token2 !== 1 /* EndOfFileToken */ && token2 !== 4 /* NewLineTrivia */) { 25220 if (token2 === 29 /* LessThanToken */) { 25221 inEmail = true; 25222 } else if (token2 === 59 /* AtToken */ && !inEmail) { 25223 break; 25224 } else if (token2 === 31 /* GreaterThanToken */ && inEmail) { 25225 comments2.push(scanner.getTokenText()); 25226 scanner.setTextPos(scanner.getTokenPos() + 1); 25227 break; 25228 } 25229 comments2.push(scanner.getTokenText()); 25230 token2 = nextTokenJSDoc(); 25231 } 25232 return factory2.createJSDocText(comments2.join("")); 25233 } 25234 function parseImplementsTag(start2, tagName, margin, indentText) { 25235 const className = parseExpressionWithTypeArgumentsForAugments(); 25236 return finishNode(factory2.createJSDocImplementsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); 25237 } 25238 function parseAugmentsTag(start2, tagName, margin, indentText) { 25239 const className = parseExpressionWithTypeArgumentsForAugments(); 25240 return finishNode(factory2.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); 25241 } 25242 function parseExpressionWithTypeArgumentsForAugments() { 25243 const usedBrace = parseOptional(18 /* OpenBraceToken */); 25244 const pos = getNodePos(); 25245 const expression = parsePropertyAccessEntityNameExpression(); 25246 const typeArguments = tryParseTypeArguments(); 25247 const node = factory2.createExpressionWithTypeArguments(expression, typeArguments); 25248 const res = finishNode(node, pos); 25249 if (usedBrace) { 25250 parseExpected(19 /* CloseBraceToken */); 25251 } 25252 return res; 25253 } 25254 function parsePropertyAccessEntityNameExpression() { 25255 const pos = getNodePos(); 25256 let node = parseJSDocIdentifierName(); 25257 while (parseOptional(24 /* DotToken */)) { 25258 const name = parseJSDocIdentifierName(); 25259 node = finishNode(factory2.createPropertyAccessExpression(node, name), pos); 25260 } 25261 return node; 25262 } 25263 function parseSimpleTag(start2, createTag, tagName, margin, indentText) { 25264 return finishNode(createTag(tagName, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); 25265 } 25266 function parseThisTag(start2, tagName, margin, indentText) { 25267 const typeExpression = parseJSDocTypeExpression(true); 25268 skipWhitespace(); 25269 return finishNode(factory2.createJSDocThisTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); 25270 } 25271 function parseEnumTag(start2, tagName, margin, indentText) { 25272 const typeExpression = parseJSDocTypeExpression(true); 25273 skipWhitespace(); 25274 return finishNode(factory2.createJSDocEnumTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2); 25275 } 25276 function parseTypedefTag(start2, tagName, indent2, indentText) { 25277 var _a2; 25278 let typeExpression = tryParseTypeExpression(); 25279 skipWhitespaceOrAsterisk(); 25280 const fullName = parseJSDocTypeNameWithNamespace(); 25281 skipWhitespace(); 25282 let comment = parseTagComments(indent2); 25283 let end2; 25284 if (!typeExpression || isObjectOrObjectArrayTypeReference(typeExpression.type)) { 25285 let child; 25286 let childTypeTag; 25287 let jsDocPropertyTags; 25288 let hasChildren = false; 25289 while (child = tryParse(() => parseChildPropertyTag(indent2))) { 25290 hasChildren = true; 25291 if (child.kind === 352 /* JSDocTypeTag */) { 25292 if (childTypeTag) { 25293 const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags); 25294 if (lastError) { 25295 addRelatedInfo(lastError, createDetachedDiagnostic(fileName, 0, 0, Diagnostics.The_tag_was_first_specified_here)); 25296 } 25297 break; 25298 } else { 25299 childTypeTag = child; 25300 } 25301 } else { 25302 jsDocPropertyTags = append(jsDocPropertyTags, child); 25303 } 25304 } 25305 if (hasChildren) { 25306 const isArrayType = typeExpression && typeExpression.type.kind === 188 /* ArrayType */; 25307 const jsdocTypeLiteral = factory2.createJSDocTypeLiteral(jsDocPropertyTags, isArrayType); 25308 typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : finishNode(jsdocTypeLiteral, start2); 25309 end2 = typeExpression.end; 25310 } 25311 } 25312 end2 = end2 || comment !== void 0 ? getNodePos() : ((_a2 = fullName != null ? fullName : typeExpression) != null ? _a2 : tagName).end; 25313 if (!comment) { 25314 comment = parseTrailingTagComments(start2, end2, indent2, indentText); 25315 } 25316 const typedefTag = factory2.createJSDocTypedefTag(tagName, typeExpression, fullName, comment); 25317 return finishNode(typedefTag, start2, end2); 25318 } 25319 function parseJSDocTypeNameWithNamespace(nested) { 25320 const pos = scanner.getTokenPos(); 25321 if (!tokenIsIdentifierOrKeyword(token())) { 25322 return void 0; 25323 } 25324 const typeNameOrNamespaceName = parseJSDocIdentifierName(); 25325 if (parseOptional(24 /* DotToken */)) { 25326 const body = parseJSDocTypeNameWithNamespace(true); 25327 const jsDocNamespaceNode = factory2.createModuleDeclaration( 25328 void 0, 25329 typeNameOrNamespaceName, 25330 body, 25331 nested ? 4 /* NestedNamespace */ : void 0 25332 ); 25333 return finishNode(jsDocNamespaceNode, pos); 25334 } 25335 if (nested) { 25336 typeNameOrNamespaceName.isInJSDocNamespace = true; 25337 } 25338 return typeNameOrNamespaceName; 25339 } 25340 function parseCallbackTagParameters(indent2) { 25341 const pos = getNodePos(); 25342 let child; 25343 let parameters; 25344 while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent2))) { 25345 parameters = append(parameters, child); 25346 } 25347 return createNodeArray(parameters || [], pos); 25348 } 25349 function parseCallbackTag(start2, tagName, indent2, indentText) { 25350 const fullName = parseJSDocTypeNameWithNamespace(); 25351 skipWhitespace(); 25352 let comment = parseTagComments(indent2); 25353 const parameters = parseCallbackTagParameters(indent2); 25354 const returnTag = tryParse(() => { 25355 if (parseOptionalJsdoc(59 /* AtToken */)) { 25356 const tag = parseTag(indent2); 25357 if (tag && tag.kind === 350 /* JSDocReturnTag */) { 25358 return tag; 25359 } 25360 } 25361 }); 25362 const typeExpression = finishNode(factory2.createJSDocSignature(void 0, parameters, returnTag), start2); 25363 if (!comment) { 25364 comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText); 25365 } 25366 const end2 = comment !== void 0 ? getNodePos() : typeExpression.end; 25367 return finishNode(factory2.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start2, end2); 25368 } 25369 function escapedTextsEqual(a, b) { 25370 while (!isIdentifier(a) || !isIdentifier(b)) { 25371 if (!isIdentifier(a) && !isIdentifier(b) && a.right.escapedText === b.right.escapedText) { 25372 a = a.left; 25373 b = b.left; 25374 } else { 25375 return false; 25376 } 25377 } 25378 return a.escapedText === b.escapedText; 25379 } 25380 function parseChildPropertyTag(indent2) { 25381 return parseChildParameterOrPropertyTag(1 /* Property */, indent2); 25382 } 25383 function parseChildParameterOrPropertyTag(target, indent2, name) { 25384 let canParseTag = true; 25385 let seenAsterisk = false; 25386 while (true) { 25387 switch (nextTokenJSDoc()) { 25388 case 59 /* AtToken */: 25389 if (canParseTag) { 25390 const child = tryParseChildTag(target, indent2); 25391 if (child && (child.kind === 349 /* JSDocParameterTag */ || child.kind === 356 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { 25392 return false; 25393 } 25394 return child; 25395 } 25396 seenAsterisk = false; 25397 break; 25398 case 4 /* NewLineTrivia */: 25399 canParseTag = true; 25400 seenAsterisk = false; 25401 break; 25402 case 41 /* AsteriskToken */: 25403 if (seenAsterisk) { 25404 canParseTag = false; 25405 } 25406 seenAsterisk = true; 25407 break; 25408 case 79 /* Identifier */: 25409 canParseTag = false; 25410 break; 25411 case 1 /* EndOfFileToken */: 25412 return false; 25413 } 25414 } 25415 } 25416 function tryParseChildTag(target, indent2) { 25417 Debug.assert(token() === 59 /* AtToken */); 25418 const start2 = scanner.getStartPos(); 25419 nextTokenJSDoc(); 25420 const tagName = parseJSDocIdentifierName(); 25421 skipWhitespace(); 25422 let t; 25423 switch (tagName.escapedText) { 25424 case "type": 25425 return target === 1 /* Property */ && parseTypeTag(start2, tagName); 25426 case "prop": 25427 case "property": 25428 t = 1 /* Property */; 25429 break; 25430 case "arg": 25431 case "argument": 25432 case "param": 25433 t = 2 /* Parameter */ | 4 /* CallbackParameter */; 25434 break; 25435 default: 25436 return false; 25437 } 25438 if (!(target & t)) { 25439 return false; 25440 } 25441 return parseParameterOrPropertyTag(start2, tagName, target, indent2); 25442 } 25443 function parseTemplateTagTypeParameter() { 25444 const typeParameterPos = getNodePos(); 25445 const isBracketed = parseOptionalJsdoc(22 /* OpenBracketToken */); 25446 if (isBracketed) { 25447 skipWhitespace(); 25448 } 25449 const name = parseJSDocIdentifierName(Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); 25450 let defaultType; 25451 if (isBracketed) { 25452 skipWhitespace(); 25453 parseExpected(63 /* EqualsToken */); 25454 defaultType = doInsideOfContext(8388608 /* JSDoc */, parseJSDocType); 25455 parseExpected(23 /* CloseBracketToken */); 25456 } 25457 if (nodeIsMissing(name)) { 25458 return void 0; 25459 } 25460 return finishNode(factory2.createTypeParameterDeclaration(void 0, name, void 0, defaultType), typeParameterPos); 25461 } 25462 function parseTemplateTagTypeParameters() { 25463 const pos = getNodePos(); 25464 const typeParameters = []; 25465 do { 25466 skipWhitespace(); 25467 const node = parseTemplateTagTypeParameter(); 25468 if (node !== void 0) { 25469 typeParameters.push(node); 25470 } 25471 skipWhitespaceOrAsterisk(); 25472 } while (parseOptionalJsdoc(27 /* CommaToken */)); 25473 return createNodeArray(typeParameters, pos); 25474 } 25475 function parseTemplateTag(start2, tagName, indent2, indentText) { 25476 const constraint = token() === 18 /* OpenBraceToken */ ? parseJSDocTypeExpression() : void 0; 25477 const typeParameters = parseTemplateTagTypeParameters(); 25478 return finishNode(factory2.createJSDocTemplateTag(tagName, constraint, typeParameters, parseTrailingTagComments(start2, getNodePos(), indent2, indentText)), start2); 25479 } 25480 function parseOptionalJsdoc(t) { 25481 if (token() === t) { 25482 nextTokenJSDoc(); 25483 return true; 25484 } 25485 return false; 25486 } 25487 function parseJSDocEntityName() { 25488 let entity = parseJSDocIdentifierName(); 25489 if (parseOptional(22 /* OpenBracketToken */)) { 25490 parseExpected(23 /* CloseBracketToken */); 25491 } 25492 while (parseOptional(24 /* DotToken */)) { 25493 const name = parseJSDocIdentifierName(); 25494 if (parseOptional(22 /* OpenBracketToken */)) { 25495 parseExpected(23 /* CloseBracketToken */); 25496 } 25497 entity = createQualifiedName(entity, name); 25498 } 25499 return entity; 25500 } 25501 function parseJSDocIdentifierName(message) { 25502 if (!tokenIsIdentifierOrKeyword(token())) { 25503 return createMissingNode(79 /* Identifier */, !message, message || Diagnostics.Identifier_expected); 25504 } 25505 identifierCount++; 25506 const pos = scanner.getTokenPos(); 25507 const end2 = scanner.getTextPos(); 25508 const originalKeywordKind = token(); 25509 const text = internIdentifier(scanner.getTokenValue()); 25510 const result = finishNode(factory2.createIdentifier(text, void 0, originalKeywordKind), pos, end2); 25511 nextTokenJSDoc(); 25512 return result; 25513 } 25514 } 25515 })(JSDocParser = Parser2.JSDocParser || (Parser2.JSDocParser = {})); 25516})(Parser || (Parser = {})); 25517var IncrementalParser; 25518((IncrementalParser2) => { 25519 function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) { 25520 aggressiveChecks = aggressiveChecks || Debug.shouldAssert(2 /* Aggressive */); 25521 checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks); 25522 if (textChangeRangeIsUnchanged(textChangeRange)) { 25523 return sourceFile; 25524 } 25525 if (sourceFile.statements.length === 0) { 25526 return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, void 0, true, sourceFile.scriptKind, sourceFile.setExternalModuleIndicator); 25527 } 25528 const incrementalSourceFile = sourceFile; 25529 Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed); 25530 incrementalSourceFile.hasBeenIncrementallyParsed = true; 25531 Parser.fixupParentReferences(incrementalSourceFile); 25532 const oldText = sourceFile.text; 25533 const syntaxCursor = createSyntaxCursor(sourceFile); 25534 const changeRange = extendToAffectedRange(sourceFile, textChangeRange); 25535 checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks); 25536 Debug.assert(changeRange.span.start <= textChangeRange.span.start); 25537 Debug.assert(textSpanEnd(changeRange.span) === textSpanEnd(textChangeRange.span)); 25538 Debug.assert(textSpanEnd(textChangeRangeNewSpan(changeRange)) === textSpanEnd(textChangeRangeNewSpan(textChangeRange))); 25539 const delta = textChangeRangeNewSpan(changeRange).length - changeRange.span.length; 25540 updateTokenPositionsAndMarkElements( 25541 incrementalSourceFile, 25542 changeRange.span.start, 25543 textSpanEnd(changeRange.span), 25544 textSpanEnd(textChangeRangeNewSpan(changeRange)), 25545 delta, 25546 oldText, 25547 newText, 25548 aggressiveChecks 25549 ); 25550 const result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, true, sourceFile.scriptKind, sourceFile.setExternalModuleIndicator); 25551 result.commentDirectives = getNewCommentDirectives( 25552 sourceFile.commentDirectives, 25553 result.commentDirectives, 25554 changeRange.span.start, 25555 textSpanEnd(changeRange.span), 25556 delta, 25557 oldText, 25558 newText, 25559 aggressiveChecks 25560 ); 25561 result.impliedNodeFormat = sourceFile.impliedNodeFormat; 25562 return result; 25563 } 25564 IncrementalParser2.updateSourceFile = updateSourceFile; 25565 function getNewCommentDirectives(oldDirectives, newDirectives, changeStart, changeRangeOldEnd, delta, oldText, newText, aggressiveChecks) { 25566 if (!oldDirectives) 25567 return newDirectives; 25568 let commentDirectives; 25569 let addedNewlyScannedDirectives = false; 25570 for (const directive of oldDirectives) { 25571 const { range, type } = directive; 25572 if (range.end < changeStart) { 25573 commentDirectives = append(commentDirectives, directive); 25574 } else if (range.pos > changeRangeOldEnd) { 25575 addNewlyScannedDirectives(); 25576 const updatedDirective = { 25577 range: { pos: range.pos + delta, end: range.end + delta }, 25578 type 25579 }; 25580 commentDirectives = append(commentDirectives, updatedDirective); 25581 if (aggressiveChecks) { 25582 Debug.assert(oldText.substring(range.pos, range.end) === newText.substring(updatedDirective.range.pos, updatedDirective.range.end)); 25583 } 25584 } 25585 } 25586 addNewlyScannedDirectives(); 25587 return commentDirectives; 25588 function addNewlyScannedDirectives() { 25589 if (addedNewlyScannedDirectives) 25590 return; 25591 addedNewlyScannedDirectives = true; 25592 if (!commentDirectives) { 25593 commentDirectives = newDirectives; 25594 } else if (newDirectives) { 25595 commentDirectives.push(...newDirectives); 25596 } 25597 } 25598 } 25599 function moveElementEntirelyPastChangeRange(element, isArray2, delta, oldText, newText, aggressiveChecks) { 25600 if (isArray2) { 25601 visitArray2(element); 25602 } else { 25603 visitNode3(element); 25604 } 25605 return; 25606 function visitNode3(node) { 25607 let text = ""; 25608 if (aggressiveChecks && shouldCheckNode(node)) { 25609 text = oldText.substring(node.pos, node.end); 25610 } 25611 if (node._children) { 25612 node._children = void 0; 25613 } 25614 setTextRangePosEnd(node, node.pos + delta, node.end + delta); 25615 if (aggressiveChecks && shouldCheckNode(node)) { 25616 Debug.assert(text === newText.substring(node.pos, node.end)); 25617 } 25618 forEachChild(node, visitNode3, visitArray2); 25619 if (hasJSDocNodes(node)) { 25620 for (const jsDocComment of node.jsDoc) { 25621 visitNode3(jsDocComment); 25622 } 25623 } 25624 checkNodePositions(node, aggressiveChecks); 25625 } 25626 function visitArray2(array) { 25627 array._children = void 0; 25628 setTextRangePosEnd(array, array.pos + delta, array.end + delta); 25629 for (const node of array) { 25630 visitNode3(node); 25631 } 25632 } 25633 } 25634 function shouldCheckNode(node) { 25635 switch (node.kind) { 25636 case 10 /* StringLiteral */: 25637 case 8 /* NumericLiteral */: 25638 case 79 /* Identifier */: 25639 return true; 25640 } 25641 return false; 25642 } 25643 function adjustIntersectingElement(element, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta) { 25644 Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range"); 25645 Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range"); 25646 Debug.assert(element.pos <= element.end); 25647 const pos = Math.min(element.pos, changeRangeNewEnd); 25648 const end = element.end >= changeRangeOldEnd ? element.end + delta : Math.min(element.end, changeRangeNewEnd); 25649 Debug.assert(pos <= end); 25650 if (element.parent) { 25651 Debug.assertGreaterThanOrEqual(pos, element.parent.pos); 25652 Debug.assertLessThanOrEqual(end, element.parent.end); 25653 } 25654 setTextRangePosEnd(element, pos, end); 25655 } 25656 function checkNodePositions(node, aggressiveChecks) { 25657 if (aggressiveChecks) { 25658 let pos = node.pos; 25659 const visitNode3 = (child) => { 25660 Debug.assert(child.pos >= pos); 25661 pos = child.end; 25662 }; 25663 if (hasJSDocNodes(node)) { 25664 for (const jsDocComment of node.jsDoc) { 25665 visitNode3(jsDocComment); 25666 } 25667 } 25668 forEachChild(node, visitNode3); 25669 Debug.assert(pos <= node.end); 25670 } 25671 } 25672 function updateTokenPositionsAndMarkElements(sourceFile, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta, oldText, newText, aggressiveChecks) { 25673 visitNode3(sourceFile); 25674 return; 25675 function visitNode3(child) { 25676 Debug.assert(child.pos <= child.end); 25677 if (child.pos > changeRangeOldEnd) { 25678 moveElementEntirelyPastChangeRange(child, false, delta, oldText, newText, aggressiveChecks); 25679 return; 25680 } 25681 const fullEnd = child.end; 25682 if (fullEnd >= changeStart) { 25683 child.intersectsChange = true; 25684 child._children = void 0; 25685 adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); 25686 forEachChild(child, visitNode3, visitArray2); 25687 if (hasJSDocNodes(child)) { 25688 for (const jsDocComment of child.jsDoc) { 25689 visitNode3(jsDocComment); 25690 } 25691 } 25692 checkNodePositions(child, aggressiveChecks); 25693 return; 25694 } 25695 Debug.assert(fullEnd < changeStart); 25696 } 25697 function visitArray2(array) { 25698 Debug.assert(array.pos <= array.end); 25699 if (array.pos > changeRangeOldEnd) { 25700 moveElementEntirelyPastChangeRange(array, true, delta, oldText, newText, aggressiveChecks); 25701 return; 25702 } 25703 const fullEnd = array.end; 25704 if (fullEnd >= changeStart) { 25705 array.intersectsChange = true; 25706 array._children = void 0; 25707 adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); 25708 for (const node of array) { 25709 if (!node.virtual) { 25710 visitNode3(node); 25711 } 25712 } 25713 return; 25714 } 25715 Debug.assert(fullEnd < changeStart); 25716 } 25717 } 25718 function extendToAffectedRange(sourceFile, changeRange) { 25719 const maxLookahead = 1; 25720 let start = changeRange.span.start; 25721 for (let i = 0; start > 0 && i <= maxLookahead; i++) { 25722 const nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start); 25723 Debug.assert(nearestNode.pos <= start); 25724 const position = nearestNode.pos; 25725 start = Math.max(0, position - 1); 25726 } 25727 const finalSpan = createTextSpanFromBounds(start, textSpanEnd(changeRange.span)); 25728 const finalLength = changeRange.newLength + (changeRange.span.start - start); 25729 return createTextChangeRange(finalSpan, finalLength); 25730 } 25731 function findNearestNodeStartingBeforeOrAtPosition(sourceFile, position) { 25732 let bestResult = sourceFile; 25733 let lastNodeEntirelyBeforePosition; 25734 forEachChild(sourceFile, visit); 25735 if (lastNodeEntirelyBeforePosition) { 25736 const lastChildOfLastEntireNodeBeforePosition = getLastDescendant(lastNodeEntirelyBeforePosition); 25737 if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) { 25738 bestResult = lastChildOfLastEntireNodeBeforePosition; 25739 } 25740 } 25741 return bestResult; 25742 function getLastDescendant(node) { 25743 while (true) { 25744 const lastChild = getLastChild(node); 25745 if (lastChild) { 25746 node = lastChild; 25747 } else { 25748 return node; 25749 } 25750 } 25751 } 25752 function visit(child) { 25753 if (nodeIsMissing(child)) { 25754 return; 25755 } 25756 if (child.pos <= position) { 25757 if (child.pos >= bestResult.pos) { 25758 bestResult = child; 25759 } 25760 if (position < child.end) { 25761 forEachChild(child, visit); 25762 return true; 25763 } else { 25764 Debug.assert(child.end <= position); 25765 lastNodeEntirelyBeforePosition = child; 25766 } 25767 } else { 25768 Debug.assert(child.pos > position); 25769 return true; 25770 } 25771 } 25772 } 25773 function checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks) { 25774 const oldText = sourceFile.text; 25775 if (textChangeRange) { 25776 Debug.assert(oldText.length - textChangeRange.span.length + textChangeRange.newLength === newText.length); 25777 if (aggressiveChecks || Debug.shouldAssert(3 /* VeryAggressive */)) { 25778 const oldTextPrefix = oldText.substr(0, textChangeRange.span.start); 25779 const newTextPrefix = newText.substr(0, textChangeRange.span.start); 25780 Debug.assert(oldTextPrefix === newTextPrefix); 25781 const oldTextSuffix = oldText.substring(textSpanEnd(textChangeRange.span), oldText.length); 25782 const newTextSuffix = newText.substring(textSpanEnd(textChangeRangeNewSpan(textChangeRange)), newText.length); 25783 Debug.assert(oldTextSuffix === newTextSuffix); 25784 } 25785 } 25786 } 25787 function createSyntaxCursor(sourceFile) { 25788 let currentArray = sourceFile.statements; 25789 let currentArrayIndex = 0; 25790 Debug.assert(currentArrayIndex < currentArray.length); 25791 let current = currentArray[currentArrayIndex]; 25792 let lastQueriedPosition = InvalidPosition.Value; 25793 return { 25794 currentNode(position) { 25795 if (position !== lastQueriedPosition) { 25796 if (current && current.end === position && currentArrayIndex < currentArray.length - 1) { 25797 currentArrayIndex++; 25798 current = currentArray[currentArrayIndex]; 25799 } 25800 if (!current || current.pos !== position) { 25801 findHighestListElementThatStartsAtPosition(position); 25802 } 25803 } 25804 lastQueriedPosition = position; 25805 Debug.assert(!current || current.pos === position); 25806 return current; 25807 } 25808 }; 25809 function findHighestListElementThatStartsAtPosition(position) { 25810 currentArray = void 0; 25811 currentArrayIndex = InvalidPosition.Value; 25812 current = void 0; 25813 forEachChild(sourceFile, visitNode3, visitArray2); 25814 return; 25815 function visitNode3(node) { 25816 if (position >= node.pos && position < node.end) { 25817 forEachChild(node, visitNode3, visitArray2); 25818 return true; 25819 } 25820 return false; 25821 } 25822 function visitArray2(array) { 25823 if (position >= array.pos && position < array.end) { 25824 for (let i = 0; i < array.length; i++) { 25825 const child = array[i]; 25826 if (child) { 25827 if (child.pos === position) { 25828 currentArray = array; 25829 currentArrayIndex = i; 25830 current = child; 25831 return true; 25832 } else { 25833 if (child.pos < position && position < child.end) { 25834 forEachChild(child, visitNode3, visitArray2); 25835 return true; 25836 } 25837 } 25838 } 25839 } 25840 } 25841 return false; 25842 } 25843 } 25844 } 25845 IncrementalParser2.createSyntaxCursor = createSyntaxCursor; 25846 let InvalidPosition; 25847 ((InvalidPosition2) => { 25848 InvalidPosition2[InvalidPosition2["Value"] = -1] = "Value"; 25849 })(InvalidPosition || (InvalidPosition = {})); 25850})(IncrementalParser || (IncrementalParser = {})); 25851function isDeclarationFileName(fileName) { 25852 return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions); 25853} 25854function parseResolutionMode(mode, pos, end, reportDiagnostic) { 25855 if (!mode) { 25856 return void 0; 25857 } 25858 if (mode === "import") { 25859 return 99 /* ESNext */; 25860 } 25861 if (mode === "require") { 25862 return 1 /* CommonJS */; 25863 } 25864 reportDiagnostic(pos, end - pos, Diagnostics.resolution_mode_should_be_either_require_or_import); 25865 return void 0; 25866} 25867function processCommentPragmas(context, sourceText) { 25868 const pragmas = []; 25869 for (const range of getLeadingCommentRanges(sourceText, 0) || emptyArray) { 25870 const comment = sourceText.substring(range.pos, range.end); 25871 extractPragmas(pragmas, range, comment); 25872 } 25873 context.pragmas = new Map2(); 25874 for (const pragma of pragmas) { 25875 if (context.pragmas.has(pragma.name)) { 25876 const currentValue = context.pragmas.get(pragma.name); 25877 if (currentValue instanceof Array) { 25878 currentValue.push(pragma.args); 25879 } else { 25880 context.pragmas.set(pragma.name, [currentValue, pragma.args]); 25881 } 25882 continue; 25883 } 25884 context.pragmas.set(pragma.name, pragma.args); 25885 } 25886} 25887function processPragmasIntoFields(context, reportDiagnostic) { 25888 context.checkJsDirective = void 0; 25889 context.referencedFiles = []; 25890 context.typeReferenceDirectives = []; 25891 context.libReferenceDirectives = []; 25892 context.amdDependencies = []; 25893 context.hasNoDefaultLib = false; 25894 context.pragmas.forEach((entryOrList, key) => { 25895 switch (key) { 25896 case "reference": { 25897 const referencedFiles = context.referencedFiles; 25898 const typeReferenceDirectives = context.typeReferenceDirectives; 25899 const libReferenceDirectives = context.libReferenceDirectives; 25900 forEach(toArray(entryOrList), (arg) => { 25901 const { types, lib, path: path2, ["resolution-mode"]: res } = arg.arguments; 25902 if (arg.arguments["no-default-lib"]) { 25903 context.hasNoDefaultLib = true; 25904 } else if (types) { 25905 const parsed = parseResolutionMode(res, types.pos, types.end, reportDiagnostic); 25906 typeReferenceDirectives.push({ pos: types.pos, end: types.end, fileName: types.value, ...parsed ? { resolutionMode: parsed } : {} }); 25907 } else if (lib) { 25908 libReferenceDirectives.push({ pos: lib.pos, end: lib.end, fileName: lib.value }); 25909 } else if (path2) { 25910 referencedFiles.push({ pos: path2.pos, end: path2.end, fileName: path2.value }); 25911 } else { 25912 reportDiagnostic(arg.range.pos, arg.range.end - arg.range.pos, Diagnostics.Invalid_reference_directive_syntax); 25913 } 25914 }); 25915 break; 25916 } 25917 case "amd-dependency": { 25918 context.amdDependencies = map( 25919 toArray(entryOrList), 25920 (x) => ({ name: x.arguments.name, path: x.arguments.path }) 25921 ); 25922 break; 25923 } 25924 case "amd-module": { 25925 if (entryOrList instanceof Array) { 25926 for (const entry of entryOrList) { 25927 if (context.moduleName) { 25928 reportDiagnostic(entry.range.pos, entry.range.end - entry.range.pos, Diagnostics.An_AMD_module_cannot_have_multiple_name_assignments); 25929 } 25930 context.moduleName = entry.arguments.name; 25931 } 25932 } else { 25933 context.moduleName = entryOrList.arguments.name; 25934 } 25935 break; 25936 } 25937 case "ts-nocheck": 25938 case "ts-check": { 25939 forEach(toArray(entryOrList), (entry) => { 25940 if (!context.checkJsDirective || entry.range.pos > context.checkJsDirective.pos) { 25941 context.checkJsDirective = { 25942 enabled: key === "ts-check", 25943 end: entry.range.end, 25944 pos: entry.range.pos 25945 }; 25946 } 25947 }); 25948 break; 25949 } 25950 case "jsx": 25951 case "jsxfrag": 25952 case "jsximportsource": 25953 case "jsxruntime": 25954 return; 25955 default: 25956 Debug.fail("Unhandled pragma kind"); 25957 } 25958 }); 25959} 25960var namedArgRegExCache = new Map2(); 25961function getNamedArgRegEx(name) { 25962 if (namedArgRegExCache.has(name)) { 25963 return namedArgRegExCache.get(name); 25964 } 25965 const result = new RegExp(`(\\s${name}\\s*=\\s*)(?:(?:'([^']*)')|(?:"([^"]*)"))`, "im"); 25966 namedArgRegExCache.set(name, result); 25967 return result; 25968} 25969var tripleSlashXMLCommentStartRegEx = /^\/\/\/\s*<(\S+)\s.*?\/>/im; 25970var singleLinePragmaRegEx = /^\/\/\/?\s*@(\S+)\s*(.*)\s*$/im; 25971function extractPragmas(pragmas, range, text) { 25972 const tripleSlash = range.kind === 2 /* SingleLineCommentTrivia */ && tripleSlashXMLCommentStartRegEx.exec(text); 25973 if (tripleSlash) { 25974 const name = tripleSlash[1].toLowerCase(); 25975 const pragma = commentPragmas[name]; 25976 if (!pragma || !(pragma.kind & 1 /* TripleSlashXML */)) { 25977 return; 25978 } 25979 if (pragma.args) { 25980 const argument = {}; 25981 for (const arg of pragma.args) { 25982 const matcher = getNamedArgRegEx(arg.name); 25983 const matchResult = matcher.exec(text); 25984 if (!matchResult && !arg.optional) { 25985 return; 25986 } else if (matchResult) { 25987 const value = matchResult[2] || matchResult[3]; 25988 if (arg.captureSpan) { 25989 const startPos = range.pos + matchResult.index + matchResult[1].length + 1; 25990 argument[arg.name] = { 25991 value, 25992 pos: startPos, 25993 end: startPos + value.length 25994 }; 25995 } else { 25996 argument[arg.name] = value; 25997 } 25998 } 25999 } 26000 pragmas.push({ name, args: { arguments: argument, range } }); 26001 } else { 26002 pragmas.push({ name, args: { arguments: {}, range } }); 26003 } 26004 return; 26005 } 26006 const singleLine = range.kind === 2 /* SingleLineCommentTrivia */ && singleLinePragmaRegEx.exec(text); 26007 if (singleLine) { 26008 return addPragmaForMatch(pragmas, range, 2 /* SingleLine */, singleLine); 26009 } 26010 if (range.kind === 3 /* MultiLineCommentTrivia */) { 26011 const multiLinePragmaRegEx = /@(\S+)(\s+.*)?$/gim; 26012 let multiLineMatch; 26013 while (multiLineMatch = multiLinePragmaRegEx.exec(text)) { 26014 addPragmaForMatch(pragmas, range, 4 /* MultiLine */, multiLineMatch); 26015 } 26016 } 26017} 26018function addPragmaForMatch(pragmas, range, kind, match) { 26019 if (!match) 26020 return; 26021 const name = match[1].toLowerCase(); 26022 const pragma = commentPragmas[name]; 26023 if (!pragma || !(pragma.kind & kind)) { 26024 return; 26025 } 26026 const args = match[2]; 26027 const argument = getNamedPragmaArguments(pragma, args); 26028 if (argument === "fail") 26029 return; 26030 pragmas.push({ name, args: { arguments: argument, range } }); 26031 return; 26032} 26033function getNamedPragmaArguments(pragma, text) { 26034 if (!text) 26035 return {}; 26036 if (!pragma.args) 26037 return {}; 26038 const args = trimString(text).split(/\s+/); 26039 const argMap = {}; 26040 for (let i = 0; i < pragma.args.length; i++) { 26041 const argument = pragma.args[i]; 26042 if (!args[i] && !argument.optional) { 26043 return "fail"; 26044 } 26045 if (argument.captureSpan) { 26046 return Debug.fail("Capture spans not yet implemented for non-xml pragmas"); 26047 } 26048 argMap[argument.name] = args[i]; 26049 } 26050 return argMap; 26051} 26052function tagNamesAreEquivalent(lhs, rhs) { 26053 if (lhs.kind !== rhs.kind) { 26054 return false; 26055 } 26056 if (lhs.kind === 79 /* Identifier */) { 26057 return lhs.escapedText === rhs.escapedText; 26058 } 26059 if (lhs.kind === 109 /* ThisKeyword */) { 26060 return true; 26061 } 26062 return lhs.name.escapedText === rhs.name.escapedText && tagNamesAreEquivalent(lhs.expression, rhs.expression); 26063} 26064 26065// src/compiler/commandLineParser.ts 26066var compileOnSaveCommandLineOption = { 26067 name: "compileOnSave", 26068 type: "boolean", 26069 defaultValueDescription: false 26070}; 26071var jsxOptionMap = new Map2(getEntries({ 26072 "preserve": 1 /* Preserve */, 26073 "react-native": 3 /* ReactNative */, 26074 "react": 2 /* React */, 26075 "react-jsx": 4 /* ReactJSX */, 26076 "react-jsxdev": 5 /* ReactJSXDev */ 26077})); 26078var inverseJsxOptionMap = new Map2(arrayFrom(mapIterator(jsxOptionMap.entries(), ([key, value]) => ["" + value, key]))); 26079var libEntries = [ 26080 ["es5", "lib.es5.d.ts"], 26081 ["es6", "lib.es2015.d.ts"], 26082 ["es2015", "lib.es2015.d.ts"], 26083 ["es7", "lib.es2016.d.ts"], 26084 ["es2016", "lib.es2016.d.ts"], 26085 ["es2017", "lib.es2017.d.ts"], 26086 ["es2018", "lib.es2018.d.ts"], 26087 ["es2019", "lib.es2019.d.ts"], 26088 ["es2020", "lib.es2020.d.ts"], 26089 ["es2021", "lib.es2021.d.ts"], 26090 ["es2022", "lib.es2022.d.ts"], 26091 ["esnext", "lib.esnext.d.ts"], 26092 ["dom", "lib.dom.d.ts"], 26093 ["dom.iterable", "lib.dom.iterable.d.ts"], 26094 ["webworker", "lib.webworker.d.ts"], 26095 ["webworker.importscripts", "lib.webworker.importscripts.d.ts"], 26096 ["webworker.iterable", "lib.webworker.iterable.d.ts"], 26097 ["scripthost", "lib.scripthost.d.ts"], 26098 ["es2015.core", "lib.es2015.core.d.ts"], 26099 ["es2015.collection", "lib.es2015.collection.d.ts"], 26100 ["es2015.generator", "lib.es2015.generator.d.ts"], 26101 ["es2015.iterable", "lib.es2015.iterable.d.ts"], 26102 ["es2015.promise", "lib.es2015.promise.d.ts"], 26103 ["es2015.proxy", "lib.es2015.proxy.d.ts"], 26104 ["es2015.reflect", "lib.es2015.reflect.d.ts"], 26105 ["es2015.symbol", "lib.es2015.symbol.d.ts"], 26106 ["es2015.symbol.wellknown", "lib.es2015.symbol.wellknown.d.ts"], 26107 ["es2016.array.include", "lib.es2016.array.include.d.ts"], 26108 ["es2017.object", "lib.es2017.object.d.ts"], 26109 ["es2017.sharedmemory", "lib.es2017.sharedmemory.d.ts"], 26110 ["es2017.string", "lib.es2017.string.d.ts"], 26111 ["es2017.intl", "lib.es2017.intl.d.ts"], 26112 ["es2017.typedarrays", "lib.es2017.typedarrays.d.ts"], 26113 ["es2018.asyncgenerator", "lib.es2018.asyncgenerator.d.ts"], 26114 ["es2018.asynciterable", "lib.es2018.asynciterable.d.ts"], 26115 ["es2018.intl", "lib.es2018.intl.d.ts"], 26116 ["es2018.promise", "lib.es2018.promise.d.ts"], 26117 ["es2018.regexp", "lib.es2018.regexp.d.ts"], 26118 ["es2019.array", "lib.es2019.array.d.ts"], 26119 ["es2019.object", "lib.es2019.object.d.ts"], 26120 ["es2019.string", "lib.es2019.string.d.ts"], 26121 ["es2019.symbol", "lib.es2019.symbol.d.ts"], 26122 ["es2019.intl", "lib.es2019.intl.d.ts"], 26123 ["es2020.bigint", "lib.es2020.bigint.d.ts"], 26124 ["es2020.date", "lib.es2020.date.d.ts"], 26125 ["es2020.promise", "lib.es2020.promise.d.ts"], 26126 ["es2020.sharedmemory", "lib.es2020.sharedmemory.d.ts"], 26127 ["es2020.string", "lib.es2020.string.d.ts"], 26128 ["es2020.symbol.wellknown", "lib.es2020.symbol.wellknown.d.ts"], 26129 ["es2020.intl", "lib.es2020.intl.d.ts"], 26130 ["es2020.number", "lib.es2020.number.d.ts"], 26131 ["es2021.promise", "lib.es2021.promise.d.ts"], 26132 ["es2021.string", "lib.es2021.string.d.ts"], 26133 ["es2021.weakref", "lib.es2021.weakref.d.ts"], 26134 ["es2021.intl", "lib.es2021.intl.d.ts"], 26135 ["es2022.array", "lib.es2022.array.d.ts"], 26136 ["es2022.error", "lib.es2022.error.d.ts"], 26137 ["es2022.intl", "lib.es2022.intl.d.ts"], 26138 ["es2022.object", "lib.es2022.object.d.ts"], 26139 ["es2022.sharedmemory", "lib.es2022.sharedmemory.d.ts"], 26140 ["es2022.string", "lib.es2022.string.d.ts"], 26141 ["esnext.array", "lib.es2022.array.d.ts"], 26142 ["esnext.symbol", "lib.es2019.symbol.d.ts"], 26143 ["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"], 26144 ["esnext.intl", "lib.esnext.intl.d.ts"], 26145 ["esnext.bigint", "lib.es2020.bigint.d.ts"], 26146 ["esnext.string", "lib.es2022.string.d.ts"], 26147 ["esnext.promise", "lib.es2021.promise.d.ts"], 26148 ["esnext.weakref", "lib.es2021.weakref.d.ts"] 26149]; 26150var libs = libEntries.map((entry) => entry[0]); 26151var libMap = new Map2(libEntries); 26152var optionsForWatch = [ 26153 { 26154 name: "watchFile", 26155 type: new Map2(getEntries({ 26156 fixedpollinginterval: 0 /* FixedPollingInterval */, 26157 prioritypollinginterval: 1 /* PriorityPollingInterval */, 26158 dynamicprioritypolling: 2 /* DynamicPriorityPolling */, 26159 fixedchunksizepolling: 3 /* FixedChunkSizePolling */, 26160 usefsevents: 4 /* UseFsEvents */, 26161 usefseventsonparentdirectory: 5 /* UseFsEventsOnParentDirectory */ 26162 })), 26163 category: Diagnostics.Watch_and_Build_Modes, 26164 description: Diagnostics.Specify_how_the_TypeScript_watch_mode_works, 26165 defaultValueDescription: 4 /* UseFsEvents */ 26166 }, 26167 { 26168 name: "watchDirectory", 26169 type: new Map2(getEntries({ 26170 usefsevents: 0 /* UseFsEvents */, 26171 fixedpollinginterval: 1 /* FixedPollingInterval */, 26172 dynamicprioritypolling: 2 /* DynamicPriorityPolling */, 26173 fixedchunksizepolling: 3 /* FixedChunkSizePolling */ 26174 })), 26175 category: Diagnostics.Watch_and_Build_Modes, 26176 description: Diagnostics.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality, 26177 defaultValueDescription: 0 /* UseFsEvents */ 26178 }, 26179 { 26180 name: "fallbackPolling", 26181 type: new Map2(getEntries({ 26182 fixedinterval: 0 /* FixedInterval */, 26183 priorityinterval: 1 /* PriorityInterval */, 26184 dynamicpriority: 2 /* DynamicPriority */, 26185 fixedchunksize: 3 /* FixedChunkSize */ 26186 })), 26187 category: Diagnostics.Watch_and_Build_Modes, 26188 description: Diagnostics.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers, 26189 defaultValueDescription: 1 /* PriorityInterval */ 26190 }, 26191 { 26192 name: "synchronousWatchDirectory", 26193 type: "boolean", 26194 category: Diagnostics.Watch_and_Build_Modes, 26195 description: Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively, 26196 defaultValueDescription: false 26197 }, 26198 { 26199 name: "excludeDirectories", 26200 type: "list", 26201 element: { 26202 name: "excludeDirectory", 26203 type: "string", 26204 isFilePath: true, 26205 extraValidation: specToDiagnostic 26206 }, 26207 category: Diagnostics.Watch_and_Build_Modes, 26208 description: Diagnostics.Remove_a_list_of_directories_from_the_watch_process 26209 }, 26210 { 26211 name: "excludeFiles", 26212 type: "list", 26213 element: { 26214 name: "excludeFile", 26215 type: "string", 26216 isFilePath: true, 26217 extraValidation: specToDiagnostic 26218 }, 26219 category: Diagnostics.Watch_and_Build_Modes, 26220 description: Diagnostics.Remove_a_list_of_files_from_the_watch_mode_s_processing 26221 } 26222]; 26223var commonOptionsWithBuild = [ 26224 { 26225 name: "help", 26226 shortName: "h", 26227 type: "boolean", 26228 showInSimplifiedHelpView: true, 26229 isCommandLineOnly: true, 26230 category: Diagnostics.Command_line_Options, 26231 description: Diagnostics.Print_this_message, 26232 defaultValueDescription: false 26233 }, 26234 { 26235 name: "help", 26236 shortName: "?", 26237 type: "boolean", 26238 isCommandLineOnly: true, 26239 category: Diagnostics.Command_line_Options, 26240 defaultValueDescription: false 26241 }, 26242 { 26243 name: "watch", 26244 shortName: "w", 26245 type: "boolean", 26246 showInSimplifiedHelpView: true, 26247 isCommandLineOnly: true, 26248 category: Diagnostics.Command_line_Options, 26249 description: Diagnostics.Watch_input_files, 26250 defaultValueDescription: false 26251 }, 26252 { 26253 name: "preserveWatchOutput", 26254 type: "boolean", 26255 showInSimplifiedHelpView: false, 26256 category: Diagnostics.Output_Formatting, 26257 description: Diagnostics.Disable_wiping_the_console_in_watch_mode, 26258 defaultValueDescription: false 26259 }, 26260 { 26261 name: "listFiles", 26262 type: "boolean", 26263 category: Diagnostics.Compiler_Diagnostics, 26264 description: Diagnostics.Print_all_of_the_files_read_during_the_compilation, 26265 defaultValueDescription: false 26266 }, 26267 { 26268 name: "explainFiles", 26269 type: "boolean", 26270 category: Diagnostics.Compiler_Diagnostics, 26271 description: Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included, 26272 defaultValueDescription: false 26273 }, 26274 { 26275 name: "listEmittedFiles", 26276 type: "boolean", 26277 category: Diagnostics.Compiler_Diagnostics, 26278 description: Diagnostics.Print_the_names_of_emitted_files_after_a_compilation, 26279 defaultValueDescription: false 26280 }, 26281 { 26282 name: "pretty", 26283 type: "boolean", 26284 showInSimplifiedHelpView: true, 26285 category: Diagnostics.Output_Formatting, 26286 description: Diagnostics.Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read, 26287 defaultValueDescription: true 26288 }, 26289 { 26290 name: "traceResolution", 26291 type: "boolean", 26292 category: Diagnostics.Compiler_Diagnostics, 26293 description: Diagnostics.Log_paths_used_during_the_moduleResolution_process, 26294 defaultValueDescription: false 26295 }, 26296 { 26297 name: "diagnostics", 26298 type: "boolean", 26299 category: Diagnostics.Compiler_Diagnostics, 26300 description: Diagnostics.Output_compiler_performance_information_after_building, 26301 defaultValueDescription: false 26302 }, 26303 { 26304 name: "extendedDiagnostics", 26305 type: "boolean", 26306 category: Diagnostics.Compiler_Diagnostics, 26307 description: Diagnostics.Output_more_detailed_compiler_performance_information_after_building, 26308 defaultValueDescription: false 26309 }, 26310 { 26311 name: "generateCpuProfile", 26312 type: "string", 26313 isFilePath: true, 26314 paramType: Diagnostics.FILE_OR_DIRECTORY, 26315 category: Diagnostics.Compiler_Diagnostics, 26316 description: Diagnostics.Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging, 26317 defaultValueDescription: "profile.cpuprofile" 26318 }, 26319 { 26320 name: "generateTrace", 26321 type: "string", 26322 isFilePath: true, 26323 isCommandLineOnly: true, 26324 paramType: Diagnostics.DIRECTORY, 26325 category: Diagnostics.Compiler_Diagnostics, 26326 description: Diagnostics.Generates_an_event_trace_and_a_list_of_types 26327 }, 26328 { 26329 name: "incremental", 26330 shortName: "i", 26331 type: "boolean", 26332 category: Diagnostics.Projects, 26333 description: Diagnostics.Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects, 26334 transpileOptionValue: void 0, 26335 defaultValueDescription: Diagnostics.false_unless_composite_is_set 26336 }, 26337 { 26338 name: "assumeChangesOnlyAffectDirectDependencies", 26339 type: "boolean", 26340 affectsSemanticDiagnostics: true, 26341 affectsEmit: true, 26342 affectsMultiFileEmitBuildInfo: true, 26343 category: Diagnostics.Watch_and_Build_Modes, 26344 description: Diagnostics.Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it, 26345 defaultValueDescription: false 26346 }, 26347 { 26348 name: "locale", 26349 type: "string", 26350 category: Diagnostics.Command_line_Options, 26351 isCommandLineOnly: true, 26352 description: Diagnostics.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit, 26353 defaultValueDescription: Diagnostics.Platform_specific 26354 } 26355]; 26356var targetOptionDeclaration = { 26357 name: "target", 26358 shortName: "t", 26359 type: new Map2(getEntries({ 26360 es3: 0 /* ES3 */, 26361 es5: 1 /* ES5 */, 26362 es6: 2 /* ES2015 */, 26363 es2015: 2 /* ES2015 */, 26364 es2016: 3 /* ES2016 */, 26365 es2017: 4 /* ES2017 */, 26366 es2018: 5 /* ES2018 */, 26367 es2019: 6 /* ES2019 */, 26368 es2020: 7 /* ES2020 */, 26369 es2021: 8 /* ES2021 */, 26370 es2022: 9 /* ES2022 */, 26371 esnext: 99 /* ESNext */ 26372 })), 26373 affectsSourceFile: true, 26374 affectsModuleResolution: true, 26375 affectsEmit: true, 26376 affectsMultiFileEmitBuildInfo: true, 26377 paramType: Diagnostics.VERSION, 26378 showInSimplifiedHelpView: true, 26379 category: Diagnostics.Language_and_Environment, 26380 description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations, 26381 defaultValueDescription: 0 /* ES3 */ 26382}; 26383var moduleOptionDeclaration = { 26384 name: "module", 26385 shortName: "m", 26386 type: new Map2(getEntries({ 26387 none: 0 /* None */, 26388 commonjs: 1 /* CommonJS */, 26389 amd: 2 /* AMD */, 26390 system: 4 /* System */, 26391 umd: 3 /* UMD */, 26392 es6: 5 /* ES2015 */, 26393 es2015: 5 /* ES2015 */, 26394 es2020: 6 /* ES2020 */, 26395 es2022: 7 /* ES2022 */, 26396 esnext: 99 /* ESNext */, 26397 node16: 100 /* Node16 */, 26398 nodenext: 199 /* NodeNext */ 26399 })), 26400 affectsModuleResolution: true, 26401 affectsEmit: true, 26402 affectsMultiFileEmitBuildInfo: true, 26403 paramType: Diagnostics.KIND, 26404 showInSimplifiedHelpView: true, 26405 category: Diagnostics.Modules, 26406 description: Diagnostics.Specify_what_module_code_is_generated, 26407 defaultValueDescription: void 0 26408}; 26409var commandOptionsWithoutBuild = [ 26410 { 26411 name: "all", 26412 type: "boolean", 26413 showInSimplifiedHelpView: true, 26414 category: Diagnostics.Command_line_Options, 26415 description: Diagnostics.Show_all_compiler_options, 26416 defaultValueDescription: false 26417 }, 26418 { 26419 name: "version", 26420 shortName: "v", 26421 type: "boolean", 26422 showInSimplifiedHelpView: true, 26423 category: Diagnostics.Command_line_Options, 26424 description: Diagnostics.Print_the_compiler_s_version, 26425 defaultValueDescription: false 26426 }, 26427 { 26428 name: "init", 26429 type: "boolean", 26430 showInSimplifiedHelpView: true, 26431 category: Diagnostics.Command_line_Options, 26432 description: Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file, 26433 defaultValueDescription: false 26434 }, 26435 { 26436 name: "project", 26437 shortName: "p", 26438 type: "string", 26439 isFilePath: true, 26440 showInSimplifiedHelpView: true, 26441 category: Diagnostics.Command_line_Options, 26442 paramType: Diagnostics.FILE_OR_DIRECTORY, 26443 description: Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json 26444 }, 26445 { 26446 name: "build", 26447 type: "boolean", 26448 shortName: "b", 26449 showInSimplifiedHelpView: true, 26450 category: Diagnostics.Command_line_Options, 26451 description: Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date, 26452 defaultValueDescription: false 26453 }, 26454 { 26455 name: "showConfig", 26456 type: "boolean", 26457 showInSimplifiedHelpView: true, 26458 category: Diagnostics.Command_line_Options, 26459 isCommandLineOnly: true, 26460 description: Diagnostics.Print_the_final_configuration_instead_of_building, 26461 defaultValueDescription: false 26462 }, 26463 { 26464 name: "listFilesOnly", 26465 type: "boolean", 26466 category: Diagnostics.Command_line_Options, 26467 affectsSemanticDiagnostics: true, 26468 affectsEmit: true, 26469 affectsMultiFileEmitBuildInfo: true, 26470 isCommandLineOnly: true, 26471 description: Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing, 26472 defaultValueDescription: false 26473 }, 26474 targetOptionDeclaration, 26475 moduleOptionDeclaration, 26476 { 26477 name: "lib", 26478 type: "list", 26479 element: { 26480 name: "lib", 26481 type: libMap, 26482 defaultValueDescription: void 0 26483 }, 26484 affectsProgramStructure: true, 26485 showInSimplifiedHelpView: true, 26486 category: Diagnostics.Language_and_Environment, 26487 description: Diagnostics.Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment, 26488 transpileOptionValue: void 0 26489 }, 26490 { 26491 name: "allowJs", 26492 type: "boolean", 26493 affectsModuleResolution: true, 26494 showInSimplifiedHelpView: true, 26495 category: Diagnostics.JavaScript_Support, 26496 description: Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files, 26497 defaultValueDescription: false 26498 }, 26499 { 26500 name: "checkJs", 26501 type: "boolean", 26502 showInSimplifiedHelpView: true, 26503 category: Diagnostics.JavaScript_Support, 26504 description: Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files, 26505 defaultValueDescription: false 26506 }, 26507 { 26508 name: "jsx", 26509 type: jsxOptionMap, 26510 affectsSourceFile: true, 26511 affectsEmit: true, 26512 affectsMultiFileEmitBuildInfo: true, 26513 affectsModuleResolution: true, 26514 paramType: Diagnostics.KIND, 26515 showInSimplifiedHelpView: true, 26516 category: Diagnostics.Language_and_Environment, 26517 description: Diagnostics.Specify_what_JSX_code_is_generated, 26518 defaultValueDescription: void 0 26519 }, 26520 { 26521 name: "declaration", 26522 shortName: "d", 26523 type: "boolean", 26524 affectsEmit: true, 26525 affectsMultiFileEmitBuildInfo: true, 26526 showInSimplifiedHelpView: true, 26527 category: Diagnostics.Emit, 26528 transpileOptionValue: void 0, 26529 description: Diagnostics.Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project, 26530 defaultValueDescription: Diagnostics.false_unless_composite_is_set 26531 }, 26532 { 26533 name: "declarationMap", 26534 type: "boolean", 26535 affectsEmit: true, 26536 affectsMultiFileEmitBuildInfo: true, 26537 showInSimplifiedHelpView: true, 26538 category: Diagnostics.Emit, 26539 transpileOptionValue: void 0, 26540 defaultValueDescription: false, 26541 description: Diagnostics.Create_sourcemaps_for_d_ts_files 26542 }, 26543 { 26544 name: "emitDeclarationOnly", 26545 type: "boolean", 26546 affectsEmit: true, 26547 affectsMultiFileEmitBuildInfo: true, 26548 showInSimplifiedHelpView: true, 26549 category: Diagnostics.Emit, 26550 description: Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files, 26551 transpileOptionValue: void 0, 26552 defaultValueDescription: false 26553 }, 26554 { 26555 name: "sourceMap", 26556 type: "boolean", 26557 affectsEmit: true, 26558 affectsMultiFileEmitBuildInfo: true, 26559 showInSimplifiedHelpView: true, 26560 category: Diagnostics.Emit, 26561 defaultValueDescription: false, 26562 description: Diagnostics.Create_source_map_files_for_emitted_JavaScript_files 26563 }, 26564 { 26565 name: "outFile", 26566 type: "string", 26567 affectsEmit: true, 26568 affectsMultiFileEmitBuildInfo: true, 26569 affectsDeclarationPath: true, 26570 affectsBundleEmitBuildInfo: true, 26571 isFilePath: true, 26572 paramType: Diagnostics.FILE, 26573 showInSimplifiedHelpView: true, 26574 category: Diagnostics.Emit, 26575 description: Diagnostics.Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output, 26576 transpileOptionValue: void 0 26577 }, 26578 { 26579 name: "outDir", 26580 type: "string", 26581 affectsEmit: true, 26582 affectsMultiFileEmitBuildInfo: true, 26583 affectsDeclarationPath: true, 26584 isFilePath: true, 26585 paramType: Diagnostics.DIRECTORY, 26586 showInSimplifiedHelpView: true, 26587 category: Diagnostics.Emit, 26588 description: Diagnostics.Specify_an_output_folder_for_all_emitted_files 26589 }, 26590 { 26591 name: "rootDir", 26592 type: "string", 26593 affectsEmit: true, 26594 affectsMultiFileEmitBuildInfo: true, 26595 affectsDeclarationPath: true, 26596 isFilePath: true, 26597 paramType: Diagnostics.LOCATION, 26598 category: Diagnostics.Modules, 26599 description: Diagnostics.Specify_the_root_folder_within_your_source_files, 26600 defaultValueDescription: Diagnostics.Computed_from_the_list_of_input_files 26601 }, 26602 { 26603 name: "composite", 26604 type: "boolean", 26605 affectsEmit: true, 26606 affectsMultiFileEmitBuildInfo: true, 26607 affectsBundleEmitBuildInfo: true, 26608 isTSConfigOnly: true, 26609 category: Diagnostics.Projects, 26610 transpileOptionValue: void 0, 26611 defaultValueDescription: false, 26612 description: Diagnostics.Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references 26613 }, 26614 { 26615 name: "tsBuildInfoFile", 26616 type: "string", 26617 affectsEmit: true, 26618 affectsMultiFileEmitBuildInfo: true, 26619 affectsBundleEmitBuildInfo: true, 26620 isFilePath: true, 26621 paramType: Diagnostics.FILE, 26622 category: Diagnostics.Projects, 26623 transpileOptionValue: void 0, 26624 defaultValueDescription: ".tsbuildinfo", 26625 description: Diagnostics.Specify_the_path_to_tsbuildinfo_incremental_compilation_file 26626 }, 26627 { 26628 name: "removeComments", 26629 type: "boolean", 26630 affectsEmit: true, 26631 affectsMultiFileEmitBuildInfo: true, 26632 showInSimplifiedHelpView: true, 26633 category: Diagnostics.Emit, 26634 defaultValueDescription: false, 26635 description: Diagnostics.Disable_emitting_comments 26636 }, 26637 { 26638 name: "noEmit", 26639 type: "boolean", 26640 showInSimplifiedHelpView: true, 26641 category: Diagnostics.Emit, 26642 description: Diagnostics.Disable_emitting_files_from_a_compilation, 26643 transpileOptionValue: void 0, 26644 defaultValueDescription: false 26645 }, 26646 { 26647 name: "importHelpers", 26648 type: "boolean", 26649 affectsEmit: true, 26650 affectsMultiFileEmitBuildInfo: true, 26651 category: Diagnostics.Emit, 26652 description: Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file, 26653 defaultValueDescription: false 26654 }, 26655 { 26656 name: "importsNotUsedAsValues", 26657 type: new Map2(getEntries({ 26658 remove: 0 /* Remove */, 26659 preserve: 1 /* Preserve */, 26660 error: 2 /* Error */ 26661 })), 26662 affectsEmit: true, 26663 affectsSemanticDiagnostics: true, 26664 affectsMultiFileEmitBuildInfo: true, 26665 category: Diagnostics.Emit, 26666 description: Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types, 26667 defaultValueDescription: 0 /* Remove */ 26668 }, 26669 { 26670 name: "downlevelIteration", 26671 type: "boolean", 26672 affectsEmit: true, 26673 affectsMultiFileEmitBuildInfo: true, 26674 category: Diagnostics.Emit, 26675 description: Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration, 26676 defaultValueDescription: false 26677 }, 26678 { 26679 name: "isolatedModules", 26680 type: "boolean", 26681 category: Diagnostics.Interop_Constraints, 26682 description: Diagnostics.Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports, 26683 transpileOptionValue: true, 26684 defaultValueDescription: false 26685 }, 26686 { 26687 name: "strict", 26688 type: "boolean", 26689 affectsMultiFileEmitBuildInfo: true, 26690 showInSimplifiedHelpView: true, 26691 category: Diagnostics.Type_Checking, 26692 description: Diagnostics.Enable_all_strict_type_checking_options, 26693 defaultValueDescription: false 26694 }, 26695 { 26696 name: "noImplicitAny", 26697 type: "boolean", 26698 affectsSemanticDiagnostics: true, 26699 affectsMultiFileEmitBuildInfo: true, 26700 strictFlag: true, 26701 category: Diagnostics.Type_Checking, 26702 description: Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type, 26703 defaultValueDescription: Diagnostics.false_unless_strict_is_set 26704 }, 26705 { 26706 name: "strictNullChecks", 26707 type: "boolean", 26708 affectsSemanticDiagnostics: true, 26709 affectsMultiFileEmitBuildInfo: true, 26710 strictFlag: true, 26711 category: Diagnostics.Type_Checking, 26712 description: Diagnostics.When_type_checking_take_into_account_null_and_undefined, 26713 defaultValueDescription: Diagnostics.false_unless_strict_is_set 26714 }, 26715 { 26716 name: "strictFunctionTypes", 26717 type: "boolean", 26718 affectsSemanticDiagnostics: true, 26719 affectsMultiFileEmitBuildInfo: true, 26720 strictFlag: true, 26721 category: Diagnostics.Type_Checking, 26722 description: Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible, 26723 defaultValueDescription: Diagnostics.false_unless_strict_is_set 26724 }, 26725 { 26726 name: "strictBindCallApply", 26727 type: "boolean", 26728 affectsSemanticDiagnostics: true, 26729 affectsMultiFileEmitBuildInfo: true, 26730 strictFlag: true, 26731 category: Diagnostics.Type_Checking, 26732 description: Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function, 26733 defaultValueDescription: Diagnostics.false_unless_strict_is_set 26734 }, 26735 { 26736 name: "strictPropertyInitialization", 26737 type: "boolean", 26738 affectsSemanticDiagnostics: true, 26739 affectsMultiFileEmitBuildInfo: true, 26740 strictFlag: true, 26741 category: Diagnostics.Type_Checking, 26742 description: Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor, 26743 defaultValueDescription: Diagnostics.false_unless_strict_is_set 26744 }, 26745 { 26746 name: "noImplicitThis", 26747 type: "boolean", 26748 affectsSemanticDiagnostics: true, 26749 affectsMultiFileEmitBuildInfo: true, 26750 strictFlag: true, 26751 category: Diagnostics.Type_Checking, 26752 description: Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any, 26753 defaultValueDescription: Diagnostics.false_unless_strict_is_set 26754 }, 26755 { 26756 name: "useUnknownInCatchVariables", 26757 type: "boolean", 26758 affectsSemanticDiagnostics: true, 26759 affectsMultiFileEmitBuildInfo: true, 26760 strictFlag: true, 26761 category: Diagnostics.Type_Checking, 26762 description: Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any, 26763 defaultValueDescription: false 26764 }, 26765 { 26766 name: "alwaysStrict", 26767 type: "boolean", 26768 affectsSourceFile: true, 26769 affectsEmit: true, 26770 affectsMultiFileEmitBuildInfo: true, 26771 strictFlag: true, 26772 category: Diagnostics.Type_Checking, 26773 description: Diagnostics.Ensure_use_strict_is_always_emitted, 26774 defaultValueDescription: Diagnostics.false_unless_strict_is_set 26775 }, 26776 { 26777 name: "noUnusedLocals", 26778 type: "boolean", 26779 affectsSemanticDiagnostics: true, 26780 affectsMultiFileEmitBuildInfo: true, 26781 category: Diagnostics.Type_Checking, 26782 description: Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read, 26783 defaultValueDescription: false 26784 }, 26785 { 26786 name: "noUnusedParameters", 26787 type: "boolean", 26788 affectsSemanticDiagnostics: true, 26789 affectsMultiFileEmitBuildInfo: true, 26790 category: Diagnostics.Type_Checking, 26791 description: Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read, 26792 defaultValueDescription: false 26793 }, 26794 { 26795 name: "exactOptionalPropertyTypes", 26796 type: "boolean", 26797 affectsSemanticDiagnostics: true, 26798 affectsMultiFileEmitBuildInfo: true, 26799 category: Diagnostics.Type_Checking, 26800 description: Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined, 26801 defaultValueDescription: false 26802 }, 26803 { 26804 name: "noImplicitReturns", 26805 type: "boolean", 26806 affectsSemanticDiagnostics: true, 26807 affectsMultiFileEmitBuildInfo: true, 26808 category: Diagnostics.Type_Checking, 26809 description: Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function, 26810 defaultValueDescription: false 26811 }, 26812 { 26813 name: "noFallthroughCasesInSwitch", 26814 type: "boolean", 26815 affectsBindDiagnostics: true, 26816 affectsSemanticDiagnostics: true, 26817 affectsMultiFileEmitBuildInfo: true, 26818 category: Diagnostics.Type_Checking, 26819 description: Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements, 26820 defaultValueDescription: false 26821 }, 26822 { 26823 name: "noUncheckedIndexedAccess", 26824 type: "boolean", 26825 affectsSemanticDiagnostics: true, 26826 affectsMultiFileEmitBuildInfo: true, 26827 category: Diagnostics.Type_Checking, 26828 description: Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index, 26829 defaultValueDescription: false 26830 }, 26831 { 26832 name: "noImplicitOverride", 26833 type: "boolean", 26834 affectsSemanticDiagnostics: true, 26835 affectsMultiFileEmitBuildInfo: true, 26836 category: Diagnostics.Type_Checking, 26837 description: Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier, 26838 defaultValueDescription: false 26839 }, 26840 { 26841 name: "noPropertyAccessFromIndexSignature", 26842 type: "boolean", 26843 affectsSemanticDiagnostics: true, 26844 affectsMultiFileEmitBuildInfo: true, 26845 showInSimplifiedHelpView: false, 26846 category: Diagnostics.Type_Checking, 26847 description: Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type, 26848 defaultValueDescription: false 26849 }, 26850 { 26851 name: "moduleResolution", 26852 type: new Map2(getEntries({ 26853 node: 2 /* NodeJs */, 26854 classic: 1 /* Classic */, 26855 node16: 3 /* Node16 */, 26856 nodenext: 99 /* NodeNext */ 26857 })), 26858 affectsModuleResolution: true, 26859 paramType: Diagnostics.STRATEGY, 26860 category: Diagnostics.Modules, 26861 description: Diagnostics.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier, 26862 defaultValueDescription: Diagnostics.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node 26863 }, 26864 { 26865 name: "baseUrl", 26866 type: "string", 26867 affectsModuleResolution: true, 26868 isFilePath: true, 26869 category: Diagnostics.Modules, 26870 description: Diagnostics.Specify_the_base_directory_to_resolve_non_relative_module_names 26871 }, 26872 { 26873 name: "paths", 26874 type: "object", 26875 affectsModuleResolution: true, 26876 isTSConfigOnly: true, 26877 category: Diagnostics.Modules, 26878 description: Diagnostics.Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations, 26879 transpileOptionValue: void 0 26880 }, 26881 { 26882 name: "rootDirs", 26883 type: "list", 26884 isTSConfigOnly: true, 26885 element: { 26886 name: "rootDirs", 26887 type: "string", 26888 isFilePath: true 26889 }, 26890 affectsModuleResolution: true, 26891 category: Diagnostics.Modules, 26892 description: Diagnostics.Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules, 26893 transpileOptionValue: void 0, 26894 defaultValueDescription: Diagnostics.Computed_from_the_list_of_input_files 26895 }, 26896 { 26897 name: "typeRoots", 26898 type: "list", 26899 element: { 26900 name: "typeRoots", 26901 type: "string", 26902 isFilePath: true 26903 }, 26904 affectsModuleResolution: true, 26905 category: Diagnostics.Modules, 26906 description: Diagnostics.Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types 26907 }, 26908 { 26909 name: "types", 26910 type: "list", 26911 element: { 26912 name: "types", 26913 type: "string" 26914 }, 26915 affectsProgramStructure: true, 26916 showInSimplifiedHelpView: true, 26917 category: Diagnostics.Modules, 26918 description: Diagnostics.Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file, 26919 transpileOptionValue: void 0 26920 }, 26921 { 26922 name: "allowSyntheticDefaultImports", 26923 type: "boolean", 26924 affectsSemanticDiagnostics: true, 26925 affectsMultiFileEmitBuildInfo: true, 26926 category: Diagnostics.Interop_Constraints, 26927 description: Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export, 26928 defaultValueDescription: Diagnostics.module_system_or_esModuleInterop 26929 }, 26930 { 26931 name: "esModuleInterop", 26932 type: "boolean", 26933 affectsSemanticDiagnostics: true, 26934 affectsEmit: true, 26935 affectsMultiFileEmitBuildInfo: true, 26936 showInSimplifiedHelpView: true, 26937 category: Diagnostics.Interop_Constraints, 26938 description: Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility, 26939 defaultValueDescription: false 26940 }, 26941 { 26942 name: "preserveSymlinks", 26943 type: "boolean", 26944 category: Diagnostics.Interop_Constraints, 26945 description: Diagnostics.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node, 26946 defaultValueDescription: false 26947 }, 26948 { 26949 name: "allowUmdGlobalAccess", 26950 type: "boolean", 26951 affectsSemanticDiagnostics: true, 26952 affectsMultiFileEmitBuildInfo: true, 26953 category: Diagnostics.Modules, 26954 description: Diagnostics.Allow_accessing_UMD_globals_from_modules, 26955 defaultValueDescription: false 26956 }, 26957 { 26958 name: "moduleSuffixes", 26959 type: "list", 26960 element: { 26961 name: "suffix", 26962 type: "string" 26963 }, 26964 listPreserveFalsyValues: true, 26965 affectsModuleResolution: true, 26966 category: Diagnostics.Modules, 26967 description: Diagnostics.List_of_file_name_suffixes_to_search_when_resolving_a_module 26968 }, 26969 { 26970 name: "sourceRoot", 26971 type: "string", 26972 affectsEmit: true, 26973 affectsMultiFileEmitBuildInfo: true, 26974 paramType: Diagnostics.LOCATION, 26975 category: Diagnostics.Emit, 26976 description: Diagnostics.Specify_the_root_path_for_debuggers_to_find_the_reference_source_code 26977 }, 26978 { 26979 name: "mapRoot", 26980 type: "string", 26981 affectsEmit: true, 26982 affectsMultiFileEmitBuildInfo: true, 26983 paramType: Diagnostics.LOCATION, 26984 category: Diagnostics.Emit, 26985 description: Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations 26986 }, 26987 { 26988 name: "inlineSourceMap", 26989 type: "boolean", 26990 affectsEmit: true, 26991 affectsMultiFileEmitBuildInfo: true, 26992 category: Diagnostics.Emit, 26993 description: Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript, 26994 defaultValueDescription: false 26995 }, 26996 { 26997 name: "inlineSources", 26998 type: "boolean", 26999 affectsEmit: true, 27000 affectsMultiFileEmitBuildInfo: true, 27001 category: Diagnostics.Emit, 27002 description: Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript, 27003 defaultValueDescription: false 27004 }, 27005 { 27006 name: "experimentalDecorators", 27007 type: "boolean", 27008 affectsSemanticDiagnostics: true, 27009 affectsMultiFileEmitBuildInfo: true, 27010 category: Diagnostics.Language_and_Environment, 27011 description: Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators, 27012 defaultValueDescription: false 27013 }, 27014 { 27015 name: "emitDecoratorMetadata", 27016 type: "boolean", 27017 affectsSemanticDiagnostics: true, 27018 affectsEmit: true, 27019 affectsMultiFileEmitBuildInfo: true, 27020 category: Diagnostics.Language_and_Environment, 27021 description: Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files, 27022 defaultValueDescription: false 27023 }, 27024 { 27025 name: "jsxFactory", 27026 type: "string", 27027 category: Diagnostics.Language_and_Environment, 27028 description: Diagnostics.Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h, 27029 defaultValueDescription: "`React.createElement`" 27030 }, 27031 { 27032 name: "jsxFragmentFactory", 27033 type: "string", 27034 category: Diagnostics.Language_and_Environment, 27035 description: Diagnostics.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment, 27036 defaultValueDescription: "React.Fragment" 27037 }, 27038 { 27039 name: "jsxImportSource", 27040 type: "string", 27041 affectsSemanticDiagnostics: true, 27042 affectsEmit: true, 27043 affectsMultiFileEmitBuildInfo: true, 27044 affectsModuleResolution: true, 27045 category: Diagnostics.Language_and_Environment, 27046 description: Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk, 27047 defaultValueDescription: "react" 27048 }, 27049 { 27050 name: "ets", 27051 type: "object", 27052 affectsSourceFile: true, 27053 affectsEmit: true, 27054 affectsModuleResolution: true, 27055 category: Diagnostics.Language_and_Environment, 27056 description: Diagnostics.Unknown_build_option_0 27057 }, 27058 { 27059 name: "packageManagerType", 27060 type: "string", 27061 affectsSourceFile: true, 27062 affectsEmit: true, 27063 affectsModuleResolution: true, 27064 category: Diagnostics.Language_and_Environment, 27065 description: Diagnostics.Unknown_build_option_0 27066 }, 27067 { 27068 name: "emitNodeModulesFiles", 27069 type: "boolean", 27070 category: Diagnostics.Language_and_Environment, 27071 description: Diagnostics.Unknown_build_option_0, 27072 defaultValueDescription: false 27073 }, 27074 { 27075 name: "resolveJsonModule", 27076 type: "boolean", 27077 affectsModuleResolution: true, 27078 category: Diagnostics.Modules, 27079 description: Diagnostics.Enable_importing_json_files, 27080 defaultValueDescription: false 27081 }, 27082 { 27083 name: "out", 27084 type: "string", 27085 affectsEmit: true, 27086 affectsMultiFileEmitBuildInfo: true, 27087 affectsDeclarationPath: true, 27088 affectsBundleEmitBuildInfo: true, 27089 isFilePath: false, 27090 category: Diagnostics.Backwards_Compatibility, 27091 paramType: Diagnostics.FILE, 27092 transpileOptionValue: void 0, 27093 description: Diagnostics.Deprecated_setting_Use_outFile_instead 27094 }, 27095 { 27096 name: "reactNamespace", 27097 type: "string", 27098 affectsEmit: true, 27099 affectsMultiFileEmitBuildInfo: true, 27100 category: Diagnostics.Language_and_Environment, 27101 description: Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit, 27102 defaultValueDescription: "`React`" 27103 }, 27104 { 27105 name: "skipDefaultLibCheck", 27106 type: "boolean", 27107 affectsMultiFileEmitBuildInfo: true, 27108 category: Diagnostics.Completeness, 27109 description: Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript, 27110 defaultValueDescription: false 27111 }, 27112 { 27113 name: "charset", 27114 type: "string", 27115 category: Diagnostics.Backwards_Compatibility, 27116 description: Diagnostics.No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files, 27117 defaultValueDescription: "utf8" 27118 }, 27119 { 27120 name: "emitBOM", 27121 type: "boolean", 27122 affectsEmit: true, 27123 affectsMultiFileEmitBuildInfo: true, 27124 category: Diagnostics.Emit, 27125 description: Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files, 27126 defaultValueDescription: false 27127 }, 27128 { 27129 name: "newLine", 27130 type: new Map2(getEntries({ 27131 crlf: 0 /* CarriageReturnLineFeed */, 27132 lf: 1 /* LineFeed */ 27133 })), 27134 affectsEmit: true, 27135 affectsMultiFileEmitBuildInfo: true, 27136 paramType: Diagnostics.NEWLINE, 27137 category: Diagnostics.Emit, 27138 description: Diagnostics.Set_the_newline_character_for_emitting_files, 27139 defaultValueDescription: Diagnostics.Platform_specific 27140 }, 27141 { 27142 name: "noErrorTruncation", 27143 type: "boolean", 27144 affectsSemanticDiagnostics: true, 27145 affectsMultiFileEmitBuildInfo: true, 27146 category: Diagnostics.Output_Formatting, 27147 description: Diagnostics.Disable_truncating_types_in_error_messages, 27148 defaultValueDescription: false 27149 }, 27150 { 27151 name: "noLib", 27152 type: "boolean", 27153 category: Diagnostics.Language_and_Environment, 27154 affectsProgramStructure: true, 27155 description: Diagnostics.Disable_including_any_library_files_including_the_default_lib_d_ts, 27156 transpileOptionValue: true, 27157 defaultValueDescription: false 27158 }, 27159 { 27160 name: "noResolve", 27161 type: "boolean", 27162 affectsModuleResolution: true, 27163 category: Diagnostics.Modules, 27164 description: Diagnostics.Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project, 27165 transpileOptionValue: true, 27166 defaultValueDescription: false 27167 }, 27168 { 27169 name: "stripInternal", 27170 type: "boolean", 27171 affectsEmit: true, 27172 affectsMultiFileEmitBuildInfo: true, 27173 category: Diagnostics.Emit, 27174 description: Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments, 27175 defaultValueDescription: false 27176 }, 27177 { 27178 name: "disableSizeLimit", 27179 type: "boolean", 27180 affectsProgramStructure: true, 27181 category: Diagnostics.Editor_Support, 27182 description: Diagnostics.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server, 27183 defaultValueDescription: false 27184 }, 27185 { 27186 name: "disableSourceOfProjectReferenceRedirect", 27187 type: "boolean", 27188 isTSConfigOnly: true, 27189 category: Diagnostics.Projects, 27190 description: Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects, 27191 defaultValueDescription: false 27192 }, 27193 { 27194 name: "disableSolutionSearching", 27195 type: "boolean", 27196 isTSConfigOnly: true, 27197 category: Diagnostics.Projects, 27198 description: Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing, 27199 defaultValueDescription: false 27200 }, 27201 { 27202 name: "disableReferencedProjectLoad", 27203 type: "boolean", 27204 isTSConfigOnly: true, 27205 category: Diagnostics.Projects, 27206 description: Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript, 27207 defaultValueDescription: false 27208 }, 27209 { 27210 name: "noImplicitUseStrict", 27211 type: "boolean", 27212 affectsSemanticDiagnostics: true, 27213 affectsMultiFileEmitBuildInfo: true, 27214 category: Diagnostics.Backwards_Compatibility, 27215 description: Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files, 27216 defaultValueDescription: false 27217 }, 27218 { 27219 name: "noEmitHelpers", 27220 type: "boolean", 27221 affectsEmit: true, 27222 affectsMultiFileEmitBuildInfo: true, 27223 category: Diagnostics.Emit, 27224 description: Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output, 27225 defaultValueDescription: false 27226 }, 27227 { 27228 name: "noEmitOnError", 27229 type: "boolean", 27230 affectsEmit: true, 27231 affectsMultiFileEmitBuildInfo: true, 27232 category: Diagnostics.Emit, 27233 transpileOptionValue: void 0, 27234 description: Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported, 27235 defaultValueDescription: false 27236 }, 27237 { 27238 name: "preserveConstEnums", 27239 type: "boolean", 27240 affectsEmit: true, 27241 affectsMultiFileEmitBuildInfo: true, 27242 category: Diagnostics.Emit, 27243 description: Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code, 27244 defaultValueDescription: false 27245 }, 27246 { 27247 name: "declarationDir", 27248 type: "string", 27249 affectsEmit: true, 27250 affectsMultiFileEmitBuildInfo: true, 27251 affectsDeclarationPath: true, 27252 isFilePath: true, 27253 paramType: Diagnostics.DIRECTORY, 27254 category: Diagnostics.Emit, 27255 transpileOptionValue: void 0, 27256 description: Diagnostics.Specify_the_output_directory_for_generated_declaration_files 27257 }, 27258 { 27259 name: "skipLibCheck", 27260 type: "boolean", 27261 affectsMultiFileEmitBuildInfo: true, 27262 category: Diagnostics.Completeness, 27263 description: Diagnostics.Skip_type_checking_all_d_ts_files, 27264 defaultValueDescription: false 27265 }, 27266 { 27267 name: "allowUnusedLabels", 27268 type: "boolean", 27269 affectsBindDiagnostics: true, 27270 affectsSemanticDiagnostics: true, 27271 affectsMultiFileEmitBuildInfo: true, 27272 category: Diagnostics.Type_Checking, 27273 description: Diagnostics.Disable_error_reporting_for_unused_labels, 27274 defaultValueDescription: void 0 27275 }, 27276 { 27277 name: "allowUnreachableCode", 27278 type: "boolean", 27279 affectsBindDiagnostics: true, 27280 affectsSemanticDiagnostics: true, 27281 affectsMultiFileEmitBuildInfo: true, 27282 category: Diagnostics.Type_Checking, 27283 description: Diagnostics.Disable_error_reporting_for_unreachable_code, 27284 defaultValueDescription: void 0 27285 }, 27286 { 27287 name: "suppressExcessPropertyErrors", 27288 type: "boolean", 27289 affectsSemanticDiagnostics: true, 27290 affectsMultiFileEmitBuildInfo: true, 27291 category: Diagnostics.Backwards_Compatibility, 27292 description: Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals, 27293 defaultValueDescription: false 27294 }, 27295 { 27296 name: "suppressImplicitAnyIndexErrors", 27297 type: "boolean", 27298 affectsSemanticDiagnostics: true, 27299 affectsMultiFileEmitBuildInfo: true, 27300 category: Diagnostics.Backwards_Compatibility, 27301 description: Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures, 27302 defaultValueDescription: false 27303 }, 27304 { 27305 name: "forceConsistentCasingInFileNames", 27306 type: "boolean", 27307 affectsModuleResolution: true, 27308 category: Diagnostics.Interop_Constraints, 27309 description: Diagnostics.Ensure_that_casing_is_correct_in_imports, 27310 defaultValueDescription: false 27311 }, 27312 { 27313 name: "maxNodeModuleJsDepth", 27314 type: "number", 27315 affectsModuleResolution: true, 27316 category: Diagnostics.JavaScript_Support, 27317 description: Diagnostics.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs, 27318 defaultValueDescription: 0 27319 }, 27320 { 27321 name: "noStrictGenericChecks", 27322 type: "boolean", 27323 affectsSemanticDiagnostics: true, 27324 affectsMultiFileEmitBuildInfo: true, 27325 category: Diagnostics.Backwards_Compatibility, 27326 description: Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types, 27327 defaultValueDescription: false 27328 }, 27329 { 27330 name: "useDefineForClassFields", 27331 type: "boolean", 27332 affectsSemanticDiagnostics: true, 27333 affectsEmit: true, 27334 affectsMultiFileEmitBuildInfo: true, 27335 category: Diagnostics.Language_and_Environment, 27336 description: Diagnostics.Emit_ECMAScript_standard_compliant_class_fields, 27337 defaultValueDescription: Diagnostics.true_for_ES2022_and_above_including_ESNext 27338 }, 27339 { 27340 name: "preserveValueImports", 27341 type: "boolean", 27342 affectsEmit: true, 27343 affectsMultiFileEmitBuildInfo: true, 27344 category: Diagnostics.Emit, 27345 description: Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed, 27346 defaultValueDescription: false 27347 }, 27348 { 27349 name: "keyofStringsOnly", 27350 type: "boolean", 27351 category: Diagnostics.Backwards_Compatibility, 27352 description: Diagnostics.Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option, 27353 defaultValueDescription: false 27354 }, 27355 { 27356 name: "plugins", 27357 type: "list", 27358 isTSConfigOnly: true, 27359 element: { 27360 name: "plugin", 27361 type: "object" 27362 }, 27363 description: Diagnostics.Specify_a_list_of_language_service_plugins_to_include, 27364 category: Diagnostics.Editor_Support 27365 }, 27366 { 27367 name: "moduleDetection", 27368 type: new Map2(getEntries({ 27369 auto: 2 /* Auto */, 27370 legacy: 1 /* Legacy */, 27371 force: 3 /* Force */ 27372 })), 27373 affectsModuleResolution: true, 27374 description: Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files, 27375 category: Diagnostics.Language_and_Environment, 27376 defaultValueDescription: Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules 27377 }, 27378 { 27379 name: "ignoreDeprecations", 27380 type: "string", 27381 defaultValueDescription: void 0 27382 }, 27383 { 27384 name: "etsAnnotationsEnable", 27385 type: "boolean", 27386 affectsSemanticDiagnostics: true, 27387 affectsEmit: true, 27388 affectsMultiFileEmitBuildInfo: true, 27389 category: Diagnostics.Language_and_Environment, 27390 description: Diagnostics.Enable_support_of_ETS_annotations, 27391 defaultValueDescription: false 27392 } 27393]; 27394var optionDeclarations = [ 27395 ...commonOptionsWithBuild, 27396 ...commandOptionsWithoutBuild 27397]; 27398var semanticDiagnosticsOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsSemanticDiagnostics); 27399var affectsEmitOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsEmit); 27400var affectsDeclarationPathOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsDeclarationPath); 27401var moduleResolutionOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsModuleResolution); 27402var sourceFileAffectingCompilerOptions = optionDeclarations.filter((option) => !!option.affectsSourceFile || !!option.affectsModuleResolution || !!option.affectsBindDiagnostics); 27403var optionsAffectingProgramStructure = optionDeclarations.filter((option) => !!option.affectsProgramStructure); 27404var transpileOptionValueCompilerOptions = optionDeclarations.filter((option) => hasProperty(option, "transpileOptionValue")); 27405var optionsForBuild = [ 27406 { 27407 name: "verbose", 27408 shortName: "v", 27409 category: Diagnostics.Command_line_Options, 27410 description: Diagnostics.Enable_verbose_logging, 27411 type: "boolean", 27412 defaultValueDescription: false 27413 }, 27414 { 27415 name: "dry", 27416 shortName: "d", 27417 category: Diagnostics.Command_line_Options, 27418 description: Diagnostics.Show_what_would_be_built_or_deleted_if_specified_with_clean, 27419 type: "boolean", 27420 defaultValueDescription: false 27421 }, 27422 { 27423 name: "force", 27424 shortName: "f", 27425 category: Diagnostics.Command_line_Options, 27426 description: Diagnostics.Build_all_projects_including_those_that_appear_to_be_up_to_date, 27427 type: "boolean", 27428 defaultValueDescription: false 27429 }, 27430 { 27431 name: "clean", 27432 category: Diagnostics.Command_line_Options, 27433 description: Diagnostics.Delete_the_outputs_of_all_projects, 27434 type: "boolean", 27435 defaultValueDescription: false 27436 } 27437]; 27438var buildOpts = [ 27439 ...commonOptionsWithBuild, 27440 ...optionsForBuild 27441]; 27442var typeAcquisitionDeclarations = [ 27443 { 27444 name: "enableAutoDiscovery", 27445 type: "boolean", 27446 defaultValueDescription: false 27447 }, 27448 { 27449 name: "enable", 27450 type: "boolean", 27451 defaultValueDescription: false 27452 }, 27453 { 27454 name: "include", 27455 type: "list", 27456 element: { 27457 name: "include", 27458 type: "string" 27459 } 27460 }, 27461 { 27462 name: "exclude", 27463 type: "list", 27464 element: { 27465 name: "exclude", 27466 type: "string" 27467 } 27468 }, 27469 { 27470 name: "disableFilenameBasedTypeAcquisition", 27471 type: "boolean", 27472 defaultValueDescription: false 27473 } 27474]; 27475function createOptionNameMap(optionDeclarations2) { 27476 const optionsNameMap = new Map2(); 27477 const shortOptionNames = new Map2(); 27478 forEach(optionDeclarations2, (option) => { 27479 optionsNameMap.set(option.name.toLowerCase(), option); 27480 if (option.shortName) { 27481 shortOptionNames.set(option.shortName, option.name); 27482 } 27483 }); 27484 return { optionsNameMap, shortOptionNames }; 27485} 27486var optionsNameMapCache; 27487function getOptionsNameMap() { 27488 return optionsNameMapCache || (optionsNameMapCache = createOptionNameMap(optionDeclarations)); 27489} 27490var compilerOptionsAlternateMode = { 27491 diagnostic: Diagnostics.Compiler_option_0_may_only_be_used_with_build, 27492 getOptionsNameMap: getBuildOptionsNameMap 27493}; 27494var defaultInitCompilerOptions = { 27495 module: 1 /* CommonJS */, 27496 target: 3 /* ES2016 */, 27497 strict: true, 27498 esModuleInterop: true, 27499 forceConsistentCasingInFileNames: true, 27500 skipLibCheck: true 27501}; 27502function createDiagnosticForInvalidCustomType(opt, createDiagnostic) { 27503 const namesOfType = arrayFrom(opt.type.keys()).map((key) => `'${key}'`).join(", "); 27504 return createDiagnostic(Diagnostics.Argument_for_0_option_must_be_Colon_1, `--${opt.name}`, namesOfType); 27505} 27506function getOptionName(option) { 27507 return option.name; 27508} 27509function createUnknownOptionError(unknownOption, diagnostics, createDiagnostics, unknownOptionErrorText) { 27510 var _a2; 27511 if ((_a2 = diagnostics.alternateMode) == null ? void 0 : _a2.getOptionsNameMap().optionsNameMap.has(unknownOption.toLowerCase())) { 27512 return createDiagnostics(diagnostics.alternateMode.diagnostic, unknownOption); 27513 } 27514 const possibleOption = getSpellingSuggestion(unknownOption, diagnostics.optionDeclarations, getOptionName); 27515 return possibleOption ? createDiagnostics(diagnostics.unknownDidYouMeanDiagnostic, unknownOptionErrorText || unknownOption, possibleOption.name) : createDiagnostics(diagnostics.unknownOptionDiagnostic, unknownOptionErrorText || unknownOption); 27516} 27517var compilerOptionsDidYouMeanDiagnostics = { 27518 alternateMode: compilerOptionsAlternateMode, 27519 getOptionsNameMap, 27520 optionDeclarations, 27521 unknownOptionDiagnostic: Diagnostics.Unknown_compiler_option_0, 27522 unknownDidYouMeanDiagnostic: Diagnostics.Unknown_compiler_option_0_Did_you_mean_1, 27523 optionTypeMismatchDiagnostic: Diagnostics.Compiler_option_0_expects_an_argument 27524}; 27525var buildOptionsNameMapCache; 27526function getBuildOptionsNameMap() { 27527 return buildOptionsNameMapCache || (buildOptionsNameMapCache = createOptionNameMap(buildOpts)); 27528} 27529var buildOptionsAlternateMode = { 27530 diagnostic: Diagnostics.Compiler_option_0_may_not_be_used_with_build, 27531 getOptionsNameMap 27532}; 27533var buildOptionsDidYouMeanDiagnostics = { 27534 alternateMode: buildOptionsAlternateMode, 27535 getOptionsNameMap: getBuildOptionsNameMap, 27536 optionDeclarations: buildOpts, 27537 unknownOptionDiagnostic: Diagnostics.Unknown_build_option_0, 27538 unknownDidYouMeanDiagnostic: Diagnostics.Unknown_build_option_0_Did_you_mean_1, 27539 optionTypeMismatchDiagnostic: Diagnostics.Build_option_0_requires_a_value_of_type_1 27540}; 27541function readConfigFile(fileName, readFile) { 27542 const textOrDiagnostic = tryReadFile(fileName, readFile); 27543 return isString(textOrDiagnostic) ? parseConfigFileTextToJson(fileName, textOrDiagnostic) : { config: {}, error: textOrDiagnostic }; 27544} 27545function parseConfigFileTextToJson(fileName, jsonText) { 27546 const jsonSourceFile = parseJsonText(fileName, jsonText); 27547 return { 27548 config: convertConfigFileToObject(jsonSourceFile, jsonSourceFile.parseDiagnostics, false, void 0), 27549 error: jsonSourceFile.parseDiagnostics.length ? jsonSourceFile.parseDiagnostics[0] : void 0 27550 }; 27551} 27552function tryReadFile(fileName, readFile) { 27553 let text; 27554 try { 27555 text = readFile(fileName); 27556 } catch (e) { 27557 return createCompilerDiagnostic(Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message); 27558 } 27559 return text === void 0 ? createCompilerDiagnostic(Diagnostics.Cannot_read_file_0, fileName) : text; 27560} 27561function commandLineOptionsToMap(options) { 27562 return arrayToMap(options, getOptionName); 27563} 27564var typeAcquisitionDidYouMeanDiagnostics = { 27565 optionDeclarations: typeAcquisitionDeclarations, 27566 unknownOptionDiagnostic: Diagnostics.Unknown_type_acquisition_option_0, 27567 unknownDidYouMeanDiagnostic: Diagnostics.Unknown_type_acquisition_option_0_Did_you_mean_1 27568}; 27569var watchOptionsNameMapCache; 27570function getWatchOptionsNameMap() { 27571 return watchOptionsNameMapCache || (watchOptionsNameMapCache = createOptionNameMap(optionsForWatch)); 27572} 27573var watchOptionsDidYouMeanDiagnostics = { 27574 getOptionsNameMap: getWatchOptionsNameMap, 27575 optionDeclarations: optionsForWatch, 27576 unknownOptionDiagnostic: Diagnostics.Unknown_watch_option_0, 27577 unknownDidYouMeanDiagnostic: Diagnostics.Unknown_watch_option_0_Did_you_mean_1, 27578 optionTypeMismatchDiagnostic: Diagnostics.Watch_option_0_requires_a_value_of_type_1 27579}; 27580var commandLineCompilerOptionsMapCache; 27581function getCommandLineCompilerOptionsMap() { 27582 return commandLineCompilerOptionsMapCache || (commandLineCompilerOptionsMapCache = commandLineOptionsToMap(optionDeclarations)); 27583} 27584var commandLineWatchOptionsMapCache; 27585function getCommandLineWatchOptionsMap() { 27586 return commandLineWatchOptionsMapCache || (commandLineWatchOptionsMapCache = commandLineOptionsToMap(optionsForWatch)); 27587} 27588var commandLineTypeAcquisitionMapCache; 27589function getCommandLineTypeAcquisitionMap() { 27590 return commandLineTypeAcquisitionMapCache || (commandLineTypeAcquisitionMapCache = commandLineOptionsToMap(typeAcquisitionDeclarations)); 27591} 27592var _tsconfigRootOptions; 27593function getTsconfigRootOptionsMap() { 27594 if (_tsconfigRootOptions === void 0) { 27595 _tsconfigRootOptions = { 27596 name: void 0, 27597 type: "object", 27598 elementOptions: commandLineOptionsToMap([ 27599 { 27600 name: "compilerOptions", 27601 type: "object", 27602 elementOptions: getCommandLineCompilerOptionsMap(), 27603 extraKeyDiagnostics: compilerOptionsDidYouMeanDiagnostics 27604 }, 27605 { 27606 name: "watchOptions", 27607 type: "object", 27608 elementOptions: getCommandLineWatchOptionsMap(), 27609 extraKeyDiagnostics: watchOptionsDidYouMeanDiagnostics 27610 }, 27611 { 27612 name: "typingOptions", 27613 type: "object", 27614 elementOptions: getCommandLineTypeAcquisitionMap(), 27615 extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics 27616 }, 27617 { 27618 name: "typeAcquisition", 27619 type: "object", 27620 elementOptions: getCommandLineTypeAcquisitionMap(), 27621 extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics 27622 }, 27623 { 27624 name: "extends", 27625 type: "string", 27626 category: Diagnostics.File_Management 27627 }, 27628 { 27629 name: "references", 27630 type: "list", 27631 element: { 27632 name: "references", 27633 type: "object" 27634 }, 27635 category: Diagnostics.Projects 27636 }, 27637 { 27638 name: "files", 27639 type: "list", 27640 element: { 27641 name: "files", 27642 type: "string" 27643 }, 27644 category: Diagnostics.File_Management 27645 }, 27646 { 27647 name: "include", 27648 type: "list", 27649 element: { 27650 name: "include", 27651 type: "string" 27652 }, 27653 category: Diagnostics.File_Management, 27654 defaultValueDescription: Diagnostics.if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk 27655 }, 27656 { 27657 name: "exclude", 27658 type: "list", 27659 element: { 27660 name: "exclude", 27661 type: "string" 27662 }, 27663 category: Diagnostics.File_Management, 27664 defaultValueDescription: Diagnostics.node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified 27665 }, 27666 compileOnSaveCommandLineOption 27667 ]) 27668 }; 27669 } 27670 return _tsconfigRootOptions; 27671} 27672function convertConfigFileToObject(sourceFile, errors, reportOptionsErrors, optionsIterator) { 27673 var _a2; 27674 const rootExpression = (_a2 = sourceFile.statements[0]) == null ? void 0 : _a2.expression; 27675 const knownRootOptions = reportOptionsErrors ? getTsconfigRootOptionsMap() : void 0; 27676 if (rootExpression && rootExpression.kind !== 210 /* ObjectLiteralExpression */) { 27677 errors.push(createDiagnosticForNodeInSourceFile( 27678 sourceFile, 27679 rootExpression, 27680 Diagnostics.The_root_value_of_a_0_file_must_be_an_object, 27681 getBaseFileName(sourceFile.fileName) === "jsconfig.json" ? "jsconfig.json" : "tsconfig.json" 27682 )); 27683 if (isArrayLiteralExpression(rootExpression)) { 27684 const firstObject = find(rootExpression.elements, isObjectLiteralExpression); 27685 if (firstObject) { 27686 return convertToObjectWorker(sourceFile, firstObject, errors, true, knownRootOptions, optionsIterator); 27687 } 27688 } 27689 return {}; 27690 } 27691 return convertToObjectWorker(sourceFile, rootExpression, errors, true, knownRootOptions, optionsIterator); 27692} 27693function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue, knownRootOptions, jsonConversionNotifier) { 27694 if (!rootExpression) { 27695 return returnValue ? {} : void 0; 27696 } 27697 return convertPropertyValueToJson(rootExpression, knownRootOptions); 27698 function isRootOptionMap(knownOptions) { 27699 return knownRootOptions && knownRootOptions.elementOptions === knownOptions; 27700 } 27701 function convertObjectLiteralExpressionToJson(node, knownOptions, extraKeyDiagnostics, parentOption) { 27702 const result = returnValue ? {} : void 0; 27703 for (const element of node.properties) { 27704 if (element.kind !== 305 /* PropertyAssignment */) { 27705 errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element, Diagnostics.Property_assignment_expected)); 27706 continue; 27707 } 27708 if (element.questionToken) { 27709 errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element.questionToken, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?")); 27710 } 27711 if (!isDoubleQuotedString(element.name)) { 27712 errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element.name, Diagnostics.String_literal_with_double_quotes_expected)); 27713 } 27714 const textOfKey = isComputedNonLiteralName(element.name) ? void 0 : getTextOfPropertyName(element.name); 27715 const keyText = textOfKey && unescapeLeadingUnderscores(textOfKey); 27716 const option = keyText && knownOptions ? knownOptions.get(keyText) : void 0; 27717 if (keyText && extraKeyDiagnostics && !option) { 27718 if (knownOptions) { 27719 errors.push(createUnknownOptionError( 27720 keyText, 27721 extraKeyDiagnostics, 27722 (message, arg0, arg1) => createDiagnosticForNodeInSourceFile(sourceFile, element.name, message, arg0, arg1) 27723 )); 27724 } else { 27725 errors.push(createDiagnosticForNodeInSourceFile(sourceFile, element.name, extraKeyDiagnostics.unknownOptionDiagnostic, keyText)); 27726 } 27727 } 27728 const value = convertPropertyValueToJson(element.initializer, option); 27729 if (typeof keyText !== "undefined") { 27730 if (returnValue) { 27731 result[keyText] = value; 27732 } 27733 if (jsonConversionNotifier && (parentOption || isRootOptionMap(knownOptions))) { 27734 const isValidOptionValue = isCompilerOptionsValue(option, value); 27735 if (parentOption) { 27736 if (isValidOptionValue) { 27737 jsonConversionNotifier.onSetValidOptionKeyValueInParent(parentOption, option, value); 27738 } 27739 } else if (isRootOptionMap(knownOptions)) { 27740 if (isValidOptionValue) { 27741 jsonConversionNotifier.onSetValidOptionKeyValueInRoot(keyText, element.name, value, element.initializer); 27742 } else if (!option) { 27743 jsonConversionNotifier.onSetUnknownOptionKeyValueInRoot(keyText, element.name, value, element.initializer); 27744 } 27745 } 27746 } 27747 } 27748 } 27749 return result; 27750 } 27751 function convertArrayLiteralExpressionToJson(elements, elementOption) { 27752 if (!returnValue) { 27753 elements.forEach((element) => convertPropertyValueToJson(element, elementOption)); 27754 return void 0; 27755 } 27756 return filter(elements.map((element) => convertPropertyValueToJson(element, elementOption)), (v) => v !== void 0); 27757 } 27758 function convertPropertyValueToJson(valueExpression, option) { 27759 let invalidReported; 27760 switch (valueExpression.kind) { 27761 case 111 /* TrueKeyword */: 27762 reportInvalidOptionValue(option && option.type !== "boolean"); 27763 return validateValue(true); 27764 case 96 /* FalseKeyword */: 27765 reportInvalidOptionValue(option && option.type !== "boolean"); 27766 return validateValue(false); 27767 case 105 /* NullKeyword */: 27768 reportInvalidOptionValue(option && option.name === "extends"); 27769 return validateValue(null); 27770 case 10 /* StringLiteral */: 27771 if (!isDoubleQuotedString(valueExpression)) { 27772 errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, Diagnostics.String_literal_with_double_quotes_expected)); 27773 } 27774 reportInvalidOptionValue(option && (isString(option.type) && option.type !== "string")); 27775 const text = valueExpression.text; 27776 if (option && !isString(option.type)) { 27777 const customOption = option; 27778 if (!customOption.type.has(text.toLowerCase())) { 27779 errors.push( 27780 createDiagnosticForInvalidCustomType( 27781 customOption, 27782 (message, arg0, arg1) => createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, message, arg0, arg1) 27783 ) 27784 ); 27785 invalidReported = true; 27786 } 27787 } 27788 return validateValue(text); 27789 case 8 /* NumericLiteral */: 27790 reportInvalidOptionValue(option && option.type !== "number"); 27791 return validateValue(Number(valueExpression.text)); 27792 case 225 /* PrefixUnaryExpression */: 27793 if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { 27794 break; 27795 } 27796 reportInvalidOptionValue(option && option.type !== "number"); 27797 return validateValue(-Number(valueExpression.operand.text)); 27798 case 210 /* ObjectLiteralExpression */: 27799 reportInvalidOptionValue(option && option.type !== "object"); 27800 const objectLiteralExpression = valueExpression; 27801 if (option) { 27802 const { elementOptions, extraKeyDiagnostics, name: optionName } = option; 27803 return validateValue(convertObjectLiteralExpressionToJson( 27804 objectLiteralExpression, 27805 elementOptions, 27806 extraKeyDiagnostics, 27807 optionName 27808 )); 27809 } else { 27810 return validateValue(convertObjectLiteralExpressionToJson( 27811 objectLiteralExpression, 27812 void 0, 27813 void 0, 27814 void 0 27815 )); 27816 } 27817 case 209 /* ArrayLiteralExpression */: 27818 reportInvalidOptionValue(option && option.type !== "list"); 27819 return validateValue(convertArrayLiteralExpressionToJson( 27820 valueExpression.elements, 27821 option && option.element 27822 )); 27823 } 27824 if (option) { 27825 reportInvalidOptionValue(true); 27826 } else { 27827 errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, Diagnostics.Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal)); 27828 } 27829 return void 0; 27830 function validateValue(value) { 27831 var _a2; 27832 if (!invalidReported) { 27833 const diagnostic = (_a2 = option == null ? void 0 : option.extraValidation) == null ? void 0 : _a2.call(option, value); 27834 if (diagnostic) { 27835 errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, ...diagnostic)); 27836 return void 0; 27837 } 27838 } 27839 return value; 27840 } 27841 function reportInvalidOptionValue(isError) { 27842 if (isError) { 27843 errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, Diagnostics.Compiler_option_0_requires_a_value_of_type_1, option.name, getCompilerOptionValueTypeString(option))); 27844 invalidReported = true; 27845 } 27846 } 27847 } 27848 function isDoubleQuotedString(node) { 27849 return isStringLiteral(node) && isStringDoubleQuoted(node, sourceFile); 27850 } 27851} 27852function getCompilerOptionValueTypeString(option) { 27853 return option.type === "list" ? "Array" : isString(option.type) ? option.type : "string"; 27854} 27855function isCompilerOptionsValue(option, value) { 27856 if (option) { 27857 if (isNullOrUndefined(value)) 27858 return true; 27859 if (option.type === "list") { 27860 return isArray(value); 27861 } 27862 const expectedType = isString(option.type) ? option.type : "string"; 27863 return typeof value === expectedType; 27864 } 27865 return false; 27866} 27867function isNullOrUndefined(x) { 27868 return x === void 0 || x === null; 27869} 27870var invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/; 27871function invalidDotDotAfterRecursiveWildcard(s) { 27872 const wildcardIndex = startsWith(s, "**/") ? 0 : s.indexOf("/**/"); 27873 if (wildcardIndex === -1) { 27874 return false; 27875 } 27876 const lastDotIndex = endsWith(s, "/..") ? s.length : s.lastIndexOf("/../"); 27877 return lastDotIndex > wildcardIndex; 27878} 27879function matchesExclude(pathToCheck, excludeSpecs, useCaseSensitiveFileNames, currentDirectory) { 27880 return matchesExcludeWorker( 27881 pathToCheck, 27882 filter(excludeSpecs, (spec) => !invalidDotDotAfterRecursiveWildcard(spec)), 27883 useCaseSensitiveFileNames, 27884 currentDirectory 27885 ); 27886} 27887function matchesExcludeWorker(pathToCheck, excludeSpecs, useCaseSensitiveFileNames, currentDirectory, basePath) { 27888 const excludePattern = getRegularExpressionForWildcard(excludeSpecs, combinePaths(normalizePath(currentDirectory), basePath), "exclude"); 27889 const excludeRegex = excludePattern && getRegexFromPattern(excludePattern, useCaseSensitiveFileNames); 27890 if (!excludeRegex) 27891 return false; 27892 if (excludeRegex.test(pathToCheck)) 27893 return true; 27894 return !hasExtension(pathToCheck) && excludeRegex.test(ensureTrailingDirectorySeparator(pathToCheck)); 27895} 27896function specToDiagnostic(spec, disallowTrailingRecursion) { 27897 if (disallowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { 27898 return [Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec]; 27899 } else if (invalidDotDotAfterRecursiveWildcard(spec)) { 27900 return [Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec]; 27901 } 27902} 27903 27904// src/compiler/moduleNameResolver.ts 27905function trace(host) { 27906 host.trace(formatMessage.apply(void 0, arguments)); 27907} 27908function isTraceEnabled(compilerOptions, host) { 27909 return !!compilerOptions.traceResolution && host.trace !== void 0; 27910} 27911function withPackageId(packageInfo, r) { 27912 let packageId; 27913 if (r && packageInfo) { 27914 const packageJsonContent = packageInfo.contents.packageJsonContent; 27915 if (typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string") { 27916 packageId = { 27917 name: packageJsonContent.name, 27918 subModuleName: r.path.slice(packageInfo.packageDirectory.length + directorySeparator.length), 27919 version: packageJsonContent.version 27920 }; 27921 } 27922 } 27923 return r && { path: r.path, extension: r.ext, packageId }; 27924} 27925function noPackageId(r) { 27926 return withPackageId(void 0, r); 27927} 27928function removeIgnoredPackageId(r) { 27929 if (r) { 27930 Debug.assert(r.packageId === void 0); 27931 return { path: r.path, ext: r.extension }; 27932 } 27933} 27934var Extensions = /* @__PURE__ */ ((Extensions2) => { 27935 Extensions2[Extensions2["TypeScript"] = 0] = "TypeScript"; 27936 Extensions2[Extensions2["JavaScript"] = 1] = "JavaScript"; 27937 Extensions2[Extensions2["Json"] = 2] = "Json"; 27938 Extensions2[Extensions2["TSConfig"] = 3] = "TSConfig"; 27939 Extensions2[Extensions2["DtsOnly"] = 4] = "DtsOnly"; 27940 Extensions2[Extensions2["TsOnly"] = 5] = "TsOnly"; 27941 return Extensions2; 27942})(Extensions || {}); 27943function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache) { 27944 if (resultFromCache) { 27945 resultFromCache.failedLookupLocations.push(...failedLookupLocations); 27946 resultFromCache.affectingLocations.push(...affectingLocations); 27947 return resultFromCache; 27948 } 27949 return { 27950 resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: resolved.originalPath === true ? void 0 : resolved.originalPath, extension: resolved.extension, isExternalLibraryImport, packageId: resolved.packageId }, 27951 failedLookupLocations, 27952 affectingLocations, 27953 resolutionDiagnostics: diagnostics 27954 }; 27955} 27956function readPackageJsonField(jsonContent, fieldName, typeOfTag, state) { 27957 if (!hasProperty(jsonContent, fieldName)) { 27958 if (state.traceEnabled) { 27959 const message = isOhpm(state.compilerOptions.packageManagerType) ? Diagnostics.oh_package_json5_does_not_have_a_0_field : Diagnostics.package_json_does_not_have_a_0_field; 27960 trace(state.host, message, fieldName); 27961 } 27962 return; 27963 } 27964 const value = jsonContent[fieldName]; 27965 if (typeof value !== typeOfTag || value === null) { 27966 if (state.traceEnabled) { 27967 trace(state.host, Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, fieldName, typeOfTag, value === null ? "null" : typeof value); 27968 } 27969 return; 27970 } 27971 return value; 27972} 27973function readPackageJsonPathField(jsonContent, fieldName, baseDirectory, state) { 27974 const fileName = readPackageJsonField(jsonContent, fieldName, "string", state); 27975 if (fileName === void 0) { 27976 return; 27977 } 27978 if (!fileName) { 27979 if (state.traceEnabled) { 27980 trace(state.host, Diagnostics.package_json_had_a_falsy_0_field, fieldName); 27981 } 27982 return; 27983 } 27984 const path2 = normalizePath(combinePaths(baseDirectory, fileName)); 27985 if (state.traceEnabled) { 27986 const message = isOhpm(state.compilerOptions.packageManagerType) ? Diagnostics.oh_package_json5_has_0_field_1_that_references_2 : Diagnostics.package_json_has_0_field_1_that_references_2; 27987 trace(state.host, message, fieldName, fileName, path2); 27988 } 27989 return path2; 27990} 27991function readPackageJsonTypesFields(jsonContent, baseDirectory, state) { 27992 return readPackageJsonPathField(jsonContent, "typings", baseDirectory, state) || readPackageJsonPathField(jsonContent, "types", baseDirectory, state); 27993} 27994function readPackageJsonTSConfigField(jsonContent, baseDirectory, state) { 27995 return readPackageJsonPathField(jsonContent, "tsconfig", baseDirectory, state); 27996} 27997function readPackageJsonMainField(jsonContent, baseDirectory, state) { 27998 return readPackageJsonPathField(jsonContent, "main", baseDirectory, state); 27999} 28000function readPackageJsonTypesVersionsField(jsonContent, state) { 28001 const typesVersions = readPackageJsonField(jsonContent, "typesVersions", "object", state); 28002 if (typesVersions === void 0) 28003 return; 28004 if (state.traceEnabled) { 28005 trace(state.host, Diagnostics.package_json_has_a_typesVersions_field_with_version_specific_path_mappings); 28006 } 28007 return typesVersions; 28008} 28009function readPackageJsonTypesVersionPaths(jsonContent, state) { 28010 const typesVersions = readPackageJsonTypesVersionsField(jsonContent, state); 28011 if (typesVersions === void 0) 28012 return; 28013 if (state.traceEnabled) { 28014 for (const key in typesVersions) { 28015 if (hasProperty(typesVersions, key) && !VersionRange.tryParse(key)) { 28016 trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_is_not_a_valid_semver_range, key); 28017 } 28018 } 28019 } 28020 const result = getPackageJsonTypesVersionsPaths(typesVersions); 28021 if (!result) { 28022 if (state.traceEnabled) { 28023 trace(state.host, Diagnostics.package_json_does_not_have_a_typesVersions_entry_that_matches_version_0, versionMajorMinor); 28024 } 28025 return; 28026 } 28027 const { version: bestVersionKey, paths: bestVersionPaths } = result; 28028 if (typeof bestVersionPaths !== "object") { 28029 if (state.traceEnabled) { 28030 trace(state.host, Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, `typesVersions['${bestVersionKey}']`, "object", typeof bestVersionPaths); 28031 } 28032 return; 28033 } 28034 return result; 28035} 28036var typeScriptVersion; 28037function getPackageJsonTypesVersionsPaths(typesVersions) { 28038 if (!typeScriptVersion) 28039 typeScriptVersion = new Version(version); 28040 for (const key in typesVersions) { 28041 if (!hasProperty(typesVersions, key)) 28042 continue; 28043 const keyRange = VersionRange.tryParse(key); 28044 if (keyRange === void 0) { 28045 continue; 28046 } 28047 if (keyRange.test(typeScriptVersion)) { 28048 return { version: key, paths: typesVersions[key] }; 28049 } 28050 } 28051} 28052function arePathsEqual(path1, path2, host) { 28053 const useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames; 28054 return comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0 /* EqualTo */; 28055} 28056function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { 28057 const traceEnabled = isTraceEnabled(compilerOptions, host); 28058 if (redirectedReference) { 28059 compilerOptions = redirectedReference.commandLine.options; 28060 } 28061 if (traceEnabled) { 28062 trace(host, Diagnostics.Resolving_module_0_from_1, moduleName, containingFile); 28063 if (redirectedReference) { 28064 trace(host, Diagnostics.Using_compiler_options_of_project_reference_redirect_0, redirectedReference.sourceFile.fileName); 28065 } 28066 } 28067 const containingDirectory = getDirectoryPath(containingFile); 28068 const perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference); 28069 let result = perFolderCache && perFolderCache.get(moduleName, resolutionMode); 28070 if (result) { 28071 if (traceEnabled) { 28072 trace(host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory); 28073 } 28074 } else { 28075 let moduleResolution = compilerOptions.moduleResolution; 28076 if (moduleResolution === void 0) { 28077 switch (getEmitModuleKind(compilerOptions)) { 28078 case 1 /* CommonJS */: 28079 moduleResolution = 2 /* NodeJs */; 28080 break; 28081 case 100 /* Node16 */: 28082 moduleResolution = 3 /* Node16 */; 28083 break; 28084 case 199 /* NodeNext */: 28085 moduleResolution = 99 /* NodeNext */; 28086 break; 28087 default: 28088 moduleResolution = 1 /* Classic */; 28089 break; 28090 } 28091 if (traceEnabled) { 28092 trace(host, Diagnostics.Module_resolution_kind_is_not_specified_using_0, ModuleResolutionKind[moduleResolution]); 28093 } 28094 } else { 28095 if (traceEnabled) { 28096 trace(host, Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ModuleResolutionKind[moduleResolution]); 28097 } 28098 } 28099 perfLogger.logStartResolveModule(moduleName); 28100 switch (moduleResolution) { 28101 case 3 /* Node16 */: 28102 result = node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); 28103 break; 28104 case 99 /* NodeNext */: 28105 result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode); 28106 break; 28107 case 2 /* NodeJs */: 28108 result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference); 28109 break; 28110 case 1 /* Classic */: 28111 result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference); 28112 break; 28113 default: 28114 return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`); 28115 } 28116 if (result && result.resolvedModule) 28117 perfLogger.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`); 28118 perfLogger.logStopResolveModule(result && result.resolvedModule ? "" + result.resolvedModule.resolvedFileName : "null"); 28119 if (perFolderCache) { 28120 perFolderCache.set(moduleName, resolutionMode, result); 28121 if (!isExternalModuleNameRelative(moduleName)) { 28122 cache.getOrCreateCacheForModuleName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result); 28123 } 28124 } 28125 } 28126 if (traceEnabled) { 28127 if (result.resolvedModule) { 28128 if (result.resolvedModule.packageId) { 28129 trace(host, Diagnostics.Module_name_0_was_successfully_resolved_to_1_with_Package_ID_2, moduleName, result.resolvedModule.resolvedFileName, packageIdToString(result.resolvedModule.packageId)); 28130 } else { 28131 trace(host, Diagnostics.Module_name_0_was_successfully_resolved_to_1, moduleName, result.resolvedModule.resolvedFileName); 28132 } 28133 } else { 28134 trace(host, Diagnostics.Module_name_0_was_not_resolved, moduleName); 28135 } 28136 } 28137 return result; 28138} 28139function tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loader, state) { 28140 const resolved = tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state); 28141 if (resolved) 28142 return resolved.value; 28143 if (!isExternalModuleNameRelative(moduleName)) { 28144 return tryLoadModuleUsingBaseUrl(extensions, moduleName, loader, state); 28145 } else { 28146 return tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, state); 28147 } 28148} 28149function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state) { 28150 var _a2; 28151 const { baseUrl, paths, configFile } = state.compilerOptions; 28152 if (paths && !pathIsRelative(moduleName)) { 28153 if (state.traceEnabled) { 28154 if (baseUrl) { 28155 trace(state.host, Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName); 28156 } 28157 trace(state.host, Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName); 28158 } 28159 const baseDirectory = getPathsBasePath(state.compilerOptions, state.host); 28160 const pathPatterns = (configFile == null ? void 0 : configFile.configFileSpecs) ? (_a2 = configFile.configFileSpecs).pathPatterns || (_a2.pathPatterns = tryParsePatterns(paths)) : void 0; 28161 return tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, pathPatterns, loader, false, state); 28162 } 28163} 28164function tryLoadModuleUsingRootDirs(extensions, moduleName, containingDirectory, loader, state) { 28165 if (!state.compilerOptions.rootDirs) { 28166 return void 0; 28167 } 28168 if (state.traceEnabled) { 28169 trace(state.host, Diagnostics.rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0, moduleName); 28170 } 28171 const candidate = normalizePath(combinePaths(containingDirectory, moduleName)); 28172 let matchedRootDir; 28173 let matchedNormalizedPrefix; 28174 for (const rootDir of state.compilerOptions.rootDirs) { 28175 let normalizedRoot = normalizePath(rootDir); 28176 if (!endsWith(normalizedRoot, directorySeparator)) { 28177 normalizedRoot += directorySeparator; 28178 } 28179 const isLongestMatchingPrefix = startsWith(candidate, normalizedRoot) && (matchedNormalizedPrefix === void 0 || matchedNormalizedPrefix.length < normalizedRoot.length); 28180 if (state.traceEnabled) { 28181 trace(state.host, Diagnostics.Checking_if_0_is_the_longest_matching_prefix_for_1_2, normalizedRoot, candidate, isLongestMatchingPrefix); 28182 } 28183 if (isLongestMatchingPrefix) { 28184 matchedNormalizedPrefix = normalizedRoot; 28185 matchedRootDir = rootDir; 28186 } 28187 } 28188 if (matchedNormalizedPrefix) { 28189 if (state.traceEnabled) { 28190 trace(state.host, Diagnostics.Longest_matching_prefix_for_0_is_1, candidate, matchedNormalizedPrefix); 28191 } 28192 const suffix = candidate.substr(matchedNormalizedPrefix.length); 28193 if (state.traceEnabled) { 28194 trace(state.host, Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, matchedNormalizedPrefix, candidate); 28195 } 28196 const resolvedFileName = loader(extensions, candidate, !directoryProbablyExists(containingDirectory, state.host), state); 28197 if (resolvedFileName) { 28198 return resolvedFileName; 28199 } 28200 if (state.traceEnabled) { 28201 trace(state.host, Diagnostics.Trying_other_entries_in_rootDirs); 28202 } 28203 for (const rootDir of state.compilerOptions.rootDirs) { 28204 if (rootDir === matchedRootDir) { 28205 continue; 28206 } 28207 const candidate2 = combinePaths(normalizePath(rootDir), suffix); 28208 if (state.traceEnabled) { 28209 trace(state.host, Diagnostics.Loading_0_from_the_root_dir_1_candidate_location_2, suffix, rootDir, candidate2); 28210 } 28211 const baseDirectory = getDirectoryPath(candidate2); 28212 const resolvedFileName2 = loader(extensions, candidate2, !directoryProbablyExists(baseDirectory, state.host), state); 28213 if (resolvedFileName2) { 28214 return resolvedFileName2; 28215 } 28216 } 28217 if (state.traceEnabled) { 28218 trace(state.host, Diagnostics.Module_resolution_using_rootDirs_has_failed); 28219 } 28220 } 28221 return void 0; 28222} 28223function tryLoadModuleUsingBaseUrl(extensions, moduleName, loader, state) { 28224 const { baseUrl } = state.compilerOptions; 28225 if (!baseUrl) { 28226 return void 0; 28227 } 28228 if (state.traceEnabled) { 28229 trace(state.host, Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, baseUrl, moduleName); 28230 } 28231 const candidate = normalizePath(combinePaths(baseUrl, moduleName)); 28232 if (state.traceEnabled) { 28233 trace(state.host, Diagnostics.Resolving_module_name_0_relative_to_base_url_1_2, moduleName, baseUrl, candidate); 28234 } 28235 return loader(extensions, candidate, !directoryProbablyExists(getDirectoryPath(candidate), state.host), state); 28236} 28237function resolveJSModule(moduleName, initialDir, host) { 28238 const { resolvedModule, failedLookupLocations } = tryResolveJSModuleWorker(moduleName, initialDir, host); 28239 if (!resolvedModule) { 28240 throw new Error(`Could not resolve JS module '${moduleName}' starting at '${initialDir}'. Looked in: ${failedLookupLocations.join(", ")}`); 28241 } 28242 return resolvedModule.resolvedFileName; 28243} 28244function node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { 28245 return nodeNextModuleNameResolverWorker( 28246 30 /* Node16Default */, 28247 moduleName, 28248 containingFile, 28249 compilerOptions, 28250 host, 28251 cache, 28252 redirectedReference, 28253 resolutionMode 28254 ); 28255} 28256function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { 28257 return nodeNextModuleNameResolverWorker( 28258 30 /* NodeNextDefault */, 28259 moduleName, 28260 containingFile, 28261 compilerOptions, 28262 host, 28263 cache, 28264 redirectedReference, 28265 resolutionMode 28266 ); 28267} 28268var jsOnlyExtensions = [1 /* JavaScript */]; 28269var tsExtensions = [0 /* TypeScript */, 1 /* JavaScript */]; 28270var tsPlusJsonExtensions = [...tsExtensions, 2 /* Json */]; 28271var tsconfigExtensions = [3 /* TSConfig */]; 28272function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) { 28273 const containingDirectory = getDirectoryPath(containingFile); 28274 const esmMode = resolutionMode === 99 /* ESNext */ ? 32 /* EsmMode */ : 0; 28275 let extensions = compilerOptions.noDtsResolution ? [5 /* TsOnly */, 1 /* JavaScript */] : tsExtensions; 28276 if (compilerOptions.resolveJsonModule) { 28277 extensions = [...extensions, 2 /* Json */]; 28278 } 28279 return nodeModuleNameResolverWorker(features | esmMode, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference); 28280} 28281function tryResolveJSModuleWorker(moduleName, initialDir, host) { 28282 return nodeModuleNameResolverWorker(0 /* None */, moduleName, initialDir, { moduleResolution: 2 /* NodeJs */, allowJs: true }, host, void 0, jsOnlyExtensions, void 0); 28283} 28284function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, lookupConfig) { 28285 let extensions; 28286 if (lookupConfig) { 28287 extensions = tsconfigExtensions; 28288 } else if (compilerOptions.noDtsResolution) { 28289 extensions = [5 /* TsOnly */]; 28290 if (compilerOptions.allowJs) 28291 extensions.push(1 /* JavaScript */); 28292 if (compilerOptions.resolveJsonModule) 28293 extensions.push(2 /* Json */); 28294 } else { 28295 extensions = compilerOptions.resolveJsonModule ? tsPlusJsonExtensions : tsExtensions; 28296 } 28297 return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, redirectedReference); 28298} 28299function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, redirectedReference) { 28300 var _a2, _b; 28301 const traceEnabled = isTraceEnabled(compilerOptions, host); 28302 const failedLookupLocations = []; 28303 const affectingLocations = []; 28304 const conditions = features & 32 /* EsmMode */ ? ["node", "import", "types"] : ["node", "require", "types"]; 28305 if (compilerOptions.noDtsResolution) { 28306 conditions.pop(); 28307 } 28308 const diagnostics = []; 28309 const state = { 28310 compilerOptions, 28311 host, 28312 traceEnabled, 28313 failedLookupLocations, 28314 affectingLocations, 28315 packageJsonInfoCache: cache, 28316 features, 28317 conditions, 28318 requestContainingDirectory: containingDirectory, 28319 reportDiagnostic: (diag2) => void diagnostics.push(diag2) 28320 }; 28321 if (traceEnabled && getEmitModuleResolutionKind(compilerOptions) >= 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) <= 99 /* NodeNext */) { 28322 trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", ")); 28323 } 28324 const result = forEach(extensions, (ext) => tryResolve(ext)); 28325 return createResolvedModuleWithFailedLookupLocations( 28326 (_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.resolved, 28327 (_b = result == null ? void 0 : result.value) == null ? void 0 : _b.isExternalLibraryImport, 28328 failedLookupLocations, 28329 affectingLocations, 28330 diagnostics, 28331 state.resultFromCache 28332 ); 28333 function tryResolve(extensions2) { 28334 const loader = (extensions3, candidate, onlyRecordFailures, state2) => nodeLoadModuleByRelativeName(extensions3, candidate, onlyRecordFailures, state2, true); 28335 const isOHModules2 = isOhpm(compilerOptions.packageManagerType); 28336 const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state); 28337 if (resolved) { 28338 return toSearchResult({ resolved, isExternalLibraryImport: isOHModules2 ? pathContainsOHModules(resolved.path) : pathContainsNodeModules(resolved.path) }); 28339 } 28340 if (!isExternalModuleNameRelative(moduleName)) { 28341 let resolved2; 28342 if (features & 2 /* Imports */ && startsWith(moduleName, "#")) { 28343 resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); 28344 } 28345 if (!resolved2 && features & 4 /* SelfName */) { 28346 resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); 28347 } 28348 if (!resolved2) { 28349 if (traceEnabled) { 28350 const message = isOHModules2 ? Diagnostics.Loading_module_0_from_oh_modules_folder_target_file_type_1 : Diagnostics.Loading_module_0_from_node_modules_folder_target_file_type_1; 28351 trace(host, message, moduleName, Extensions[extensions2]); 28352 } 28353 resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state, cache, redirectedReference); 28354 } 28355 if (!resolved2) 28356 return void 0; 28357 let resolvedValue = resolved2.value; 28358 if (!compilerOptions.preserveSymlinks && resolvedValue && !resolvedValue.originalPath) { 28359 const path2 = realPath(resolvedValue.path, host, traceEnabled); 28360 const pathsAreEqual = arePathsEqual(path2, resolvedValue.path, host); 28361 const originalPath = pathsAreEqual ? void 0 : resolvedValue.path; 28362 resolvedValue = { ...resolvedValue, path: pathsAreEqual ? resolvedValue.path : path2, originalPath }; 28363 } 28364 return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; 28365 } else { 28366 const { path: candidate, parts } = normalizePathForCJSResolution(containingDirectory, moduleName); 28367 const resolved2 = nodeLoadModuleByRelativeName(extensions2, candidate, false, state, true); 28368 return resolved2 && toSearchResult({ resolved: resolved2, isExternalLibraryImport: contains(parts, getModuleByPMType(compilerOptions.packageManagerType)) }); 28369 } 28370 } 28371} 28372function normalizePathForCJSResolution(containingDirectory, moduleName) { 28373 const combined = combinePaths(containingDirectory, moduleName); 28374 const parts = getPathComponents(combined); 28375 const lastPart = lastOrUndefined(parts); 28376 const path2 = lastPart === "." || lastPart === ".." ? ensureTrailingDirectorySeparator(normalizePath(combined)) : normalizePath(combined); 28377 return { path: path2, parts }; 28378} 28379function realPath(path2, host, traceEnabled) { 28380 if (!host.realpath) { 28381 return path2; 28382 } 28383 const real = normalizePath(host.realpath(path2)); 28384 if (traceEnabled) { 28385 trace(host, Diagnostics.Resolving_real_path_for_0_result_1, path2, real); 28386 } 28387 Debug.assert(host.fileExists(real), `${path2} linked to nonexistent file ${real}`); 28388 return real; 28389} 28390function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) { 28391 if (state.traceEnabled) { 28392 trace(state.host, Diagnostics.Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1, candidate, Extensions[extensions]); 28393 } 28394 if (!hasTrailingDirectorySeparator(candidate)) { 28395 if (!onlyRecordFailures) { 28396 const parentOfCandidate = getDirectoryPath(candidate); 28397 if (!directoryProbablyExists(parentOfCandidate, state.host)) { 28398 if (state.traceEnabled) { 28399 trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, parentOfCandidate); 28400 } 28401 onlyRecordFailures = true; 28402 } 28403 } 28404 const resolvedFromFile = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state); 28405 if (resolvedFromFile) { 28406 const packageDirectory = considerPackageJson ? parseModuleFromPath(resolvedFromFile.path, state.compilerOptions.packageManagerType) : void 0; 28407 const packageInfo = packageDirectory ? getPackageJsonInfo(packageDirectory, false, state) : void 0; 28408 return withPackageId(packageInfo, resolvedFromFile); 28409 } 28410 } 28411 if (!onlyRecordFailures) { 28412 const candidateExists = directoryProbablyExists(candidate, state.host); 28413 if (!candidateExists) { 28414 if (state.traceEnabled) { 28415 trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, candidate); 28416 } 28417 onlyRecordFailures = true; 28418 } 28419 } 28420 if (!(state.features & 32 /* EsmMode */)) { 28421 return loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson); 28422 } 28423 return void 0; 28424} 28425var nodeModulesPathPart = "/node_modules/"; 28426function pathContainsNodeModules(path2) { 28427 return stringContains(path2, nodeModulesPathPart); 28428} 28429function parseModuleFromPath(resolved, packageManagerType) { 28430 const modulesPathPart = getModulePathPartByPMType(packageManagerType); 28431 const path2 = normalizePath(resolved); 28432 const idx = path2.lastIndexOf(modulesPathPart); 28433 if (idx === -1) { 28434 return void 0; 28435 } 28436 const indexAfterModules = idx + modulesPathPart.length; 28437 let indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path2, indexAfterModules); 28438 if (path2.charCodeAt(indexAfterModules) === 64 /* at */) { 28439 indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path2, indexAfterPackageName); 28440 } 28441 return path2.slice(0, indexAfterPackageName); 28442} 28443function moveToNextDirectorySeparatorIfAvailable(path2, prevSeparatorIndex) { 28444 const nextSeparatorIndex = path2.indexOf(directorySeparator, prevSeparatorIndex + 1); 28445 return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex; 28446} 28447function loadModuleFromFileNoPackageId(extensions, candidate, onlyRecordFailures, state) { 28448 return noPackageId(loadModuleFromFile(extensions, candidate, onlyRecordFailures, state)); 28449} 28450function loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) { 28451 if (extensions === 2 /* Json */ || extensions === 3 /* TSConfig */) { 28452 const extensionLess = tryRemoveExtension(candidate, ".json" /* Json */); 28453 const extension = extensionLess ? candidate.substring(extensionLess.length) : ""; 28454 return extensionLess === void 0 && extensions === 2 /* Json */ ? void 0 : tryAddingExtensions(extensionLess || candidate, extensions, extension, onlyRecordFailures, state); 28455 } 28456 if (!(state.features & 32 /* EsmMode */)) { 28457 const resolvedByAddingExtension = tryAddingExtensions(candidate, extensions, "", onlyRecordFailures, state); 28458 if (resolvedByAddingExtension) { 28459 return resolvedByAddingExtension; 28460 } 28461 } 28462 return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state); 28463} 28464function loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state) { 28465 if (hasJSFileExtension(candidate) || fileExtensionIs(candidate, ".json" /* Json */) && state.compilerOptions.resolveJsonModule) { 28466 const extensionless = removeFileExtension(candidate); 28467 const extension = candidate.substring(extensionless.length); 28468 if (state.traceEnabled) { 28469 trace(state.host, Diagnostics.File_name_0_has_a_1_extension_stripping_it, candidate, extension); 28470 } 28471 return tryAddingExtensions(extensionless, extensions, extension, onlyRecordFailures, state); 28472 } 28473} 28474function loadJSOrExactTSFileName(extensions, candidate, onlyRecordFailures, state) { 28475 if ((extensions === 0 /* TypeScript */ || extensions === 4 /* DtsOnly */) && fileExtensionIsOneOf(candidate, supportedTSExtensionsFlat)) { 28476 const result = tryFile(candidate, onlyRecordFailures, state); 28477 return result !== void 0 ? { path: candidate, ext: tryExtractTSExtension(candidate) } : void 0; 28478 } 28479 return loadModuleFromFileNoImplicitExtensions(extensions, candidate, onlyRecordFailures, state); 28480} 28481function tryAddingExtensions(candidate, extensions, originalExtension, onlyRecordFailures, state) { 28482 if (!onlyRecordFailures) { 28483 const directory = getDirectoryPath(candidate); 28484 if (directory) { 28485 onlyRecordFailures = !directoryProbablyExists(directory, state.host); 28486 } 28487 } 28488 switch (extensions) { 28489 case 4 /* DtsOnly */: 28490 switch (originalExtension) { 28491 case ".mjs" /* Mjs */: 28492 case ".mts" /* Mts */: 28493 case ".d.mts" /* Dmts */: 28494 return tryExtension(".d.mts" /* Dmts */); 28495 case ".cjs" /* Cjs */: 28496 case ".cts" /* Cts */: 28497 case ".d.cts" /* Dcts */: 28498 return tryExtension(".d.cts" /* Dcts */); 28499 case ".json" /* Json */: 28500 candidate += ".json" /* Json */; 28501 return tryExtension(".d.ts" /* Dts */); 28502 default: 28503 return state.compilerOptions.ets ? tryExtension(".d.ets" /* Dets */) || tryExtension(".d.ts" /* Dts */) : tryExtension(".d.ts" /* Dts */); 28504 } 28505 case 0 /* TypeScript */: 28506 case 5 /* TsOnly */: 28507 const useDts = extensions === 0 /* TypeScript */; 28508 switch (originalExtension) { 28509 case ".mjs" /* Mjs */: 28510 case ".mts" /* Mts */: 28511 case ".d.mts" /* Dmts */: 28512 return tryExtension(".mts" /* Mts */) || (useDts ? tryExtension(".d.mts" /* Dmts */) : void 0); 28513 case ".cjs" /* Cjs */: 28514 case ".cts" /* Cts */: 28515 case ".d.cts" /* Dcts */: 28516 return tryExtension(".cts" /* Cts */) || (useDts ? tryExtension(".d.cts" /* Dcts */) : void 0); 28517 case ".json" /* Json */: 28518 candidate += ".json" /* Json */; 28519 return useDts ? tryExtension(".d.ts" /* Dts */) : void 0; 28520 default: 28521 if (state.compilerOptions.ets) { 28522 return tryExtension(".ets" /* Ets */) || tryExtension(".ts" /* Ts */) || tryExtension(".tsx" /* Tsx */) || (useDts ? tryExtension(".d.ets" /* Dets */) || tryExtension(".d.ts" /* Dts */) : void 0); 28523 } else { 28524 return tryExtension(".ts" /* Ts */) || tryExtension(".tsx" /* Tsx */) || (useDts ? tryExtension(".d.ts" /* Dts */) || tryExtension(".ets" /* Ets */) || tryExtension(".d.ets" /* Dets */) : void 0); 28525 } 28526 } 28527 case 1 /* JavaScript */: 28528 switch (originalExtension) { 28529 case ".mjs" /* Mjs */: 28530 case ".mts" /* Mts */: 28531 case ".d.mts" /* Dmts */: 28532 return tryExtension(".mjs" /* Mjs */); 28533 case ".cjs" /* Cjs */: 28534 case ".cts" /* Cts */: 28535 case ".d.cts" /* Dcts */: 28536 return tryExtension(".cjs" /* Cjs */); 28537 case ".json" /* Json */: 28538 return tryExtension(".json" /* Json */); 28539 default: 28540 return tryExtension(".js" /* Js */) || tryExtension(".jsx" /* Jsx */); 28541 } 28542 case 3 /* TSConfig */: 28543 case 2 /* Json */: 28544 return tryExtension(".json" /* Json */); 28545 } 28546 function tryExtension(ext) { 28547 const path2 = tryFile(candidate + ext, onlyRecordFailures, state); 28548 return path2 === void 0 ? void 0 : { path: path2, ext }; 28549 } 28550} 28551function tryFile(fileName, onlyRecordFailures, state) { 28552 var _a2, _b; 28553 if (!((_a2 = state.compilerOptions.moduleSuffixes) == null ? void 0 : _a2.length)) { 28554 return tryFileLookup(fileName, onlyRecordFailures, state); 28555 } 28556 const ext = (_b = tryGetExtensionFromPath2(fileName)) != null ? _b : ""; 28557 const fileNameNoExtension = ext ? removeExtension(fileName, ext) : fileName; 28558 return forEach(state.compilerOptions.moduleSuffixes, (suffix) => tryFileLookup(fileNameNoExtension + suffix + ext, onlyRecordFailures, state)); 28559} 28560function tryFileLookup(fileName, onlyRecordFailures, state) { 28561 if (!onlyRecordFailures) { 28562 if (state.host.fileExists(fileName)) { 28563 if (state.traceEnabled) { 28564 trace(state.host, Diagnostics.File_0_exist_use_it_as_a_name_resolution_result, fileName); 28565 } 28566 return fileName; 28567 } else { 28568 if (state.traceEnabled) { 28569 trace(state.host, Diagnostics.File_0_does_not_exist, fileName); 28570 } 28571 } 28572 } 28573 state.failedLookupLocations.push(fileName); 28574 return void 0; 28575} 28576function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson = true) { 28577 const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0; 28578 const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent; 28579 const versionPaths = packageInfo && packageInfo.contents.versionPaths; 28580 return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths)); 28581} 28582function getPackageScopeForPath(fileName, state) { 28583 const parts = getPathComponents(fileName); 28584 parts.pop(); 28585 while (parts.length > 0) { 28586 const pkg = getPackageJsonInfo(getPathFromPathComponents(parts), false, state); 28587 if (pkg) { 28588 return pkg; 28589 } 28590 parts.pop(); 28591 } 28592 return void 0; 28593} 28594function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) { 28595 var _a2, _b, _c; 28596 const { host, traceEnabled } = state; 28597 const packageJsonPath = combinePaths(packageDirectory, getPackageJsonByPMType(state.compilerOptions.packageManagerType)); 28598 if (onlyRecordFailures) { 28599 state.failedLookupLocations.push(packageJsonPath); 28600 return void 0; 28601 } 28602 const existing = (_a2 = state.packageJsonInfoCache) == null ? void 0 : _a2.getPackageJsonInfo(packageJsonPath); 28603 if (existing !== void 0) { 28604 if (typeof existing !== "boolean") { 28605 if (traceEnabled) 28606 trace(host, Diagnostics.File_0_exists_according_to_earlier_cached_lookups, packageJsonPath); 28607 state.affectingLocations.push(packageJsonPath); 28608 return existing.packageDirectory === packageDirectory ? existing : { packageDirectory, contents: existing.contents }; 28609 } else { 28610 if (existing && traceEnabled) 28611 trace(host, Diagnostics.File_0_does_not_exist_according_to_earlier_cached_lookups, packageJsonPath); 28612 state.failedLookupLocations.push(packageJsonPath); 28613 return void 0; 28614 } 28615 } 28616 const directoryExists = directoryProbablyExists(packageDirectory, host); 28617 if (directoryExists && host.fileExists(packageJsonPath)) { 28618 const isOHModules2 = isOhpm(state.compilerOptions.packageManagerType); 28619 const packageJsonContent = isOHModules2 ? require("json5").parse(host.readFile(packageJsonPath)) : readJson(packageJsonPath, host); 28620 if (traceEnabled) { 28621 const message = isOHModules2 ? Diagnostics.Found_oh_package_json5_at_0 : Diagnostics.Found_package_json_at_0; 28622 trace(host, message, packageJsonPath); 28623 } 28624 const versionPaths = readPackageJsonTypesVersionPaths(packageJsonContent, state); 28625 const result = { packageDirectory, contents: { packageJsonContent, versionPaths, resolvedEntrypoints: void 0 } }; 28626 (_b = state.packageJsonInfoCache) == null ? void 0 : _b.setPackageJsonInfo(packageJsonPath, result); 28627 state.affectingLocations.push(packageJsonPath); 28628 return result; 28629 } else { 28630 if (directoryExists && traceEnabled) { 28631 trace(host, Diagnostics.File_0_does_not_exist, packageJsonPath); 28632 } 28633 (_c = state.packageJsonInfoCache) == null ? void 0 : _c.setPackageJsonInfo(packageJsonPath, directoryExists); 28634 state.failedLookupLocations.push(packageJsonPath); 28635 } 28636} 28637function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, jsonContent, versionPaths) { 28638 let packageFile; 28639 if (jsonContent) { 28640 switch (extensions) { 28641 case 1 /* JavaScript */: 28642 case 2 /* Json */: 28643 case 5 /* TsOnly */: 28644 packageFile = readPackageJsonMainField(jsonContent, candidate, state); 28645 break; 28646 case 0 /* TypeScript */: 28647 packageFile = readPackageJsonTypesFields(jsonContent, candidate, state) || readPackageJsonMainField(jsonContent, candidate, state); 28648 break; 28649 case 4 /* DtsOnly */: 28650 packageFile = readPackageJsonTypesFields(jsonContent, candidate, state); 28651 break; 28652 case 3 /* TSConfig */: 28653 packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state); 28654 break; 28655 default: 28656 return Debug.assertNever(extensions); 28657 } 28658 } 28659 const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => { 28660 const fromFile = tryFile(candidate2, onlyRecordFailures2, state2); 28661 if (fromFile) { 28662 const resolved = resolvedIfExtensionMatches(extensions2, fromFile); 28663 if (resolved) { 28664 return noPackageId(resolved); 28665 } 28666 if (state2.traceEnabled) { 28667 trace(state2.host, Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile); 28668 } 28669 } 28670 const nextExtensions = extensions2 === 4 /* DtsOnly */ ? 0 /* TypeScript */ : extensions2; 28671 const features = state2.features; 28672 if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") { 28673 state2.features &= ~32 /* EsmMode */; 28674 } 28675 const result = nodeLoadModuleByRelativeName(nextExtensions, candidate2, onlyRecordFailures2, state2, false); 28676 state2.features = features; 28677 return result; 28678 }; 28679 const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : void 0; 28680 const onlyRecordFailuresForIndex = onlyRecordFailures || !directoryProbablyExists(candidate, state.host); 28681 const indexPath = combinePaths(candidate, extensions === 3 /* TSConfig */ ? "tsconfig" : "index"); 28682 if (versionPaths && (!packageFile || containsPath(candidate, packageFile))) { 28683 const moduleName = getRelativePathFromDirectory(candidate, packageFile || indexPath, false); 28684 if (state.traceEnabled) { 28685 trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version, moduleName); 28686 } 28687 const result = tryLoadModuleUsingPaths(extensions, moduleName, candidate, versionPaths.paths, void 0, loader, onlyRecordFailuresForPackageFile || onlyRecordFailuresForIndex, state); 28688 if (result) { 28689 return removeIgnoredPackageId(result.value); 28690 } 28691 } 28692 const packageFileResult = packageFile && removeIgnoredPackageId(loader(extensions, packageFile, onlyRecordFailuresForPackageFile, state)); 28693 if (packageFileResult) 28694 return packageFileResult; 28695 if (!(state.features & 32 /* EsmMode */)) { 28696 return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state); 28697 } 28698} 28699function resolvedIfExtensionMatches(extensions, path2) { 28700 const ext = tryGetExtensionFromPath2(path2); 28701 return ext !== void 0 && extensionIsOk(extensions, ext) ? { path: path2, ext } : void 0; 28702} 28703function extensionIsOk(extensions, extension) { 28704 switch (extensions) { 28705 case 1 /* JavaScript */: 28706 return extension === ".js" /* Js */ || extension === ".jsx" /* Jsx */ || extension === ".mjs" /* Mjs */ || extension === ".cjs" /* Cjs */; 28707 case 3 /* TSConfig */: 28708 case 2 /* Json */: 28709 return extension === ".json" /* Json */; 28710 case 0 /* TypeScript */: 28711 return extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */ || extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */ || extension === ".ets" /* Ets */ || extension === ".d.ets" /* Dets */; 28712 case 5 /* TsOnly */: 28713 return extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */ || extension === ".ets" /* Ets */; 28714 case 4 /* DtsOnly */: 28715 return extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */ || extension === ".d.ets" /* Dets */; 28716 } 28717} 28718function parsePackageName(moduleName) { 28719 let idx = moduleName.indexOf(directorySeparator); 28720 if (moduleName[0] === "@") { 28721 idx = moduleName.indexOf(directorySeparator, idx + 1); 28722 } 28723 return idx === -1 ? { packageName: moduleName, rest: "" } : { packageName: moduleName.slice(0, idx), rest: moduleName.slice(idx + 1) }; 28724} 28725function allKeysStartWithDot(obj) { 28726 return every(getOwnKeys(obj), (k) => startsWith(k, ".")); 28727} 28728function noKeyStartsWithDot(obj) { 28729 return !some(getOwnKeys(obj), (k) => startsWith(k, ".")); 28730} 28731function loadModuleFromSelfNameReference(extensions, moduleName, directory, state, cache, redirectedReference) { 28732 var _a2, _b; 28733 const directoryPath = getNormalizedAbsolutePath(combinePaths(directory, "dummy"), (_b = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a2)); 28734 const scope = getPackageScopeForPath(directoryPath, state); 28735 if (!scope || !scope.contents.packageJsonContent.exports) { 28736 return void 0; 28737 } 28738 if (typeof scope.contents.packageJsonContent.name !== "string") { 28739 return void 0; 28740 } 28741 const parts = getPathComponents(moduleName); 28742 const nameParts = getPathComponents(scope.contents.packageJsonContent.name); 28743 if (!every(nameParts, (p, i) => parts[i] === p)) { 28744 return void 0; 28745 } 28746 const trailingParts = parts.slice(nameParts.length); 28747 return loadModuleFromExports(scope, extensions, !length(trailingParts) ? "." : `.${directorySeparator}${trailingParts.join(directorySeparator)}`, state, cache, redirectedReference); 28748} 28749function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) { 28750 if (!scope.contents.packageJsonContent.exports) { 28751 return void 0; 28752 } 28753 if (subpath === ".") { 28754 let mainExport; 28755 if (typeof scope.contents.packageJsonContent.exports === "string" || Array.isArray(scope.contents.packageJsonContent.exports) || typeof scope.contents.packageJsonContent.exports === "object" && noKeyStartsWithDot(scope.contents.packageJsonContent.exports)) { 28756 mainExport = scope.contents.packageJsonContent.exports; 28757 } else if (hasProperty(scope.contents.packageJsonContent.exports, ".")) { 28758 mainExport = scope.contents.packageJsonContent.exports["."]; 28759 } 28760 if (mainExport) { 28761 const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, subpath, scope, false); 28762 return loadModuleFromTargetImportOrExport(mainExport, "", false, "."); 28763 } 28764 } else if (allKeysStartWithDot(scope.contents.packageJsonContent.exports)) { 28765 if (typeof scope.contents.packageJsonContent.exports !== "object") { 28766 if (state.traceEnabled) { 28767 trace(state.host, Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, subpath, scope.packageDirectory); 28768 } 28769 return toSearchResult(void 0); 28770 } 28771 const result = loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, subpath, scope.contents.packageJsonContent.exports, scope, false); 28772 if (result) { 28773 return result; 28774 } 28775 } 28776 if (state.traceEnabled) { 28777 trace(state.host, Diagnostics.Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1, subpath, scope.packageDirectory); 28778 } 28779 return toSearchResult(void 0); 28780} 28781function loadModuleFromImports(extensions, moduleName, directory, state, cache, redirectedReference) { 28782 var _a2, _b; 28783 if (moduleName === "#" || startsWith(moduleName, "#/")) { 28784 if (state.traceEnabled) { 28785 trace(state.host, Diagnostics.Invalid_import_specifier_0_has_no_possible_resolutions, moduleName); 28786 } 28787 return toSearchResult(void 0); 28788 } 28789 const directoryPath = getNormalizedAbsolutePath(combinePaths(directory, "dummy"), (_b = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a2)); 28790 const scope = getPackageScopeForPath(directoryPath, state); 28791 if (!scope) { 28792 if (state.traceEnabled) { 28793 trace(state.host, Diagnostics.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve, directoryPath); 28794 } 28795 return toSearchResult(void 0); 28796 } 28797 if (!scope.contents.packageJsonContent.imports) { 28798 if (state.traceEnabled) { 28799 trace(state.host, Diagnostics.package_json_scope_0_has_no_imports_defined, scope.packageDirectory); 28800 } 28801 return toSearchResult(void 0); 28802 } 28803 const result = loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, scope.contents.packageJsonContent.imports, scope, true); 28804 if (result) { 28805 return result; 28806 } 28807 if (state.traceEnabled) { 28808 trace(state.host, Diagnostics.Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1, moduleName, scope.packageDirectory); 28809 } 28810 return toSearchResult(void 0); 28811} 28812function comparePatternKeys(a, b) { 28813 const aPatternIndex = a.indexOf("*"); 28814 const bPatternIndex = b.indexOf("*"); 28815 const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; 28816 const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; 28817 if (baseLenA > baseLenB) 28818 return -1; 28819 if (baseLenB > baseLenA) 28820 return 1; 28821 if (aPatternIndex === -1) 28822 return 1; 28823 if (bPatternIndex === -1) 28824 return -1; 28825 if (a.length > b.length) 28826 return -1; 28827 if (b.length > a.length) 28828 return 1; 28829 return 0; 28830} 28831function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) { 28832 const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports); 28833 if (!endsWith(moduleName, directorySeparator) && moduleName.indexOf("*") === -1 && hasProperty(lookupTable, moduleName)) { 28834 const target = lookupTable[moduleName]; 28835 return loadModuleFromTargetImportOrExport(target, "", false, moduleName); 28836 } 28837 const expandingKeys = sort(filter(getOwnKeys(lookupTable), (k) => k.indexOf("*") !== -1 || endsWith(k, "/")), comparePatternKeys); 28838 for (const potentialTarget of expandingKeys) { 28839 if (state.features & 16 /* ExportsPatternTrailers */ && matchesPatternWithTrailer(potentialTarget, moduleName)) { 28840 const target = lookupTable[potentialTarget]; 28841 const starPos = potentialTarget.indexOf("*"); 28842 const subpath = moduleName.substring(potentialTarget.substring(0, starPos).length, moduleName.length - (potentialTarget.length - 1 - starPos)); 28843 return loadModuleFromTargetImportOrExport(target, subpath, true, potentialTarget); 28844 } else if (endsWith(potentialTarget, "*") && startsWith(moduleName, potentialTarget.substring(0, potentialTarget.length - 1))) { 28845 const target = lookupTable[potentialTarget]; 28846 const subpath = moduleName.substring(potentialTarget.length - 1); 28847 return loadModuleFromTargetImportOrExport(target, subpath, true, potentialTarget); 28848 } else if (startsWith(moduleName, potentialTarget)) { 28849 const target = lookupTable[potentialTarget]; 28850 const subpath = moduleName.substring(potentialTarget.length); 28851 return loadModuleFromTargetImportOrExport(target, subpath, false, potentialTarget); 28852 } 28853 } 28854 function matchesPatternWithTrailer(target, name) { 28855 if (endsWith(target, "*")) 28856 return false; 28857 const starPos = target.indexOf("*"); 28858 if (starPos === -1) 28859 return false; 28860 return startsWith(name, target.substring(0, starPos)) && endsWith(name, target.substring(starPos + 1)); 28861 } 28862} 28863function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports) { 28864 return loadModuleFromTargetImportOrExport; 28865 function loadModuleFromTargetImportOrExport(target, subpath, pattern, key) { 28866 if (typeof target === "string") { 28867 if (!pattern && subpath.length > 0 && !endsWith(target, "/")) { 28868 if (state.traceEnabled) { 28869 trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName); 28870 } 28871 return toSearchResult(void 0); 28872 } 28873 if (!startsWith(target, "./")) { 28874 if (isImports && !startsWith(target, "../") && !startsWith(target, "/") && !isRootedDiskPath(target)) { 28875 const combinedLookup = pattern ? target.replace(/\*/g, subpath) : target + subpath; 28876 traceIfEnabled(state, Diagnostics.Using_0_subpath_1_with_target_2, "imports", key, combinedLookup); 28877 traceIfEnabled(state, Diagnostics.Resolving_module_0_from_1, combinedLookup, scope.packageDirectory + "/"); 28878 const result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache, [extensions], redirectedReference); 28879 return toSearchResult(result.resolvedModule ? { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId, originalPath: result.resolvedModule.originalPath } : void 0); 28880 } 28881 if (state.traceEnabled) { 28882 trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName); 28883 } 28884 return toSearchResult(void 0); 28885 } 28886 const parts = pathIsRelative(target) ? getPathComponents(target).slice(1) : getPathComponents(target); 28887 const partsAfterFirst = parts.slice(1); 28888 if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0 || partsAfterFirst.indexOf("oh_modules") >= 0) { 28889 if (state.traceEnabled) { 28890 trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName); 28891 } 28892 return toSearchResult(void 0); 28893 } 28894 const resolvedTarget = combinePaths(scope.packageDirectory, target); 28895 const subpathParts = getPathComponents(subpath); 28896 if (subpathParts.indexOf("..") >= 0 || subpathParts.indexOf(".") >= 0 || subpathParts.indexOf("node_modules") >= 0 || subpathParts.indexOf("oh_modules") >= 0) { 28897 if (state.traceEnabled) { 28898 trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName); 28899 } 28900 return toSearchResult(void 0); 28901 } 28902 if (state.traceEnabled) { 28903 trace( 28904 state.host, 28905 Diagnostics.Using_0_subpath_1_with_target_2, 28906 isImports ? "imports" : "exports", 28907 key, 28908 pattern ? target.replace(/\*/g, subpath) : target + subpath 28909 ); 28910 } 28911 const finalPath = toAbsolutePath(pattern ? resolvedTarget.replace(/\*/g, subpath) : resolvedTarget + subpath); 28912 const inputLink = tryLoadInputFileForPath(finalPath, subpath, combinePaths(scope.packageDirectory, "package.json"), isImports); 28913 if (inputLink) 28914 return inputLink; 28915 return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, finalPath, false, state))); 28916 } else if (typeof target === "object" && target !== null) { 28917 if (!Array.isArray(target)) { 28918 for (const condition of getOwnKeys(target)) { 28919 if (condition === "default" || state.conditions.indexOf(condition) >= 0 || isApplicableVersionedTypesKey(state.conditions, condition)) { 28920 traceIfEnabled(state, Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition); 28921 const subTarget = target[condition]; 28922 const result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key); 28923 if (result) { 28924 return result; 28925 } 28926 } else { 28927 traceIfEnabled(state, Diagnostics.Saw_non_matching_condition_0, condition); 28928 } 28929 } 28930 return void 0; 28931 } else { 28932 if (!length(target)) { 28933 if (state.traceEnabled) { 28934 trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName); 28935 } 28936 return toSearchResult(void 0); 28937 } 28938 for (const elem of target) { 28939 const result = loadModuleFromTargetImportOrExport(elem, subpath, pattern, key); 28940 if (result) { 28941 return result; 28942 } 28943 } 28944 } 28945 } else if (target === null) { 28946 if (state.traceEnabled) { 28947 trace(state.host, Diagnostics.package_json_scope_0_explicitly_maps_specifier_1_to_null, scope.packageDirectory, moduleName); 28948 } 28949 return toSearchResult(void 0); 28950 } 28951 if (state.traceEnabled) { 28952 trace(state.host, Diagnostics.package_json_scope_0_has_invalid_type_for_target_of_specifier_1, scope.packageDirectory, moduleName); 28953 } 28954 return toSearchResult(void 0); 28955 function toAbsolutePath(path2) { 28956 var _a2, _b; 28957 if (path2 === void 0) 28958 return path2; 28959 return getNormalizedAbsolutePath(path2, (_b = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a2)); 28960 } 28961 function combineDirectoryPath(root, dir) { 28962 return ensureTrailingDirectorySeparator(combinePaths(root, dir)); 28963 } 28964 function useCaseSensitiveFileNames() { 28965 return !state.host.useCaseSensitiveFileNames ? true : typeof state.host.useCaseSensitiveFileNames === "boolean" ? state.host.useCaseSensitiveFileNames : state.host.useCaseSensitiveFileNames(); 28966 } 28967 function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) { 28968 var _a2, _b, _c, _d; 28969 if ((extensions === 0 /* TypeScript */ || extensions === 1 /* JavaScript */ || extensions === 2 /* Json */) && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && (finalPath.indexOf("/node_modules/") === -1 && finalPath.indexOf("/oh_modules/") === -1) && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) { 28970 const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames }); 28971 const commonSourceDirGuesses = []; 28972 if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) { 28973 const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a2)) || "", getCanonicalFileName)); 28974 commonSourceDirGuesses.push(commonDir); 28975 } else if (state.requestContainingDirectory) { 28976 const requestingFile = toAbsolutePath(combinePaths(state.requestContainingDirectory, "index.ts")); 28977 const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [requestingFile, toAbsolutePath(packagePath)], ((_d = (_c = state.host).getCurrentDirectory) == null ? void 0 : _d.call(_c)) || "", getCanonicalFileName)); 28978 commonSourceDirGuesses.push(commonDir); 28979 let fragment = ensureTrailingDirectorySeparator(commonDir); 28980 while (fragment && fragment.length > 1) { 28981 const parts = getPathComponents(fragment); 28982 parts.pop(); 28983 const commonDir2 = getPathFromPathComponents(parts); 28984 commonSourceDirGuesses.unshift(commonDir2); 28985 fragment = ensureTrailingDirectorySeparator(commonDir2); 28986 } 28987 } 28988 if (commonSourceDirGuesses.length > 1) { 28989 state.reportDiagnostic(createCompilerDiagnostic( 28990 isImports2 ? Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate : Diagnostics.The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate, 28991 entry === "" ? "." : entry, 28992 packagePath 28993 )); 28994 } 28995 for (const commonSourceDirGuess of commonSourceDirGuesses) { 28996 const candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess); 28997 for (const candidateDir of candidateDirectories) { 28998 if (containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) { 28999 const pathFragment = finalPath.slice(candidateDir.length + 1); 29000 const possibleInputBase = combinePaths(commonSourceDirGuess, pathFragment); 29001 const jsAndDtsExtensions = [".mjs" /* Mjs */, ".cjs" /* Cjs */, ".js" /* Js */, ".json" /* Json */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */, ".d.ts" /* Dts */]; 29002 for (const ext of jsAndDtsExtensions) { 29003 if (fileExtensionIs(possibleInputBase, ext)) { 29004 const inputExts = getPossibleOriginalInputExtensionForExtension(possibleInputBase); 29005 for (const possibleExt of inputExts) { 29006 const possibleInputWithInputExtension = changeAnyExtension(possibleInputBase, possibleExt, ext, !useCaseSensitiveFileNames()); 29007 if (extensions === 0 /* TypeScript */ && hasJSFileExtension(possibleInputWithInputExtension) || extensions === 1 /* JavaScript */ && hasTSFileExtension(possibleInputWithInputExtension)) { 29008 continue; 29009 } 29010 if (state.host.fileExists(possibleInputWithInputExtension)) { 29011 return toSearchResult(withPackageId(scope, loadJSOrExactTSFileName(extensions, possibleInputWithInputExtension, false, state))); 29012 } 29013 } 29014 } 29015 } 29016 } 29017 } 29018 } 29019 } 29020 return void 0; 29021 function getOutputDirectoriesForBaseDirectory(commonSourceDirGuess) { 29022 var _a3, _b2; 29023 const currentDir = state.compilerOptions.configFile ? ((_b2 = (_a3 = state.host).getCurrentDirectory) == null ? void 0 : _b2.call(_a3)) || "" : commonSourceDirGuess; 29024 const candidateDirectories = []; 29025 if (state.compilerOptions.declarationDir) { 29026 candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.declarationDir))); 29027 } 29028 if (state.compilerOptions.outDir && state.compilerOptions.outDir !== state.compilerOptions.declarationDir) { 29029 candidateDirectories.push(toAbsolutePath(combineDirectoryPath(currentDir, state.compilerOptions.outDir))); 29030 } 29031 return candidateDirectories; 29032 } 29033 } 29034 } 29035} 29036function isApplicableVersionedTypesKey(conditions, key) { 29037 if (conditions.indexOf("types") === -1) 29038 return false; 29039 if (!startsWith(key, "types@")) 29040 return false; 29041 const range = VersionRange.tryParse(key.substring("types@".length)); 29042 if (!range) 29043 return false; 29044 return range.test(version); 29045} 29046function loadModuleFromNearestNodeModulesDirectory(extensions, moduleName, directory, state, cache, redirectedReference) { 29047 return loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, false, cache, redirectedReference); 29048} 29049function loadModuleFromNearestModulesDirectoryTypesScope(moduleName, directory, state) { 29050 return loadModuleFromNearestNodeModulesDirectoryWorker(4 /* DtsOnly */, moduleName, directory, state, true, void 0, void 0); 29051} 29052function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) { 29053 const perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */, redirectedReference); 29054 const packageManagerType = state.compilerOptions.packageManagerType; 29055 const modulePathPart = getModuleByPMType(packageManagerType); 29056 return forEachAncestorDirectory(normalizeSlashes(directory), (ancestorDirectory) => { 29057 if (getBaseFileName(ancestorDirectory) !== modulePathPart) { 29058 const resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state); 29059 if (resolutionFromCache) { 29060 return resolutionFromCache; 29061 } 29062 return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference)); 29063 } 29064 }); 29065} 29066function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) { 29067 const nodeModulesFolder = combinePaths(directory, getModuleByPMType(state.compilerOptions.packageManagerType)); 29068 const nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host); 29069 if (!nodeModulesFolderExists && state.traceEnabled) { 29070 trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, nodeModulesFolder); 29071 } 29072 const packageResult = typesScopeOnly ? void 0 : loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesFolder, nodeModulesFolderExists, state, cache, redirectedReference); 29073 if (packageResult) { 29074 return packageResult; 29075 } 29076 if (extensions === 0 /* TypeScript */ || extensions === 4 /* DtsOnly */) { 29077 const modulesAtTypes = combinePaths(nodeModulesFolder, "@types"); 29078 let nodeModulesAtTypesExists = nodeModulesFolderExists; 29079 if (nodeModulesFolderExists && !directoryProbablyExists(modulesAtTypes, state.host)) { 29080 if (state.traceEnabled) { 29081 trace(state.host, Diagnostics.Directory_0_does_not_exist_skipping_all_lookups_in_it, modulesAtTypes); 29082 } 29083 nodeModulesAtTypesExists = false; 29084 } 29085 return loadModuleFromSpecificNodeModulesDirectory(4 /* DtsOnly */, mangleScopedPackageNameWithTrace(moduleName, state), modulesAtTypes, nodeModulesAtTypesExists, state, cache, redirectedReference); 29086 } 29087} 29088function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) { 29089 var _a2; 29090 const candidate = normalizePath(combinePaths(nodeModulesDirectory, moduleName)); 29091 let packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state); 29092 if (!(state.features & 8 /* Exports */)) { 29093 if (packageInfo) { 29094 const fromFile = loadModuleFromFile(extensions, candidate, !nodeModulesDirectoryExists, state); 29095 if (fromFile) { 29096 return noPackageId(fromFile); 29097 } 29098 const fromDirectory = loadNodeModuleFromDirectoryWorker( 29099 extensions, 29100 candidate, 29101 !nodeModulesDirectoryExists, 29102 state, 29103 packageInfo.contents.packageJsonContent, 29104 packageInfo.contents.versionPaths 29105 ); 29106 return withPackageId(packageInfo, fromDirectory); 29107 } 29108 } 29109 const loader = (extensions2, candidate2, onlyRecordFailures, state2) => { 29110 let pathAndExtension = loadModuleFromFile(extensions2, candidate2, onlyRecordFailures, state2) || loadNodeModuleFromDirectoryWorker( 29111 extensions2, 29112 candidate2, 29113 onlyRecordFailures, 29114 state2, 29115 packageInfo && packageInfo.contents.packageJsonContent, 29116 packageInfo && packageInfo.contents.versionPaths 29117 ); 29118 if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) { 29119 pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2); 29120 } 29121 return withPackageId(packageInfo, pathAndExtension); 29122 }; 29123 const { packageName, rest } = parsePackageName(moduleName); 29124 const packageDirectory = combinePaths(nodeModulesDirectory, packageName); 29125 if (rest !== "") { 29126 packageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state); 29127 } 29128 if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & 8 /* Exports */) { 29129 return (_a2 = loadModuleFromExports(packageInfo, extensions, combinePaths(".", rest), state, cache, redirectedReference)) == null ? void 0 : _a2.value; 29130 } 29131 if (rest !== "" && packageInfo && packageInfo.contents.versionPaths) { 29132 if (state.traceEnabled) { 29133 trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.contents.versionPaths.version, version, rest); 29134 } 29135 const packageDirectoryExists = nodeModulesDirectoryExists && directoryProbablyExists(packageDirectory, state.host); 29136 const fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, void 0, loader, !packageDirectoryExists, state); 29137 if (fromPaths) { 29138 return fromPaths.value; 29139 } 29140 } 29141 return loader(extensions, candidate, !nodeModulesDirectoryExists, state); 29142} 29143function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, pathPatterns, loader, onlyRecordFailures, state) { 29144 pathPatterns || (pathPatterns = tryParsePatterns(paths)); 29145 const matchedPattern = matchPatternOrExact(pathPatterns, moduleName); 29146 if (matchedPattern) { 29147 const matchedStar = isString(matchedPattern) ? void 0 : matchedText(matchedPattern, moduleName); 29148 const matchedPatternText = isString(matchedPattern) ? matchedPattern : patternText(matchedPattern); 29149 if (state.traceEnabled) { 29150 trace(state.host, Diagnostics.Module_name_0_matched_pattern_1, moduleName, matchedPatternText); 29151 } 29152 const resolved = forEach(paths[matchedPatternText], (subst) => { 29153 const path2 = matchedStar ? subst.replace("*", matchedStar) : subst; 29154 const candidate = normalizePath(combinePaths(baseDirectory, path2)); 29155 if (state.traceEnabled) { 29156 trace(state.host, Diagnostics.Trying_substitution_0_candidate_module_location_Colon_1, subst, path2); 29157 } 29158 const extension = tryGetExtensionFromPath2(subst); 29159 if (extension !== void 0) { 29160 const path3 = tryFile(candidate, onlyRecordFailures, state); 29161 if (path3 !== void 0) { 29162 return noPackageId({ path: path3, ext: extension }); 29163 } 29164 } 29165 return loader(extensions, candidate, onlyRecordFailures || !directoryProbablyExists(getDirectoryPath(candidate), state.host), state); 29166 }); 29167 return { value: resolved }; 29168 } 29169} 29170var mangledScopedPackageSeparator = "__"; 29171function mangleScopedPackageNameWithTrace(packageName, state) { 29172 const mangled = mangleScopedPackageName(packageName); 29173 if (state.traceEnabled && mangled !== packageName) { 29174 trace(state.host, Diagnostics.Scoped_package_detected_looking_in_0, mangled); 29175 } 29176 return mangled; 29177} 29178function mangleScopedPackageName(packageName) { 29179 if (startsWith(packageName, "@")) { 29180 const replaceSlash = packageName.replace(directorySeparator, mangledScopedPackageSeparator); 29181 if (replaceSlash !== packageName) { 29182 return replaceSlash.slice(1); 29183 } 29184 } 29185 return packageName; 29186} 29187function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, state) { 29188 const result = cache && cache.get(containingDirectory); 29189 if (result) { 29190 if (state.traceEnabled) { 29191 trace(state.host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory); 29192 } 29193 state.resultFromCache = result; 29194 return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, originalPath: result.resolvedModule.originalPath || true, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; 29195 } 29196} 29197function classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) { 29198 const traceEnabled = isTraceEnabled(compilerOptions, host); 29199 const failedLookupLocations = []; 29200 const affectingLocations = []; 29201 const containingDirectory = getDirectoryPath(containingFile); 29202 const diagnostics = []; 29203 const state = { 29204 compilerOptions, 29205 host, 29206 traceEnabled, 29207 failedLookupLocations, 29208 affectingLocations, 29209 packageJsonInfoCache: cache, 29210 features: 0 /* None */, 29211 conditions: [], 29212 requestContainingDirectory: containingDirectory, 29213 reportDiagnostic: (diag2) => void diagnostics.push(diag2) 29214 }; 29215 const resolved = tryResolve(0 /* TypeScript */) || tryResolve(1 /* JavaScript */); 29216 return createResolvedModuleWithFailedLookupLocations( 29217 resolved && resolved.value, 29218 false, 29219 failedLookupLocations, 29220 affectingLocations, 29221 diagnostics, 29222 state.resultFromCache 29223 ); 29224 function tryResolve(extensions) { 29225 const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state); 29226 if (resolvedUsingSettings) { 29227 return { value: resolvedUsingSettings }; 29228 } 29229 if (!isExternalModuleNameRelative(moduleName)) { 29230 const perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, void 0, redirectedReference); 29231 const resolved2 = forEachAncestorDirectory(containingDirectory, (directory) => { 29232 const resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, state); 29233 if (resolutionFromCache) { 29234 return resolutionFromCache; 29235 } 29236 const searchName = normalizePath(combinePaths(directory, moduleName)); 29237 return toSearchResult(loadModuleFromFileNoPackageId(extensions, searchName, false, state)); 29238 }); 29239 if (resolved2) { 29240 return resolved2; 29241 } 29242 if (extensions === 0 /* TypeScript */) { 29243 return loadModuleFromNearestModulesDirectoryTypesScope(moduleName, containingDirectory, state); 29244 } 29245 } else { 29246 const candidate = normalizePath(combinePaths(containingDirectory, moduleName)); 29247 return toSearchResult(loadModuleFromFileNoPackageId(extensions, candidate, false, state)); 29248 } 29249 } 29250} 29251function toSearchResult(value) { 29252 return value !== void 0 ? { value } : void 0; 29253} 29254function traceIfEnabled(state, diagnostic, ...args) { 29255 if (state.traceEnabled) { 29256 trace(state.host, diagnostic, ...args); 29257 } 29258} 29259 29260// src/compiler/ohApi.ts 29261function isInEtsFile(node) { 29262 var _a2; 29263 return node !== void 0 && ((_a2 = getSourceFileOfNode(node)) == null ? void 0 : _a2.scriptKind) === 8 /* ETS */; 29264} 29265function isInEtsFileWithOriginal(node) { 29266 var _a2; 29267 while (node) { 29268 node = node.original; 29269 if (node !== void 0 && ((_a2 = getSourceFileOfNode(node)) == null ? void 0 : _a2.scriptKind) === 8 /* ETS */) { 29270 return true; 29271 } 29272 } 29273 return false; 29274} 29275function isOhpm(packageManagerType) { 29276 return packageManagerType === "ohpm"; 29277} 29278var ohModulesPathPart = "/oh_modules/"; 29279function getModulePathPartByPMType(packageManagerType) { 29280 return isOhpm(packageManagerType) ? ohModulesPathPart : nodeModulesPathPart; 29281} 29282function getModuleByPMType(packageManagerType) { 29283 if (isOhpm(packageManagerType)) { 29284 return "oh_modules"; 29285 } 29286 return "node_modules"; 29287} 29288function getPackageJsonByPMType(packageManagerType) { 29289 if (isOhpm(packageManagerType)) { 29290 return "oh-package.json5"; 29291 } 29292 return "package.json"; 29293} 29294function pathContainsOHModules(path2) { 29295 return stringContains(path2, ohModulesPathPart); 29296} 29297function hasEtsExtendDecoratorNames(decorators, options) { 29298 const names = []; 29299 if (!decorators || !decorators.length) { 29300 return false; 29301 } 29302 decorators.forEach((decorator) => { 29303 var _a2, _b; 29304 const nameExpr = decorator.expression; 29305 if (isCallExpression(nameExpr) && isIdentifier(nameExpr.expression) && ((_b = (_a2 = options.ets) == null ? void 0 : _a2.extend.decorator) == null ? void 0 : _b.includes(nameExpr.expression.escapedText.toString()))) { 29306 names.push(nameExpr.expression.escapedText.toString()); 29307 } 29308 }); 29309 return names.length !== 0; 29310} 29311function hasEtsStylesDecoratorNames(decorators, options) { 29312 const names = []; 29313 if (!decorators || !decorators.length) { 29314 return false; 29315 } 29316 decorators.forEach((decorator) => { 29317 var _a2, _b; 29318 const nameExpr = decorator.expression; 29319 if (isIdentifier(nameExpr) && nameExpr.escapedText.toString() === ((_b = (_a2 = options.ets) == null ? void 0 : _a2.styles) == null ? void 0 : _b.decorator)) { 29320 names.push(nameExpr.escapedText.toString()); 29321 } 29322 }); 29323 return names.length !== 0; 29324} 29325function hasEtsBuilderDecoratorNames(decorators, options) { 29326 var _a2, _b; 29327 const names = []; 29328 if (!decorators || !decorators.length) { 29329 return false; 29330 } 29331 const renderDecorators = (_b = (_a2 = options == null ? void 0 : options.ets) == null ? void 0 : _a2.render) == null ? void 0 : _b.decorator; 29332 if (!(renderDecorators && renderDecorators.length)) { 29333 return false; 29334 } 29335 decorators.forEach((decorator) => { 29336 const nameExpr = decorator.expression; 29337 if (isIdentifier(nameExpr) && renderDecorators.includes(nameExpr.escapedText.toString())) { 29338 names.push(nameExpr.escapedText.toString()); 29339 } 29340 }); 29341 return names.length !== 0; 29342} 29343function isTokenInsideBuilder(decorators, compilerOptions) { 29344 var _a2, _b, _c; 29345 const renderDecorators = (_c = (_b = (_a2 = compilerOptions.ets) == null ? void 0 : _a2.render) == null ? void 0 : _b.decorator) != null ? _c : ["Builder", "LocalBuilder"]; 29346 if (!decorators) { 29347 return false; 29348 } 29349 if (!(renderDecorators && renderDecorators.length)) { 29350 return false; 29351 } 29352 for (const decorator of decorators) { 29353 if (isIdentifier(decorator.expression) && renderDecorators.includes(decorator.expression.escapedText.toString())) { 29354 return true; 29355 } 29356 } 29357 return false; 29358} 29359function getEtsExtendDecoratorsComponentNames(decorators, compilerOptions) { 29360 var _a2, _b, _c; 29361 const extendComponents = []; 29362 const extendDecorator = (_c = (_b = (_a2 = compilerOptions.ets) == null ? void 0 : _a2.extend) == null ? void 0 : _b.decorator) != null ? _c : "Extend"; 29363 decorators == null ? void 0 : decorators.forEach((decorator) => { 29364 if (decorator.expression.kind === 213 /* CallExpression */) { 29365 const identifier = decorator.expression.expression; 29366 const args = decorator.expression.arguments; 29367 if (identifier.kind === 79 /* Identifier */ && (extendDecorator == null ? void 0 : extendDecorator.includes(identifier.escapedText.toString())) && args.length) { 29368 if (args[0].kind === 79 /* Identifier */) { 29369 extendComponents.push(args[0].escapedText); 29370 } 29371 } 29372 } 29373 }); 29374 return extendComponents; 29375} 29376function getEtsStylesDecoratorComponentNames(decorators, compilerOptions) { 29377 var _a2, _b, _c; 29378 const stylesComponents = []; 29379 const stylesDecorator = (_c = (_b = (_a2 = compilerOptions.ets) == null ? void 0 : _a2.styles) == null ? void 0 : _b.decorator) != null ? _c : "Styles"; 29380 decorators == null ? void 0 : decorators.forEach((decorator) => { 29381 if (decorator.kind === 169 /* Decorator */ && decorator.expression.kind === 79 /* Identifier */) { 29382 const identifier = decorator.expression; 29383 if (identifier.kind === 79 /* Identifier */ && identifier.escapedText === stylesDecorator) { 29384 stylesComponents.push(identifier.escapedText); 29385 } 29386 } 29387 }); 29388 return stylesComponents; 29389} 29390function isSendableFunctionOrType(node, maybeNotOriginalNode = false) { 29391 if (!node || !(isFunctionDeclaration(node) || isTypeAliasDeclaration(node))) { 29392 return false; 29393 } 29394 if (!isInEtsFile(node) && !(maybeNotOriginalNode && isInEtsFileWithOriginal(node))) { 29395 return false; 29396 } 29397 const illegalDecorators = getIllegalDecorators(node); 29398 if (!illegalDecorators || illegalDecorators.length !== 1) { 29399 return false; 29400 } 29401 const nameExpr = illegalDecorators[0].expression; 29402 return isIdentifier(nameExpr) && nameExpr.escapedText.toString() === "Sendable"; 29403} 29404var JSON_SUFFIX = ".json"; 29405var KIT_PREFIX = "@kit."; 29406var DEFAULT_KEYWORD = "default"; 29407var ETS_DECLARATION = ".d.ets"; 29408var kitJsonCache = /* @__PURE__ */ new Map(); 29409function getSdkPath(compilerOptions) { 29410 if (isMixedCompilerSDKPath(compilerOptions)) { 29411 return resolvePath(compilerOptions.etsLoaderPath, "../../../../.."); 29412 } 29413 return compilerOptions.etsLoaderPath ? resolvePath(compilerOptions.etsLoaderPath, "../../../..") : void 0; 29414} 29415function getKitJsonObject(name, sdkPath, compilerOptions) { 29416 if (kitJsonCache == null ? void 0 : kitJsonCache.has(name)) { 29417 return kitJsonCache.get(name); 29418 } 29419 const OHOS_KIT_CONFIG_PATH = isMixedCompilerSDKPath(compilerOptions) ? "./openharmony/ets/ets1.1/build-tools/ets-loader/kit_configs" : "./openharmony/ets/build-tools/ets-loader/kit_configs"; 29420 const HMS_KIT_CONFIG_PATH = isMixedCompilerSDKPath(compilerOptions) ? "./hms/ets/ets1.1/build-tools/ets-loader/kit_configs" : "./hms/ets/build-tools/ets-loader/kit_configs"; 29421 const ohosJsonPath = resolvePath(sdkPath, OHOS_KIT_CONFIG_PATH, `./${name}${JSON_SUFFIX}`); 29422 const hmsJsonPath = resolvePath(sdkPath, HMS_KIT_CONFIG_PATH, `./${name}${JSON_SUFFIX}`); 29423 let fileInfo = sys.fileExists(ohosJsonPath) ? sys.readFile(ohosJsonPath, "utf-8") : sys.fileExists(hmsJsonPath) ? sys.readFile(hmsJsonPath, "utf-8") : void 0; 29424 if (!fileInfo) { 29425 kitJsonCache == null ? void 0 : kitJsonCache.set(name, void 0); 29426 return void 0; 29427 } 29428 const obj = JSON.parse(fileInfo); 29429 kitJsonCache == null ? void 0 : kitJsonCache.set(name, obj); 29430 return obj; 29431} 29432function isMixedCompilerSDKPath(compilerOptions) { 29433 if (!compilerOptions.etsLoaderPath) { 29434 return false; 29435 } 29436 if (normalizePath(compilerOptions.etsLoaderPath).endsWith("ets1.1/build-tools/ets-loader")) { 29437 return true; 29438 } 29439 return false; 29440} 29441function setVirtualNodeAndKitImportFlags(node, start = 0, end = 0) { 29442 node.virtual = true; 29443 setTextRangePosEnd(node, start, end); 29444 node.flags |= 536870912 /* KitImportFlags */; 29445 return node; 29446} 29447function setNoOriginalText(node) { 29448 node.flags |= -2147483648 /* NoOriginalText */; 29449 return node; 29450} 29451function createNameImportDeclaration(factory2, isType, name, source, oldStatement, importSpecifier, isLazy) { 29452 const oldModuleSpecifier = oldStatement.moduleSpecifier; 29453 const newModuleSpecifier = setNoOriginalText( 29454 setVirtualNodeAndKitImportFlags( 29455 factory2.createStringLiteral(source), 29456 oldModuleSpecifier.pos, 29457 oldModuleSpecifier.end 29458 ) 29459 ); 29460 let newImportClause = factory2.createImportClause(isType, name, void 0); 29461 newImportClause.isLazy = isLazy; 29462 newImportClause = setVirtualNodeAndKitImportFlags(newImportClause, importSpecifier.pos, importSpecifier.end); 29463 const newImportDeclaration = setVirtualNodeAndKitImportFlags( 29464 factory2.createImportDeclaration(void 0, newImportClause, newModuleSpecifier), 29465 oldStatement.pos, 29466 oldStatement.end 29467 ); 29468 return newImportDeclaration; 29469} 29470function createBindingImportDeclaration(factory2, isType, propname, name, source, oldStatement, importSpecifier, isLazy) { 29471 const oldModuleSpecifier = oldStatement.moduleSpecifier; 29472 const newModuleSpecifier = setNoOriginalText( 29473 setVirtualNodeAndKitImportFlags(factory2.createStringLiteral(source), oldModuleSpecifier.pos, oldModuleSpecifier.end) 29474 ); 29475 const newPropertyName = setNoOriginalText(setVirtualNodeAndKitImportFlags(factory2.createIdentifier(propname), name.pos, name.end)); 29476 const newImportSpecific = setVirtualNodeAndKitImportFlags( 29477 factory2.createImportSpecifier(false, newPropertyName, name), 29478 importSpecifier.pos, 29479 importSpecifier.end 29480 ); 29481 const newNamedBindings = setVirtualNodeAndKitImportFlags(factory2.createNamedImports([newImportSpecific]), importSpecifier.pos, importSpecifier.end); 29482 let newImportClause = factory2.createImportClause(isType, void 0, newNamedBindings); 29483 newImportClause.isLazy = isLazy; 29484 newImportClause = setVirtualNodeAndKitImportFlags( 29485 newImportClause, 29486 importSpecifier.pos, 29487 importSpecifier.end 29488 ); 29489 const newImportDeclaration = setVirtualNodeAndKitImportFlags( 29490 factory2.createImportDeclaration(void 0, newImportClause, newModuleSpecifier), 29491 oldStatement.pos, 29492 oldStatement.end 29493 ); 29494 return newImportDeclaration; 29495} 29496function createImportDeclarationForKit(factory2, isType, name, symbol, oldStatement, importSpecifier, isLazy) { 29497 const source = symbol.source.replace(/\.d.[e]?ts$/, ""); 29498 const binding = symbol.bindings; 29499 if (binding === DEFAULT_KEYWORD) { 29500 return createNameImportDeclaration(factory2, isType, name, source, oldStatement, importSpecifier, isLazy); 29501 } 29502 return createBindingImportDeclaration(factory2, isType, binding, name, source, oldStatement, importSpecifier, isLazy); 29503} 29504function markKitImport(statement, markedkitImportRanges) { 29505 markedkitImportRanges.push({ pos: statement.pos, end: statement.end }); 29506} 29507function excludeStatementForKitImport(statement) { 29508 if (!isImportDeclaration(statement) || !statement.importClause || statement.importClause.namedBindings && isNamespaceImport(statement.importClause.namedBindings) || !isStringLiteral(statement.moduleSpecifier) || statement.illegalDecorators || !statement.moduleSpecifier.text.startsWith(KIT_PREFIX) || statement.modifiers || statement.assertClause) { 29509 return true; 29510 } 29511 return false; 29512} 29513var whiteListForErrorSymbol = [ 29514 { kitName: "@kit.CoreFileKit", symbolName: "DfsListeners" }, 29515 { kitName: "@kit.NetworkKit", symbolName: "VpnExtensionContext" }, 29516 { kitName: "@kit.ArkUI", symbolName: "CustomContentDialog" } 29517]; 29518var whiteListForTsWarning = [ 29519 { kitName: "@kit.ConnectivityKit", symbolName: "socket" } 29520]; 29521var whiteListForTsFile = /* @__PURE__ */ new Set([ 29522 "@kit.AccountKit", 29523 "@kit.MapKit", 29524 "@kit.Penkit", 29525 "@kit.ScenarioFusionKit", 29526 "@kit.ServiceCollaborationKit", 29527 "@kit.SpeechKit", 29528 "@kit.VisionKit", 29529 "@kit.PDFKit", 29530 "@kit.ReaderKit" 29531]); 29532function inWhiteList(moduleSpecifierText, importName, inEtsContext) { 29533 if (whiteListForErrorSymbol.some((info) => info.kitName === moduleSpecifierText && info.symbolName === importName)) { 29534 return true; 29535 } 29536 if (!inEtsContext && whiteListForTsWarning.some((info) => info.kitName === moduleSpecifierText && info.symbolName === importName)) { 29537 return true; 29538 } 29539 return false; 29540} 29541function processKitStatementSuccess(factory2, statement, jsonObject, inEtsContext, newImportStatements) { 29542 const importClause = statement.importClause; 29543 const moduleSpecifierText = statement.moduleSpecifier.text; 29544 const kitSymbol = jsonObject == null ? void 0 : jsonObject.symbols; 29545 if (!kitSymbol) { 29546 return false; 29547 } 29548 const isType = importClause.isTypeOnly; 29549 const isLazy = importClause.isLazy; 29550 if (importClause.name) { 29551 const symbol = kitSymbol[DEFAULT_KEYWORD]; 29552 if (!symbol || !inEtsContext && symbol.source.endsWith(ETS_DECLARATION)) { 29553 return false; 29554 } 29555 newImportStatements.push(createImportDeclarationForKit(factory2, isType, importClause.name, symbol, statement, importClause.name, isLazy)); 29556 } 29557 if (importClause.namedBindings) { 29558 let hasError = false; 29559 importClause.namedBindings.elements.forEach( 29560 (element) => { 29561 if (hasError) { 29562 return; 29563 } 29564 const importName = unescapeLeadingUnderscores(element.propertyName ? element.propertyName.escapedText : element.name.escapedText); 29565 const aliasName = element.name; 29566 if (inWhiteList(moduleSpecifierText, importName, inEtsContext)) { 29567 hasError = true; 29568 return; 29569 } 29570 const symbol = kitSymbol[importName]; 29571 if (!symbol || !aliasName || !inEtsContext && symbol.source.endsWith(ETS_DECLARATION) || isType && element.isTypeOnly) { 29572 hasError = true; 29573 return; 29574 } 29575 newImportStatements.push( 29576 createImportDeclarationForKit(factory2, isType || element.isTypeOnly, aliasName, symbol, statement, element, isLazy) 29577 ); 29578 } 29579 ); 29580 if (hasError) { 29581 return false; 29582 } 29583 } 29584 return true; 29585} 29586function processKit(factory2, statements, sdkPath, markedkitImportRanges, inEtsContext, compilerOptions) { 29587 const list = []; 29588 let skipRestStatements = false; 29589 statements.forEach( 29590 (statement) => { 29591 if (!skipRestStatements && inEtsContext && !isImportDeclaration(statement)) { 29592 skipRestStatements = true; 29593 } 29594 if (skipRestStatements || excludeStatementForKitImport(statement)) { 29595 list.push(statement); 29596 return; 29597 } 29598 const moduleSpecifierText = statement.moduleSpecifier.text; 29599 if (!inEtsContext && whiteListForTsFile.has(moduleSpecifierText)) { 29600 list.push(statement); 29601 return; 29602 } 29603 const jsonObject = getKitJsonObject(moduleSpecifierText, sdkPath, compilerOptions); 29604 const newImportStatements = new Array(); 29605 if (!processKitStatementSuccess(factory2, statement, jsonObject, inEtsContext, newImportStatements)) { 29606 list.push(statement); 29607 return; 29608 } 29609 list.push(...newImportStatements); 29610 markKitImport(statement, markedkitImportRanges); 29611 } 29612 ); 29613 return list; 29614} 29615 29616// src/compiler/binder.ts 29617function getModuleInstanceState(node, visited) { 29618 if (node.body && !node.body.parent) { 29619 setParent(node.body, node); 29620 setParentRecursive(node.body, false); 29621 } 29622 return node.body ? getModuleInstanceStateCached(node.body, visited) : 1 /* Instantiated */; 29623} 29624function getModuleInstanceStateCached(node, visited = new Map2()) { 29625 const nodeId = getNodeId(node); 29626 if (visited.has(nodeId)) { 29627 return visited.get(nodeId) || 0 /* NonInstantiated */; 29628 } 29629 visited.set(nodeId, void 0); 29630 const result = getModuleInstanceStateWorker(node, visited); 29631 visited.set(nodeId, result); 29632 return result; 29633} 29634function getModuleInstanceStateWorker(node, visited) { 29635 switch (node.kind) { 29636 case 267 /* InterfaceDeclaration */: 29637 case 268 /* TypeAliasDeclaration */: 29638 return 0 /* NonInstantiated */; 29639 case 269 /* EnumDeclaration */: 29640 if (isEnumConst(node)) { 29641 return 2 /* ConstEnumOnly */; 29642 } 29643 break; 29644 case 275 /* ImportDeclaration */: 29645 case 274 /* ImportEqualsDeclaration */: 29646 if (!hasSyntacticModifier(node, 1 /* Export */)) { 29647 return 0 /* NonInstantiated */; 29648 } 29649 break; 29650 case 281 /* ExportDeclaration */: 29651 const exportDeclaration = node; 29652 if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 282 /* NamedExports */) { 29653 let state = 0 /* NonInstantiated */; 29654 for (const specifier of exportDeclaration.exportClause.elements) { 29655 const specifierState = getModuleInstanceStateForAliasTarget(specifier, visited); 29656 if (specifierState > state) { 29657 state = specifierState; 29658 } 29659 if (state === 1 /* Instantiated */) { 29660 return state; 29661 } 29662 } 29663 return state; 29664 } 29665 break; 29666 case 271 /* ModuleBlock */: { 29667 let state = 0 /* NonInstantiated */; 29668 forEachChild(node, (n) => { 29669 const childState = getModuleInstanceStateCached(n, visited); 29670 switch (childState) { 29671 case 0 /* NonInstantiated */: 29672 return; 29673 case 2 /* ConstEnumOnly */: 29674 state = 2 /* ConstEnumOnly */; 29675 return; 29676 case 1 /* Instantiated */: 29677 state = 1 /* Instantiated */; 29678 return true; 29679 default: 29680 Debug.assertNever(childState); 29681 } 29682 }); 29683 return state; 29684 } 29685 case 270 /* ModuleDeclaration */: 29686 return getModuleInstanceState(node, visited); 29687 case 79 /* Identifier */: 29688 if (node.isInJSDocNamespace) { 29689 return 0 /* NonInstantiated */; 29690 } 29691 } 29692 return 1 /* Instantiated */; 29693} 29694function getModuleInstanceStateForAliasTarget(specifier, visited) { 29695 const name = specifier.propertyName || specifier.name; 29696 let p = specifier.parent; 29697 while (p) { 29698 if (isBlock(p) || isModuleBlock(p) || isSourceFile(p)) { 29699 const statements = p.statements; 29700 let found; 29701 for (const statement of statements) { 29702 if (nodeHasName(statement, name)) { 29703 if (!statement.parent) { 29704 setParent(statement, p); 29705 setParentRecursive(statement, false); 29706 } 29707 const state = getModuleInstanceStateCached(statement, visited); 29708 if (found === void 0 || state > found) { 29709 found = state; 29710 } 29711 if (found === 1 /* Instantiated */) { 29712 return found; 29713 } 29714 } 29715 } 29716 if (found !== void 0) { 29717 return found; 29718 } 29719 } 29720 p = p.parent; 29721 } 29722 return 1 /* Instantiated */; 29723} 29724function initFlowNode(node) { 29725 Debug.attachFlowNodeDebugInfo(node); 29726 return node; 29727} 29728var binder = createBinder(); 29729function createBinder() { 29730 var file; 29731 var options; 29732 var languageVersion; 29733 var parent; 29734 var container; 29735 var thisParentContainer; 29736 var blockScopeContainer; 29737 var lastContainer; 29738 var delayedTypeAliases; 29739 var seenThisKeyword; 29740 var currentFlow; 29741 var currentBreakTarget; 29742 var currentContinueTarget; 29743 var currentReturnTarget; 29744 var currentTrueTarget; 29745 var currentFalseTarget; 29746 var currentExceptionTarget; 29747 var preSwitchCaseFlow; 29748 var activeLabelList; 29749 var hasExplicitReturn; 29750 var emitFlags; 29751 var inStrictMode; 29752 var inAssignmentPattern = false; 29753 var symbolCount = 0; 29754 var Symbol12; 29755 var classifiableNames; 29756 var unreachableFlow = { flags: 1 /* Unreachable */ }; 29757 var reportedUnreachableFlow = { flags: 1 /* Unreachable */ }; 29758 var bindBinaryExpressionFlow = createBindBinaryExpressionFlow(); 29759 return bindSourceFile2; 29760 function createDiagnosticForNode2(node, message, arg0, arg1, arg2) { 29761 return createDiagnosticForNodeInSourceFile(getSourceFileOfNode(node) || file, node, message, arg0, arg1, arg2); 29762 } 29763 function bindSourceFile2(f, opts) { 29764 var _a2, _b; 29765 file = f; 29766 options = opts; 29767 languageVersion = getEmitScriptTarget(options); 29768 inStrictMode = bindInStrictMode(file, opts); 29769 classifiableNames = new Set2(); 29770 symbolCount = 0; 29771 Symbol12 = objectAllocator.getSymbolConstructor(); 29772 Debug.attachFlowNodeDebugInfo(unreachableFlow); 29773 Debug.attachFlowNodeDebugInfo(reportedUnreachableFlow); 29774 if (!file.locals) { 29775 (_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Bind, "bindSourceFile", { path: file.path }, true); 29776 PerformanceDotting.start("bindSourceFile", file.fileName); 29777 bind(file); 29778 PerformanceDotting.stop("bindSourceFile"); 29779 (_b = tracing) == null ? void 0 : _b.pop(); 29780 file.symbolCount = symbolCount; 29781 file.classifiableNames = classifiableNames; 29782 delayedBindJSDocTypedefTag(); 29783 } 29784 file = void 0; 29785 options = void 0; 29786 languageVersion = void 0; 29787 parent = void 0; 29788 container = void 0; 29789 thisParentContainer = void 0; 29790 blockScopeContainer = void 0; 29791 lastContainer = void 0; 29792 delayedTypeAliases = void 0; 29793 seenThisKeyword = false; 29794 currentFlow = void 0; 29795 currentBreakTarget = void 0; 29796 currentContinueTarget = void 0; 29797 currentReturnTarget = void 0; 29798 currentTrueTarget = void 0; 29799 currentFalseTarget = void 0; 29800 currentExceptionTarget = void 0; 29801 activeLabelList = void 0; 29802 hasExplicitReturn = false; 29803 inAssignmentPattern = false; 29804 emitFlags = 0 /* None */; 29805 } 29806 function bindInStrictMode(file2, opts) { 29807 if (getStrictOptionValue(opts, "alwaysStrict") && !file2.isDeclarationFile) { 29808 return true; 29809 } else { 29810 return !!file2.externalModuleIndicator; 29811 } 29812 } 29813 function createSymbol(flags, name) { 29814 symbolCount++; 29815 return new Symbol12(flags, name); 29816 } 29817 function addDeclarationToSymbol(symbol, node, symbolFlags) { 29818 symbol.flags |= symbolFlags; 29819 node.symbol = symbol; 29820 symbol.declarations = appendIfUnique(symbol.declarations, node); 29821 if (symbolFlags & (32 /* Class */ | 384 /* Enum */ | 1536 /* Module */ | 3 /* Variable */) && !symbol.exports) { 29822 symbol.exports = createSymbolTable(); 29823 } 29824 if (symbolFlags & (32 /* Class */ | 64 /* Interface */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && !symbol.members) { 29825 symbol.members = createSymbolTable(); 29826 } 29827 if (symbol.constEnumOnlyModule && symbol.flags & (16 /* Function */ | 32 /* Class */ | 256 /* RegularEnum */)) { 29828 symbol.constEnumOnlyModule = false; 29829 } 29830 if (symbolFlags & 111551 /* Value */) { 29831 setValueDeclaration(symbol, node); 29832 } 29833 } 29834 function getDeclarationName(node) { 29835 if (node.kind === 280 /* ExportAssignment */) { 29836 return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; 29837 } 29838 const name = getNameOfDeclaration(node); 29839 if (name) { 29840 if (isAmbientModule(node)) { 29841 const moduleName = getTextOfIdentifierOrLiteral(name); 29842 return isGlobalScopeAugmentation(node) ? "__global" : `"${moduleName}"`; 29843 } 29844 if (name.kind === 166 /* ComputedPropertyName */) { 29845 const nameExpression = name.expression; 29846 if (isStringOrNumericLiteralLike(nameExpression)) { 29847 return escapeLeadingUnderscores(nameExpression.text); 29848 } 29849 if (isSignedNumericLiteral(nameExpression)) { 29850 return tokenToString(nameExpression.operator) + nameExpression.operand.text; 29851 } else { 29852 Debug.fail("Only computed properties with literal names have declaration names"); 29853 } 29854 } 29855 if (isPrivateIdentifier(name)) { 29856 const containingClass = getContainingClass(node); 29857 if (!containingClass) { 29858 return void 0; 29859 } 29860 const containingClassSymbol = containingClass.symbol; 29861 return getSymbolNameForPrivateIdentifier(containingClassSymbol, name.escapedText); 29862 } 29863 return isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : void 0; 29864 } 29865 switch (node.kind) { 29866 case 176 /* Constructor */: 29867 return "__constructor" /* Constructor */; 29868 case 184 /* FunctionType */: 29869 case 179 /* CallSignature */: 29870 case 332 /* JSDocSignature */: 29871 return "__call" /* Call */; 29872 case 185 /* ConstructorType */: 29873 case 180 /* ConstructSignature */: 29874 return "__new" /* New */; 29875 case 181 /* IndexSignature */: 29876 return "__index" /* Index */; 29877 case 281 /* ExportDeclaration */: 29878 return "__export" /* ExportStar */; 29879 case 314 /* SourceFile */: 29880 return "export=" /* ExportEquals */; 29881 case 227 /* BinaryExpression */: 29882 if (getAssignmentDeclarationKind(node) === 2 /* ModuleExports */) { 29883 return "export=" /* ExportEquals */; 29884 } 29885 Debug.fail("Unknown binary declaration kind"); 29886 case 326 /* JSDocFunctionType */: 29887 return isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */; 29888 case 168 /* Parameter */: 29889 Debug.assert(node.parent.kind === 326 /* JSDocFunctionType */, "Impossible parameter parent kind", () => `parent is: ${Debug.formatSyntaxKind(node.parent.kind)}, expected JSDocFunctionType`); 29890 const functionType = node.parent; 29891 const index = functionType.parameters.indexOf(node); 29892 return "arg" + index; 29893 } 29894 } 29895 function getDisplayName(node) { 29896 return isNamedDeclaration(node) ? declarationNameToString(node.name) : unescapeLeadingUnderscores(Debug.checkDefined(getDeclarationName(node))); 29897 } 29898 function declareSymbol(symbolTable, parent2, node, includes, excludes, isReplaceableByMethod, isComputedName) { 29899 Debug.assert(isComputedName || !hasDynamicName(node)); 29900 const isDefaultExport = hasSyntacticModifier(node, 1024 /* Default */) || isExportSpecifier(node) && node.name.escapedText === "default"; 29901 const name = isComputedName ? "__computed" /* Computed */ : isDefaultExport && parent2 ? "default" /* Default */ : getDeclarationName(node); 29902 let symbol; 29903 if (name === void 0) { 29904 symbol = createSymbol(0 /* None */, "__missing" /* Missing */); 29905 } else { 29906 symbol = symbolTable.get(name); 29907 if (includes & 2885600 /* Classifiable */) { 29908 classifiableNames.add(name); 29909 } 29910 if (!symbol) { 29911 symbolTable.set(name, symbol = createSymbol(0 /* None */, name)); 29912 if (isReplaceableByMethod) 29913 symbol.isReplaceableByMethod = true; 29914 } else if (isReplaceableByMethod && !symbol.isReplaceableByMethod) { 29915 return symbol; 29916 } else if (symbol.flags & excludes) { 29917 if (symbol.isReplaceableByMethod) { 29918 symbolTable.set(name, symbol = createSymbol(0 /* None */, name)); 29919 } else if (!(includes & 3 /* Variable */ && symbol.flags & 67108864 /* Assignment */)) { 29920 if (isNamedDeclaration(node)) { 29921 setParent(node.name, node); 29922 } 29923 let message = symbol.flags & 2 /* BlockScopedVariable */ ? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0; 29924 let messageNeedsName = true; 29925 if (symbol.flags & 384 /* Enum */ || includes & 384 /* Enum */) { 29926 message = Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations; 29927 messageNeedsName = false; 29928 } 29929 let multipleDefaultExports = false; 29930 if (length(symbol.declarations)) { 29931 if (isDefaultExport) { 29932 message = Diagnostics.A_module_cannot_have_multiple_default_exports; 29933 messageNeedsName = false; 29934 multipleDefaultExports = true; 29935 } else { 29936 if (symbol.declarations && symbol.declarations.length && (node.kind === 280 /* ExportAssignment */ && !node.isExportEquals)) { 29937 message = Diagnostics.A_module_cannot_have_multiple_default_exports; 29938 messageNeedsName = false; 29939 multipleDefaultExports = true; 29940 } 29941 } 29942 } 29943 const relatedInformation = []; 29944 if (isTypeAliasDeclaration(node) && nodeIsMissing(node.type) && hasSyntacticModifier(node, 1 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) { 29945 relatedInformation.push(createDiagnosticForNode2(node, Diagnostics.Did_you_mean_0, `export type { ${unescapeLeadingUnderscores(node.name.escapedText)} }`)); 29946 } 29947 const declarationName = getNameOfDeclaration(node) || node; 29948 forEach(symbol.declarations, (declaration, index) => { 29949 const decl = getNameOfDeclaration(declaration) || declaration; 29950 const diag3 = createDiagnosticForNode2(decl, message, messageNeedsName ? getDisplayName(declaration) : void 0); 29951 file.bindDiagnostics.push( 29952 multipleDefaultExports ? addRelatedInfo(diag3, createDiagnosticForNode2(declarationName, index === 0 ? Diagnostics.Another_export_default_is_here : Diagnostics.and_here)) : diag3 29953 ); 29954 if (multipleDefaultExports) { 29955 relatedInformation.push(createDiagnosticForNode2(decl, Diagnostics.The_first_export_default_is_here)); 29956 } 29957 }); 29958 const diag2 = createDiagnosticForNode2(declarationName, message, messageNeedsName ? getDisplayName(node) : void 0); 29959 file.bindDiagnostics.push(addRelatedInfo(diag2, ...relatedInformation)); 29960 symbol = createSymbol(0 /* None */, name); 29961 } 29962 } 29963 } 29964 addDeclarationToSymbol(symbol, node, includes); 29965 if (symbol.parent) { 29966 Debug.assert(symbol.parent === parent2, "Existing symbol parent should match new one"); 29967 } else { 29968 symbol.parent = parent2; 29969 } 29970 return symbol; 29971 } 29972 function declareModuleMember(node, symbolFlags, symbolExcludes) { 29973 const hasExportModifier = !!(getCombinedModifierFlags(node) & 1 /* Export */) || jsdocTreatAsExported(node); 29974 if (symbolFlags & 2097152 /* Alias */) { 29975 if (node.kind === 284 /* ExportSpecifier */ || node.kind === 274 /* ImportEqualsDeclaration */ && hasExportModifier) { 29976 return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); 29977 } else { 29978 return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes); 29979 } 29980 } else { 29981 if (isJSDocTypeAlias(node)) 29982 Debug.assert(isInJSFile(node)); 29983 if (!isAmbientModule(node) && (hasExportModifier || container.flags & 64 /* ExportContext */)) { 29984 if (!container.locals || hasSyntacticModifier(node, 1024 /* Default */) && !getDeclarationName(node)) { 29985 return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); 29986 } 29987 const exportKind = symbolFlags & 111551 /* Value */ ? 1048576 /* ExportValue */ : 0; 29988 const local = declareSymbol(container.locals, void 0, node, exportKind, symbolExcludes); 29989 local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); 29990 node.localSymbol = local; 29991 return local; 29992 } else { 29993 return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes); 29994 } 29995 } 29996 } 29997 function jsdocTreatAsExported(node) { 29998 if (node.parent && isModuleDeclaration(node)) { 29999 node = node.parent; 30000 } 30001 if (!isJSDocTypeAlias(node)) 30002 return false; 30003 if (!isJSDocEnumTag(node) && !!node.fullName) 30004 return true; 30005 const declName = getNameOfDeclaration(node); 30006 if (!declName) 30007 return false; 30008 if (isPropertyAccessEntityNameExpression(declName.parent) && isTopLevelNamespaceAssignment(declName.parent)) 30009 return true; 30010 if (isDeclaration(declName.parent) && getCombinedModifierFlags(declName.parent) & 1 /* Export */) 30011 return true; 30012 return false; 30013 } 30014 function bindContainer(node, containerFlags) { 30015 const saveContainer = container; 30016 const saveThisParentContainer = thisParentContainer; 30017 const savedBlockScopeContainer = blockScopeContainer; 30018 if (containerFlags & 1 /* IsContainer */) { 30019 if (node.kind !== 219 /* ArrowFunction */) { 30020 thisParentContainer = container; 30021 } 30022 container = blockScopeContainer = node; 30023 if (containerFlags & 32 /* HasLocals */) { 30024 container.locals = createSymbolTable(); 30025 } 30026 addToContainerChain(container); 30027 } else if (containerFlags & 2 /* IsBlockScopedContainer */) { 30028 blockScopeContainer = node; 30029 blockScopeContainer.locals = void 0; 30030 } 30031 if (containerFlags & 4 /* IsControlFlowContainer */) { 30032 const saveCurrentFlow = currentFlow; 30033 const saveBreakTarget = currentBreakTarget; 30034 const saveContinueTarget = currentContinueTarget; 30035 const saveReturnTarget = currentReturnTarget; 30036 const saveExceptionTarget = currentExceptionTarget; 30037 const saveActiveLabelList = activeLabelList; 30038 const saveHasExplicitReturn = hasExplicitReturn; 30039 const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 512 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 175 /* ClassStaticBlockDeclaration */; 30040 if (!isImmediatelyInvoked) { 30041 currentFlow = initFlowNode({ flags: 2 /* Start */ }); 30042 if (containerFlags & (16 /* IsFunctionExpression */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */)) { 30043 currentFlow.node = node; 30044 } 30045 } 30046 currentReturnTarget = isImmediatelyInvoked || node.kind === 176 /* Constructor */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */) ? createBranchLabel() : void 0; 30047 currentExceptionTarget = void 0; 30048 currentBreakTarget = void 0; 30049 currentContinueTarget = void 0; 30050 activeLabelList = void 0; 30051 hasExplicitReturn = false; 30052 bindChildren(node); 30053 node.flags &= ~2816 /* ReachabilityAndEmitFlags */; 30054 if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && nodeIsPresent(node.body)) { 30055 node.flags |= 256 /* HasImplicitReturn */; 30056 if (hasExplicitReturn) 30057 node.flags |= 512 /* HasExplicitReturn */; 30058 node.endFlowNode = currentFlow; 30059 } 30060 if (node.kind === 314 /* SourceFile */) { 30061 node.flags |= emitFlags; 30062 node.endFlowNode = currentFlow; 30063 } 30064 if (currentReturnTarget) { 30065 addAntecedent(currentReturnTarget, currentFlow); 30066 currentFlow = finishFlowLabel(currentReturnTarget); 30067 if (node.kind === 176 /* Constructor */ || node.kind === 175 /* ClassStaticBlockDeclaration */ || isInJSFile(node) && (node.kind === 263 /* FunctionDeclaration */ || node.kind === 218 /* FunctionExpression */)) { 30068 node.returnFlowNode = currentFlow; 30069 } 30070 } 30071 if (!isImmediatelyInvoked) { 30072 currentFlow = saveCurrentFlow; 30073 } 30074 currentBreakTarget = saveBreakTarget; 30075 currentContinueTarget = saveContinueTarget; 30076 currentReturnTarget = saveReturnTarget; 30077 currentExceptionTarget = saveExceptionTarget; 30078 activeLabelList = saveActiveLabelList; 30079 hasExplicitReturn = saveHasExplicitReturn; 30080 } else if (containerFlags & 64 /* IsInterface */) { 30081 seenThisKeyword = false; 30082 bindChildren(node); 30083 node.flags = seenThisKeyword ? node.flags | 128 /* ContainsThis */ : node.flags & ~128 /* ContainsThis */; 30084 } else { 30085 bindChildren(node); 30086 } 30087 container = saveContainer; 30088 thisParentContainer = saveThisParentContainer; 30089 blockScopeContainer = savedBlockScopeContainer; 30090 } 30091 function bindEachFunctionsFirst(nodes) { 30092 bindEach(nodes, (n) => n.kind === 263 /* FunctionDeclaration */ ? bind(n) : void 0); 30093 bindEach(nodes, (n) => n.kind !== 263 /* FunctionDeclaration */ ? bind(n) : void 0); 30094 } 30095 function bindEach(nodes, bindFunction = bind) { 30096 if (nodes === void 0) { 30097 return; 30098 } 30099 forEach(nodes, bindFunction); 30100 } 30101 function bindEachChild(node) { 30102 forEachChild(node, bind, bindEach); 30103 } 30104 function bindChildren(node) { 30105 const saveInAssignmentPattern = inAssignmentPattern; 30106 inAssignmentPattern = false; 30107 if (checkUnreachable(node)) { 30108 bindEachChild(node); 30109 bindJSDoc(node); 30110 inAssignmentPattern = saveInAssignmentPattern; 30111 return; 30112 } 30113 if (node.kind >= 244 /* FirstStatement */ && node.kind <= 260 /* LastStatement */ && !options.allowUnreachableCode) { 30114 node.flowNode = currentFlow; 30115 } 30116 switch (node.kind) { 30117 case 248 /* WhileStatement */: 30118 bindWhileStatement(node); 30119 break; 30120 case 247 /* DoStatement */: 30121 bindDoStatement(node); 30122 break; 30123 case 249 /* ForStatement */: 30124 bindForStatement(node); 30125 break; 30126 case 250 /* ForInStatement */: 30127 case 251 /* ForOfStatement */: 30128 bindForInOrForOfStatement(node); 30129 break; 30130 case 246 /* IfStatement */: 30131 bindIfStatement(node); 30132 break; 30133 case 254 /* ReturnStatement */: 30134 case 258 /* ThrowStatement */: 30135 bindReturnOrThrow(node); 30136 break; 30137 case 253 /* BreakStatement */: 30138 case 252 /* ContinueStatement */: 30139 bindBreakOrContinueStatement(node); 30140 break; 30141 case 259 /* TryStatement */: 30142 bindTryStatement(node); 30143 break; 30144 case 256 /* SwitchStatement */: 30145 bindSwitchStatement(node); 30146 break; 30147 case 272 /* CaseBlock */: 30148 bindCaseBlock(node); 30149 break; 30150 case 298 /* CaseClause */: 30151 bindCaseClause(node); 30152 break; 30153 case 245 /* ExpressionStatement */: 30154 bindExpressionStatement(node); 30155 break; 30156 case 257 /* LabeledStatement */: 30157 bindLabeledStatement(node); 30158 break; 30159 case 225 /* PrefixUnaryExpression */: 30160 bindPrefixUnaryExpressionFlow(node); 30161 break; 30162 case 226 /* PostfixUnaryExpression */: 30163 bindPostfixUnaryExpressionFlow(node); 30164 break; 30165 case 227 /* BinaryExpression */: 30166 if (isDestructuringAssignment(node)) { 30167 inAssignmentPattern = saveInAssignmentPattern; 30168 bindDestructuringAssignmentFlow(node); 30169 return; 30170 } 30171 bindBinaryExpressionFlow(node); 30172 break; 30173 case 221 /* DeleteExpression */: 30174 bindDeleteExpressionFlow(node); 30175 break; 30176 case 228 /* ConditionalExpression */: 30177 bindConditionalExpressionFlow(node); 30178 break; 30179 case 261 /* VariableDeclaration */: 30180 bindVariableDeclarationFlow(node); 30181 break; 30182 case 211 /* PropertyAccessExpression */: 30183 case 212 /* ElementAccessExpression */: 30184 bindAccessExpressionFlow(node); 30185 break; 30186 case 213 /* CallExpression */: 30187 bindCallExpressionFlow(node); 30188 break; 30189 case 236 /* NonNullExpression */: 30190 bindNonNullExpressionFlow(node); 30191 break; 30192 case 354 /* JSDocTypedefTag */: 30193 case 347 /* JSDocCallbackTag */: 30194 case 348 /* JSDocEnumTag */: 30195 bindJSDocTypeAlias(node); 30196 break; 30197 case 314 /* SourceFile */: { 30198 bindEachFunctionsFirst(node.statements); 30199 bind(node.endOfFileToken); 30200 break; 30201 } 30202 case 242 /* Block */: 30203 case 271 /* ModuleBlock */: 30204 bindEachFunctionsFirst(node.statements); 30205 break; 30206 case 208 /* BindingElement */: 30207 bindBindingElementFlow(node); 30208 break; 30209 case 168 /* Parameter */: 30210 bindParameterFlow(node); 30211 break; 30212 case 210 /* ObjectLiteralExpression */: 30213 case 209 /* ArrayLiteralExpression */: 30214 case 305 /* PropertyAssignment */: 30215 case 231 /* SpreadElement */: 30216 inAssignmentPattern = saveInAssignmentPattern; 30217 default: 30218 bindEachChild(node); 30219 break; 30220 } 30221 bindJSDoc(node); 30222 inAssignmentPattern = saveInAssignmentPattern; 30223 } 30224 function isNarrowingExpression(expr) { 30225 switch (expr.kind) { 30226 case 79 /* Identifier */: 30227 case 80 /* PrivateIdentifier */: 30228 case 109 /* ThisKeyword */: 30229 case 211 /* PropertyAccessExpression */: 30230 case 212 /* ElementAccessExpression */: 30231 return containsNarrowableReference(expr); 30232 case 213 /* CallExpression */: 30233 return hasNarrowableArgument(expr); 30234 case 217 /* ParenthesizedExpression */: 30235 case 236 /* NonNullExpression */: 30236 return isNarrowingExpression(expr.expression); 30237 case 227 /* BinaryExpression */: 30238 return isNarrowingBinaryExpression(expr); 30239 case 225 /* PrefixUnaryExpression */: 30240 return expr.operator === 53 /* ExclamationToken */ && isNarrowingExpression(expr.operand); 30241 case 222 /* TypeOfExpression */: 30242 return isNarrowingExpression(expr.expression); 30243 } 30244 return false; 30245 } 30246 function isNarrowableReference(expr) { 30247 return isDottedName(expr) || (isPropertyAccessExpression(expr) || isNonNullExpression(expr) || isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression) || isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right) || isElementAccessExpression(expr) && (isStringOrNumericLiteralLike(expr.argumentExpression) || isEntityNameExpression(expr.argumentExpression)) && isNarrowableReference(expr.expression) || isAssignmentExpression(expr) && isNarrowableReference(expr.left); 30248 } 30249 function containsNarrowableReference(expr) { 30250 return isNarrowableReference(expr) || isOptionalChain(expr) && containsNarrowableReference(expr.expression); 30251 } 30252 function hasNarrowableArgument(expr) { 30253 if (expr.arguments) { 30254 for (const argument of expr.arguments) { 30255 if (containsNarrowableReference(argument)) { 30256 return true; 30257 } 30258 } 30259 } 30260 if (expr.expression.kind === 211 /* PropertyAccessExpression */ && containsNarrowableReference(expr.expression.expression)) { 30261 return true; 30262 } 30263 return false; 30264 } 30265 function isNarrowingTypeofOperands(expr1, expr2) { 30266 return isTypeOfExpression(expr1) && isNarrowableOperand(expr1.expression) && isStringLiteralLike(expr2); 30267 } 30268 function isNarrowingBinaryExpression(expr) { 30269 switch (expr.operatorToken.kind) { 30270 case 63 /* EqualsToken */: 30271 case 75 /* BarBarEqualsToken */: 30272 case 76 /* AmpersandAmpersandEqualsToken */: 30273 case 77 /* QuestionQuestionEqualsToken */: 30274 return containsNarrowableReference(expr.left); 30275 case 34 /* EqualsEqualsToken */: 30276 case 35 /* ExclamationEqualsToken */: 30277 case 36 /* EqualsEqualsEqualsToken */: 30278 case 37 /* ExclamationEqualsEqualsToken */: 30279 return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right); 30280 case 103 /* InstanceOfKeyword */: 30281 return isNarrowableOperand(expr.left); 30282 case 102 /* InKeyword */: 30283 return isNarrowingExpression(expr.right); 30284 case 27 /* CommaToken */: 30285 return isNarrowingExpression(expr.right); 30286 } 30287 return false; 30288 } 30289 function isNarrowableOperand(expr) { 30290 switch (expr.kind) { 30291 case 217 /* ParenthesizedExpression */: 30292 return isNarrowableOperand(expr.expression); 30293 case 227 /* BinaryExpression */: 30294 switch (expr.operatorToken.kind) { 30295 case 63 /* EqualsToken */: 30296 return isNarrowableOperand(expr.left); 30297 case 27 /* CommaToken */: 30298 return isNarrowableOperand(expr.right); 30299 } 30300 } 30301 return containsNarrowableReference(expr); 30302 } 30303 function createBranchLabel() { 30304 return initFlowNode({ flags: 4 /* BranchLabel */, antecedents: void 0 }); 30305 } 30306 function createLoopLabel() { 30307 return initFlowNode({ flags: 8 /* LoopLabel */, antecedents: void 0 }); 30308 } 30309 function createReduceLabel(target, antecedents, antecedent) { 30310 return initFlowNode({ flags: 1024 /* ReduceLabel */, target, antecedents, antecedent }); 30311 } 30312 function setFlowNodeReferenced(flow) { 30313 flow.flags |= flow.flags & 2048 /* Referenced */ ? 4096 /* Shared */ : 2048 /* Referenced */; 30314 } 30315 function addAntecedent(label, antecedent) { 30316 if (!(antecedent.flags & 1 /* Unreachable */) && !contains(label.antecedents, antecedent)) { 30317 (label.antecedents || (label.antecedents = [])).push(antecedent); 30318 setFlowNodeReferenced(antecedent); 30319 } 30320 } 30321 function createFlowCondition(flags, antecedent, expression) { 30322 if (antecedent.flags & 1 /* Unreachable */) { 30323 return antecedent; 30324 } 30325 if (!expression) { 30326 return flags & 32 /* TrueCondition */ ? antecedent : unreachableFlow; 30327 } 30328 if ((expression.kind === 111 /* TrueKeyword */ && flags & 64 /* FalseCondition */ || expression.kind === 96 /* FalseKeyword */ && flags & 32 /* TrueCondition */) && !isExpressionOfOptionalChainRoot(expression) && !isNullishCoalesce(expression.parent)) { 30329 return unreachableFlow; 30330 } 30331 if (!isNarrowingExpression(expression)) { 30332 return antecedent; 30333 } 30334 setFlowNodeReferenced(antecedent); 30335 return initFlowNode({ flags, antecedent, node: expression }); 30336 } 30337 function createFlowSwitchClause(antecedent, switchStatement, clauseStart, clauseEnd) { 30338 setFlowNodeReferenced(antecedent); 30339 return initFlowNode({ flags: 128 /* SwitchClause */, antecedent, switchStatement, clauseStart, clauseEnd }); 30340 } 30341 function createFlowMutation(flags, antecedent, node) { 30342 setFlowNodeReferenced(antecedent); 30343 const result = initFlowNode({ flags, antecedent, node }); 30344 if (currentExceptionTarget) { 30345 addAntecedent(currentExceptionTarget, result); 30346 } 30347 return result; 30348 } 30349 function createFlowCall(antecedent, node) { 30350 setFlowNodeReferenced(antecedent); 30351 return initFlowNode({ flags: 512 /* Call */, antecedent, node }); 30352 } 30353 function finishFlowLabel(flow) { 30354 const antecedents = flow.antecedents; 30355 if (!antecedents) { 30356 return unreachableFlow; 30357 } 30358 if (antecedents.length === 1) { 30359 return antecedents[0]; 30360 } 30361 return flow; 30362 } 30363 function isStatementCondition(node) { 30364 const parent2 = node.parent; 30365 switch (parent2.kind) { 30366 case 246 /* IfStatement */: 30367 case 248 /* WhileStatement */: 30368 case 247 /* DoStatement */: 30369 return parent2.expression === node; 30370 case 249 /* ForStatement */: 30371 case 228 /* ConditionalExpression */: 30372 return parent2.condition === node; 30373 } 30374 return false; 30375 } 30376 function isLogicalExpression(node) { 30377 while (true) { 30378 if (node.kind === 217 /* ParenthesizedExpression */) { 30379 node = node.expression; 30380 } else if (node.kind === 225 /* PrefixUnaryExpression */ && node.operator === 53 /* ExclamationToken */) { 30381 node = node.operand; 30382 } else { 30383 return node.kind === 227 /* BinaryExpression */ && (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 56 /* BarBarToken */ || node.operatorToken.kind === 60 /* QuestionQuestionToken */); 30384 } 30385 } 30386 } 30387 function isLogicalAssignmentExpression(node) { 30388 node = skipParentheses(node); 30389 return isBinaryExpression(node) && isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind); 30390 } 30391 function isTopLevelLogicalExpression(node) { 30392 while (isParenthesizedExpression(node.parent) || isPrefixUnaryExpression(node.parent) && node.parent.operator === 53 /* ExclamationToken */) { 30393 node = node.parent; 30394 } 30395 return !isStatementCondition(node) && !isLogicalExpression(node.parent) && !(isOptionalChain(node.parent) && node.parent.expression === node); 30396 } 30397 function doWithConditionalBranches(action, value, trueTarget, falseTarget) { 30398 const savedTrueTarget = currentTrueTarget; 30399 const savedFalseTarget = currentFalseTarget; 30400 currentTrueTarget = trueTarget; 30401 currentFalseTarget = falseTarget; 30402 action(value); 30403 currentTrueTarget = savedTrueTarget; 30404 currentFalseTarget = savedFalseTarget; 30405 } 30406 function bindCondition(node, trueTarget, falseTarget) { 30407 doWithConditionalBranches(bind, node, trueTarget, falseTarget); 30408 if (!node || !isLogicalAssignmentExpression(node) && !isLogicalExpression(node) && !(isOptionalChain(node) && isOutermostOptionalChain(node))) { 30409 addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node)); 30410 addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node)); 30411 } 30412 } 30413 function bindIterativeStatement(node, breakTarget, continueTarget) { 30414 const saveBreakTarget = currentBreakTarget; 30415 const saveContinueTarget = currentContinueTarget; 30416 currentBreakTarget = breakTarget; 30417 currentContinueTarget = continueTarget; 30418 bind(node); 30419 currentBreakTarget = saveBreakTarget; 30420 currentContinueTarget = saveContinueTarget; 30421 } 30422 function setContinueTarget(node, target) { 30423 let label = activeLabelList; 30424 while (label && node.parent.kind === 257 /* LabeledStatement */) { 30425 label.continueTarget = target; 30426 label = label.next; 30427 node = node.parent; 30428 } 30429 return target; 30430 } 30431 function bindWhileStatement(node) { 30432 const preWhileLabel = setContinueTarget(node, createLoopLabel()); 30433 const preBodyLabel = createBranchLabel(); 30434 const postWhileLabel = createBranchLabel(); 30435 addAntecedent(preWhileLabel, currentFlow); 30436 currentFlow = preWhileLabel; 30437 bindCondition(node.expression, preBodyLabel, postWhileLabel); 30438 currentFlow = finishFlowLabel(preBodyLabel); 30439 bindIterativeStatement(node.statement, postWhileLabel, preWhileLabel); 30440 addAntecedent(preWhileLabel, currentFlow); 30441 currentFlow = finishFlowLabel(postWhileLabel); 30442 } 30443 function bindDoStatement(node) { 30444 const preDoLabel = createLoopLabel(); 30445 const preConditionLabel = setContinueTarget(node, createBranchLabel()); 30446 const postDoLabel = createBranchLabel(); 30447 addAntecedent(preDoLabel, currentFlow); 30448 currentFlow = preDoLabel; 30449 bindIterativeStatement(node.statement, postDoLabel, preConditionLabel); 30450 addAntecedent(preConditionLabel, currentFlow); 30451 currentFlow = finishFlowLabel(preConditionLabel); 30452 bindCondition(node.expression, preDoLabel, postDoLabel); 30453 currentFlow = finishFlowLabel(postDoLabel); 30454 } 30455 function bindForStatement(node) { 30456 const preLoopLabel = setContinueTarget(node, createLoopLabel()); 30457 const preBodyLabel = createBranchLabel(); 30458 const postLoopLabel = createBranchLabel(); 30459 bind(node.initializer); 30460 addAntecedent(preLoopLabel, currentFlow); 30461 currentFlow = preLoopLabel; 30462 bindCondition(node.condition, preBodyLabel, postLoopLabel); 30463 currentFlow = finishFlowLabel(preBodyLabel); 30464 bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); 30465 bind(node.incrementor); 30466 addAntecedent(preLoopLabel, currentFlow); 30467 currentFlow = finishFlowLabel(postLoopLabel); 30468 } 30469 function bindForInOrForOfStatement(node) { 30470 const preLoopLabel = setContinueTarget(node, createLoopLabel()); 30471 const postLoopLabel = createBranchLabel(); 30472 bind(node.expression); 30473 addAntecedent(preLoopLabel, currentFlow); 30474 currentFlow = preLoopLabel; 30475 if (node.kind === 251 /* ForOfStatement */) { 30476 bind(node.awaitModifier); 30477 } 30478 addAntecedent(postLoopLabel, currentFlow); 30479 bind(node.initializer); 30480 if (node.initializer.kind !== 262 /* VariableDeclarationList */) { 30481 bindAssignmentTargetFlow(node.initializer); 30482 } 30483 bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); 30484 addAntecedent(preLoopLabel, currentFlow); 30485 currentFlow = finishFlowLabel(postLoopLabel); 30486 } 30487 function bindIfStatement(node) { 30488 const thenLabel = createBranchLabel(); 30489 const elseLabel = createBranchLabel(); 30490 const postIfLabel = createBranchLabel(); 30491 bindCondition(node.expression, thenLabel, elseLabel); 30492 currentFlow = finishFlowLabel(thenLabel); 30493 bind(node.thenStatement); 30494 addAntecedent(postIfLabel, currentFlow); 30495 currentFlow = finishFlowLabel(elseLabel); 30496 bind(node.elseStatement); 30497 addAntecedent(postIfLabel, currentFlow); 30498 currentFlow = finishFlowLabel(postIfLabel); 30499 } 30500 function bindReturnOrThrow(node) { 30501 bind(node.expression); 30502 if (node.kind === 254 /* ReturnStatement */) { 30503 hasExplicitReturn = true; 30504 if (currentReturnTarget) { 30505 addAntecedent(currentReturnTarget, currentFlow); 30506 } 30507 } 30508 currentFlow = unreachableFlow; 30509 } 30510 function findActiveLabel(name) { 30511 for (let label = activeLabelList; label; label = label.next) { 30512 if (label.name === name) { 30513 return label; 30514 } 30515 } 30516 return void 0; 30517 } 30518 function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { 30519 const flowLabel = node.kind === 253 /* BreakStatement */ ? breakTarget : continueTarget; 30520 if (flowLabel) { 30521 addAntecedent(flowLabel, currentFlow); 30522 currentFlow = unreachableFlow; 30523 } 30524 } 30525 function bindBreakOrContinueStatement(node) { 30526 bind(node.label); 30527 if (node.label) { 30528 const activeLabel = findActiveLabel(node.label.escapedText); 30529 if (activeLabel) { 30530 activeLabel.referenced = true; 30531 bindBreakOrContinueFlow(node, activeLabel.breakTarget, activeLabel.continueTarget); 30532 } 30533 } else { 30534 bindBreakOrContinueFlow(node, currentBreakTarget, currentContinueTarget); 30535 } 30536 } 30537 function bindTryStatement(node) { 30538 const saveReturnTarget = currentReturnTarget; 30539 const saveExceptionTarget = currentExceptionTarget; 30540 const normalExitLabel = createBranchLabel(); 30541 const returnLabel = createBranchLabel(); 30542 let exceptionLabel = createBranchLabel(); 30543 if (node.finallyBlock) { 30544 currentReturnTarget = returnLabel; 30545 } 30546 addAntecedent(exceptionLabel, currentFlow); 30547 currentExceptionTarget = exceptionLabel; 30548 bind(node.tryBlock); 30549 addAntecedent(normalExitLabel, currentFlow); 30550 if (node.catchClause) { 30551 currentFlow = finishFlowLabel(exceptionLabel); 30552 exceptionLabel = createBranchLabel(); 30553 addAntecedent(exceptionLabel, currentFlow); 30554 currentExceptionTarget = exceptionLabel; 30555 bind(node.catchClause); 30556 addAntecedent(normalExitLabel, currentFlow); 30557 } 30558 currentReturnTarget = saveReturnTarget; 30559 currentExceptionTarget = saveExceptionTarget; 30560 if (node.finallyBlock) { 30561 const finallyLabel = createBranchLabel(); 30562 finallyLabel.antecedents = concatenate(concatenate(normalExitLabel.antecedents, exceptionLabel.antecedents), returnLabel.antecedents); 30563 currentFlow = finallyLabel; 30564 bind(node.finallyBlock); 30565 if (currentFlow.flags & 1 /* Unreachable */) { 30566 currentFlow = unreachableFlow; 30567 } else { 30568 if (currentReturnTarget && returnLabel.antecedents) { 30569 addAntecedent(currentReturnTarget, createReduceLabel(finallyLabel, returnLabel.antecedents, currentFlow)); 30570 } 30571 if (currentExceptionTarget && exceptionLabel.antecedents) { 30572 addAntecedent(currentExceptionTarget, createReduceLabel(finallyLabel, exceptionLabel.antecedents, currentFlow)); 30573 } 30574 currentFlow = normalExitLabel.antecedents ? createReduceLabel(finallyLabel, normalExitLabel.antecedents, currentFlow) : unreachableFlow; 30575 } 30576 } else { 30577 currentFlow = finishFlowLabel(normalExitLabel); 30578 } 30579 } 30580 function bindSwitchStatement(node) { 30581 const postSwitchLabel = createBranchLabel(); 30582 bind(node.expression); 30583 const saveBreakTarget = currentBreakTarget; 30584 const savePreSwitchCaseFlow = preSwitchCaseFlow; 30585 currentBreakTarget = postSwitchLabel; 30586 preSwitchCaseFlow = currentFlow; 30587 bind(node.caseBlock); 30588 addAntecedent(postSwitchLabel, currentFlow); 30589 const hasDefault = forEach(node.caseBlock.clauses, (c) => c.kind === 299 /* DefaultClause */); 30590 node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; 30591 if (!hasDefault) { 30592 addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0)); 30593 } 30594 currentBreakTarget = saveBreakTarget; 30595 preSwitchCaseFlow = savePreSwitchCaseFlow; 30596 currentFlow = finishFlowLabel(postSwitchLabel); 30597 } 30598 function bindCaseBlock(node) { 30599 const clauses = node.clauses; 30600 const isNarrowingSwitch = isNarrowingExpression(node.parent.expression); 30601 let fallthroughFlow = unreachableFlow; 30602 for (let i = 0; i < clauses.length; i++) { 30603 const clauseStart = i; 30604 while (!clauses[i].statements.length && i + 1 < clauses.length) { 30605 bind(clauses[i]); 30606 i++; 30607 } 30608 const preCaseLabel = createBranchLabel(); 30609 addAntecedent(preCaseLabel, isNarrowingSwitch ? createFlowSwitchClause(preSwitchCaseFlow, node.parent, clauseStart, i + 1) : preSwitchCaseFlow); 30610 addAntecedent(preCaseLabel, fallthroughFlow); 30611 currentFlow = finishFlowLabel(preCaseLabel); 30612 const clause = clauses[i]; 30613 bind(clause); 30614 fallthroughFlow = currentFlow; 30615 if (!(currentFlow.flags & 1 /* Unreachable */) && i !== clauses.length - 1 && options.noFallthroughCasesInSwitch) { 30616 clause.fallthroughFlowNode = currentFlow; 30617 } 30618 } 30619 } 30620 function bindCaseClause(node) { 30621 const saveCurrentFlow = currentFlow; 30622 currentFlow = preSwitchCaseFlow; 30623 bind(node.expression); 30624 currentFlow = saveCurrentFlow; 30625 bindEach(node.statements); 30626 } 30627 function bindExpressionStatement(node) { 30628 bind(node.expression); 30629 maybeBindExpressionFlowIfCall(node.expression); 30630 } 30631 function maybeBindExpressionFlowIfCall(node) { 30632 if (node.kind === 213 /* CallExpression */) { 30633 const call = node; 30634 if (call.expression.kind !== 107 /* SuperKeyword */ && isDottedName(call.expression)) { 30635 currentFlow = createFlowCall(currentFlow, call); 30636 } 30637 } 30638 } 30639 function bindLabeledStatement(node) { 30640 const postStatementLabel = createBranchLabel(); 30641 activeLabelList = { 30642 next: activeLabelList, 30643 name: node.label.escapedText, 30644 breakTarget: postStatementLabel, 30645 continueTarget: void 0, 30646 referenced: false 30647 }; 30648 bind(node.label); 30649 bind(node.statement); 30650 if (!activeLabelList.referenced && !options.allowUnusedLabels) { 30651 errorOrSuggestionOnNode(unusedLabelIsError(options), node.label, Diagnostics.Unused_label); 30652 } 30653 activeLabelList = activeLabelList.next; 30654 addAntecedent(postStatementLabel, currentFlow); 30655 currentFlow = finishFlowLabel(postStatementLabel); 30656 } 30657 function bindDestructuringTargetFlow(node) { 30658 if (node.kind === 227 /* BinaryExpression */ && node.operatorToken.kind === 63 /* EqualsToken */) { 30659 bindAssignmentTargetFlow(node.left); 30660 } else { 30661 bindAssignmentTargetFlow(node); 30662 } 30663 } 30664 function bindAssignmentTargetFlow(node) { 30665 if (isNarrowableReference(node)) { 30666 currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); 30667 } else if (node.kind === 209 /* ArrayLiteralExpression */) { 30668 for (const e of node.elements) { 30669 if (e.kind === 231 /* SpreadElement */) { 30670 bindAssignmentTargetFlow(e.expression); 30671 } else { 30672 bindDestructuringTargetFlow(e); 30673 } 30674 } 30675 } else if (node.kind === 210 /* ObjectLiteralExpression */) { 30676 for (const p of node.properties) { 30677 if (p.kind === 305 /* PropertyAssignment */) { 30678 bindDestructuringTargetFlow(p.initializer); 30679 } else if (p.kind === 306 /* ShorthandPropertyAssignment */) { 30680 bindAssignmentTargetFlow(p.name); 30681 } else if (p.kind === 307 /* SpreadAssignment */) { 30682 bindAssignmentTargetFlow(p.expression); 30683 } 30684 } 30685 } 30686 } 30687 function bindLogicalLikeExpression(node, trueTarget, falseTarget) { 30688 const preRightLabel = createBranchLabel(); 30689 if (node.operatorToken.kind === 55 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 76 /* AmpersandAmpersandEqualsToken */) { 30690 bindCondition(node.left, preRightLabel, falseTarget); 30691 } else { 30692 bindCondition(node.left, trueTarget, preRightLabel); 30693 } 30694 currentFlow = finishFlowLabel(preRightLabel); 30695 bind(node.operatorToken); 30696 if (isLogicalOrCoalescingAssignmentOperator(node.operatorToken.kind)) { 30697 doWithConditionalBranches(bind, node.right, trueTarget, falseTarget); 30698 bindAssignmentTargetFlow(node.left); 30699 addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node)); 30700 addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node)); 30701 } else { 30702 bindCondition(node.right, trueTarget, falseTarget); 30703 } 30704 } 30705 function bindPrefixUnaryExpressionFlow(node) { 30706 if (node.operator === 53 /* ExclamationToken */) { 30707 const saveTrueTarget = currentTrueTarget; 30708 currentTrueTarget = currentFalseTarget; 30709 currentFalseTarget = saveTrueTarget; 30710 bindEachChild(node); 30711 currentFalseTarget = currentTrueTarget; 30712 currentTrueTarget = saveTrueTarget; 30713 } else { 30714 bindEachChild(node); 30715 if (node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */) { 30716 bindAssignmentTargetFlow(node.operand); 30717 } 30718 } 30719 } 30720 function bindPostfixUnaryExpressionFlow(node) { 30721 bindEachChild(node); 30722 if (node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */) { 30723 bindAssignmentTargetFlow(node.operand); 30724 } 30725 } 30726 function bindDestructuringAssignmentFlow(node) { 30727 if (inAssignmentPattern) { 30728 inAssignmentPattern = false; 30729 bind(node.operatorToken); 30730 bind(node.right); 30731 inAssignmentPattern = true; 30732 bind(node.left); 30733 } else { 30734 inAssignmentPattern = true; 30735 bind(node.left); 30736 inAssignmentPattern = false; 30737 bind(node.operatorToken); 30738 bind(node.right); 30739 } 30740 bindAssignmentTargetFlow(node.left); 30741 } 30742 function createBindBinaryExpressionFlow() { 30743 return createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, onExit, void 0); 30744 function onEnter(node, state) { 30745 if (state) { 30746 state.stackIndex++; 30747 setParent(node, parent); 30748 const saveInStrictMode = inStrictMode; 30749 bindWorker(node); 30750 const saveParent = parent; 30751 parent = node; 30752 state.skip = false; 30753 state.inStrictModeStack[state.stackIndex] = saveInStrictMode; 30754 state.parentStack[state.stackIndex] = saveParent; 30755 } else { 30756 state = { 30757 stackIndex: 0, 30758 skip: false, 30759 inStrictModeStack: [void 0], 30760 parentStack: [void 0] 30761 }; 30762 } 30763 const operator = node.operatorToken.kind; 30764 if (operator === 55 /* AmpersandAmpersandToken */ || operator === 56 /* BarBarToken */ || operator === 60 /* QuestionQuestionToken */ || isLogicalOrCoalescingAssignmentOperator(operator)) { 30765 if (isTopLevelLogicalExpression(node)) { 30766 const postExpressionLabel = createBranchLabel(); 30767 bindLogicalLikeExpression(node, postExpressionLabel, postExpressionLabel); 30768 currentFlow = finishFlowLabel(postExpressionLabel); 30769 } else { 30770 bindLogicalLikeExpression(node, currentTrueTarget, currentFalseTarget); 30771 } 30772 state.skip = true; 30773 } 30774 return state; 30775 } 30776 function onLeft(left, state, node) { 30777 if (!state.skip) { 30778 const maybeBound = maybeBind2(left); 30779 if (node.operatorToken.kind === 27 /* CommaToken */) { 30780 maybeBindExpressionFlowIfCall(left); 30781 } 30782 return maybeBound; 30783 } 30784 } 30785 function onOperator(operatorToken, state, _node) { 30786 if (!state.skip) { 30787 bind(operatorToken); 30788 } 30789 } 30790 function onRight(right, state, node) { 30791 if (!state.skip) { 30792 const maybeBound = maybeBind2(right); 30793 if (node.operatorToken.kind === 27 /* CommaToken */) { 30794 maybeBindExpressionFlowIfCall(right); 30795 } 30796 return maybeBound; 30797 } 30798 } 30799 function onExit(node, state) { 30800 if (!state.skip) { 30801 const operator = node.operatorToken.kind; 30802 if (isAssignmentOperator(operator) && !isAssignmentTarget(node)) { 30803 bindAssignmentTargetFlow(node.left); 30804 if (operator === 63 /* EqualsToken */ && node.left.kind === 212 /* ElementAccessExpression */) { 30805 const elementAccess = node.left; 30806 if (isNarrowableOperand(elementAccess.expression)) { 30807 currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); 30808 } 30809 } 30810 } 30811 } 30812 const savedInStrictMode = state.inStrictModeStack[state.stackIndex]; 30813 const savedParent = state.parentStack[state.stackIndex]; 30814 if (savedInStrictMode !== void 0) { 30815 inStrictMode = savedInStrictMode; 30816 } 30817 if (savedParent !== void 0) { 30818 parent = savedParent; 30819 } 30820 state.skip = false; 30821 state.stackIndex--; 30822 } 30823 function maybeBind2(node) { 30824 if (node && isBinaryExpression(node) && !isDestructuringAssignment(node)) { 30825 return node; 30826 } 30827 bind(node); 30828 } 30829 } 30830 function bindDeleteExpressionFlow(node) { 30831 bindEachChild(node); 30832 if (node.expression.kind === 211 /* PropertyAccessExpression */) { 30833 bindAssignmentTargetFlow(node.expression); 30834 } 30835 } 30836 function bindConditionalExpressionFlow(node) { 30837 const trueLabel = createBranchLabel(); 30838 const falseLabel = createBranchLabel(); 30839 const postExpressionLabel = createBranchLabel(); 30840 bindCondition(node.condition, trueLabel, falseLabel); 30841 currentFlow = finishFlowLabel(trueLabel); 30842 bind(node.questionToken); 30843 bind(node.whenTrue); 30844 addAntecedent(postExpressionLabel, currentFlow); 30845 currentFlow = finishFlowLabel(falseLabel); 30846 bind(node.colonToken); 30847 bind(node.whenFalse); 30848 addAntecedent(postExpressionLabel, currentFlow); 30849 currentFlow = finishFlowLabel(postExpressionLabel); 30850 } 30851 function bindInitializedVariableFlow(node) { 30852 const name = !isOmittedExpression(node) ? node.name : void 0; 30853 if (isBindingPattern(name)) { 30854 for (const child of name.elements) { 30855 bindInitializedVariableFlow(child); 30856 } 30857 } else { 30858 currentFlow = createFlowMutation(16 /* Assignment */, currentFlow, node); 30859 } 30860 } 30861 function bindVariableDeclarationFlow(node) { 30862 bindEachChild(node); 30863 if (node.initializer || isForInOrOfStatement(node.parent.parent)) { 30864 bindInitializedVariableFlow(node); 30865 } 30866 } 30867 function bindBindingElementFlow(node) { 30868 bind(node.dotDotDotToken); 30869 bind(node.propertyName); 30870 bindInitializer(node.initializer); 30871 bind(node.name); 30872 } 30873 function bindParameterFlow(node) { 30874 bindEach(node.modifiers); 30875 bind(node.dotDotDotToken); 30876 bind(node.questionToken); 30877 bind(node.type); 30878 bindInitializer(node.initializer); 30879 bind(node.name); 30880 } 30881 function bindInitializer(node) { 30882 if (!node) { 30883 return; 30884 } 30885 const entryFlow = currentFlow; 30886 bind(node); 30887 if (entryFlow === unreachableFlow || entryFlow === currentFlow) { 30888 return; 30889 } 30890 const exitFlow = createBranchLabel(); 30891 addAntecedent(exitFlow, entryFlow); 30892 addAntecedent(exitFlow, currentFlow); 30893 currentFlow = finishFlowLabel(exitFlow); 30894 } 30895 function bindJSDocTypeAlias(node) { 30896 bind(node.tagName); 30897 if (node.kind !== 348 /* JSDocEnumTag */ && node.fullName) { 30898 setParent(node.fullName, node); 30899 setParentRecursive(node.fullName, false); 30900 } 30901 if (typeof node.comment !== "string") { 30902 bindEach(node.comment); 30903 } 30904 } 30905 function bindJSDocClassTag(node) { 30906 bindEachChild(node); 30907 const host = getHostSignatureFromJSDoc(node); 30908 if (host && host.kind !== 174 /* MethodDeclaration */) { 30909 addDeclarationToSymbol(host.symbol, host, 32 /* Class */); 30910 } 30911 } 30912 function bindOptionalExpression(node, trueTarget, falseTarget) { 30913 doWithConditionalBranches(bind, node, trueTarget, falseTarget); 30914 if (!isOptionalChain(node) || isOutermostOptionalChain(node)) { 30915 addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node)); 30916 addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node)); 30917 } 30918 } 30919 function bindOptionalChainRest(node) { 30920 switch (node.kind) { 30921 case 211 /* PropertyAccessExpression */: 30922 bind(node.questionDotToken); 30923 bind(node.name); 30924 break; 30925 case 212 /* ElementAccessExpression */: 30926 bind(node.questionDotToken); 30927 bind(node.argumentExpression); 30928 break; 30929 case 213 /* CallExpression */: 30930 bind(node.questionDotToken); 30931 bindEach(node.typeArguments); 30932 bindEach(node.arguments); 30933 break; 30934 } 30935 } 30936 function bindOptionalChain(node, trueTarget, falseTarget) { 30937 const preChainLabel = isOptionalChainRoot(node) ? createBranchLabel() : void 0; 30938 bindOptionalExpression(node.expression, preChainLabel || trueTarget, falseTarget); 30939 if (preChainLabel) { 30940 currentFlow = finishFlowLabel(preChainLabel); 30941 } 30942 doWithConditionalBranches(bindOptionalChainRest, node, trueTarget, falseTarget); 30943 if (isOutermostOptionalChain(node)) { 30944 addAntecedent(trueTarget, createFlowCondition(32 /* TrueCondition */, currentFlow, node)); 30945 addAntecedent(falseTarget, createFlowCondition(64 /* FalseCondition */, currentFlow, node)); 30946 } 30947 } 30948 function bindOptionalChainFlow(node) { 30949 if (isTopLevelLogicalExpression(node)) { 30950 const postExpressionLabel = createBranchLabel(); 30951 bindOptionalChain(node, postExpressionLabel, postExpressionLabel); 30952 currentFlow = finishFlowLabel(postExpressionLabel); 30953 } else { 30954 bindOptionalChain(node, currentTrueTarget, currentFalseTarget); 30955 } 30956 } 30957 function bindNonNullExpressionFlow(node) { 30958 if (isOptionalChain(node)) { 30959 bindOptionalChainFlow(node); 30960 } else { 30961 bindEachChild(node); 30962 } 30963 } 30964 function bindAccessExpressionFlow(node) { 30965 if (isOptionalChain(node)) { 30966 bindOptionalChainFlow(node); 30967 } else { 30968 bindEachChild(node); 30969 } 30970 } 30971 function bindCallExpressionFlow(node) { 30972 if (isOptionalChain(node)) { 30973 bindOptionalChainFlow(node); 30974 } else { 30975 const expr = skipParentheses(node.expression); 30976 if (expr.kind === 218 /* FunctionExpression */ || expr.kind === 219 /* ArrowFunction */) { 30977 bindEach(node.typeArguments); 30978 bindEach(node.arguments); 30979 bind(node.expression); 30980 } else { 30981 bindEachChild(node); 30982 if (node.expression.kind === 107 /* SuperKeyword */) { 30983 currentFlow = createFlowCall(currentFlow, node); 30984 } 30985 } 30986 } 30987 if (node.expression.kind === 211 /* PropertyAccessExpression */) { 30988 const propertyAccess = node.expression; 30989 if (isIdentifier(propertyAccess.name) && isNarrowableOperand(propertyAccess.expression) && isPushOrUnshiftIdentifier(propertyAccess.name)) { 30990 currentFlow = createFlowMutation(256 /* ArrayMutation */, currentFlow, node); 30991 } 30992 } 30993 } 30994 function getContainerFlags(node) { 30995 switch (node.kind) { 30996 case 232 /* ClassExpression */: 30997 case 264 /* ClassDeclaration */: 30998 case 265 /* StructDeclaration */: 30999 case 266 /* AnnotationDeclaration */: 31000 case 269 /* EnumDeclaration */: 31001 case 210 /* ObjectLiteralExpression */: 31002 case 187 /* TypeLiteral */: 31003 case 331 /* JSDocTypeLiteral */: 31004 case 295 /* JsxAttributes */: 31005 return 1 /* IsContainer */; 31006 case 267 /* InterfaceDeclaration */: 31007 return 1 /* IsContainer */ | 64 /* IsInterface */; 31008 case 270 /* ModuleDeclaration */: 31009 case 268 /* TypeAliasDeclaration */: 31010 case 200 /* MappedType */: 31011 case 181 /* IndexSignature */: 31012 return 1 /* IsContainer */ | 32 /* HasLocals */; 31013 case 314 /* SourceFile */: 31014 return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; 31015 case 177 /* GetAccessor */: 31016 case 178 /* SetAccessor */: 31017 case 174 /* MethodDeclaration */: 31018 if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) { 31019 return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */; 31020 } 31021 case 176 /* Constructor */: 31022 case 263 /* FunctionDeclaration */: 31023 case 173 /* MethodSignature */: 31024 case 179 /* CallSignature */: 31025 case 332 /* JSDocSignature */: 31026 case 326 /* JSDocFunctionType */: 31027 case 184 /* FunctionType */: 31028 case 180 /* ConstructSignature */: 31029 case 185 /* ConstructorType */: 31030 case 175 /* ClassStaticBlockDeclaration */: 31031 return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; 31032 case 218 /* FunctionExpression */: 31033 case 219 /* ArrowFunction */: 31034 return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; 31035 case 271 /* ModuleBlock */: 31036 return 4 /* IsControlFlowContainer */; 31037 case 171 /* PropertyDeclaration */: 31038 return node.initializer ? 4 /* IsControlFlowContainer */ : 0; 31039 case 172 /* AnnotationPropertyDeclaration */: 31040 return node.initializer ? 4 /* IsControlFlowContainer */ : 0; 31041 case 301 /* CatchClause */: 31042 case 249 /* ForStatement */: 31043 case 250 /* ForInStatement */: 31044 case 251 /* ForOfStatement */: 31045 case 272 /* CaseBlock */: 31046 return 2 /* IsBlockScopedContainer */; 31047 case 242 /* Block */: 31048 return isFunctionLike(node.parent) || isClassStaticBlockDeclaration(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */; 31049 } 31050 return 0 /* None */; 31051 } 31052 function addToContainerChain(next) { 31053 if (lastContainer) { 31054 lastContainer.nextContainer = next; 31055 } 31056 lastContainer = next; 31057 } 31058 function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { 31059 switch (container.kind) { 31060 case 270 /* ModuleDeclaration */: 31061 return declareModuleMember(node, symbolFlags, symbolExcludes); 31062 case 314 /* SourceFile */: 31063 return declareSourceFileMember(node, symbolFlags, symbolExcludes); 31064 case 232 /* ClassExpression */: 31065 case 264 /* ClassDeclaration */: 31066 case 265 /* StructDeclaration */: 31067 case 266 /* AnnotationDeclaration */: 31068 return declareClassMember(node, symbolFlags, symbolExcludes); 31069 case 269 /* EnumDeclaration */: 31070 return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); 31071 case 187 /* TypeLiteral */: 31072 case 331 /* JSDocTypeLiteral */: 31073 case 210 /* ObjectLiteralExpression */: 31074 case 267 /* InterfaceDeclaration */: 31075 case 295 /* JsxAttributes */: 31076 return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); 31077 case 184 /* FunctionType */: 31078 case 185 /* ConstructorType */: 31079 case 179 /* CallSignature */: 31080 case 180 /* ConstructSignature */: 31081 case 332 /* JSDocSignature */: 31082 case 181 /* IndexSignature */: 31083 case 174 /* MethodDeclaration */: 31084 case 173 /* MethodSignature */: 31085 case 176 /* Constructor */: 31086 case 177 /* GetAccessor */: 31087 case 178 /* SetAccessor */: 31088 case 263 /* FunctionDeclaration */: 31089 case 218 /* FunctionExpression */: 31090 case 219 /* ArrowFunction */: 31091 case 326 /* JSDocFunctionType */: 31092 case 354 /* JSDocTypedefTag */: 31093 case 347 /* JSDocCallbackTag */: 31094 case 175 /* ClassStaticBlockDeclaration */: 31095 case 268 /* TypeAliasDeclaration */: 31096 case 200 /* MappedType */: 31097 return declareSymbol(container.locals, void 0, node, symbolFlags, symbolExcludes); 31098 } 31099 } 31100 function declareClassMember(node, symbolFlags, symbolExcludes) { 31101 return isStatic(node) ? declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes) : declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); 31102 } 31103 function declareSourceFileMember(node, symbolFlags, symbolExcludes) { 31104 return isExternalModule(file) ? declareModuleMember(node, symbolFlags, symbolExcludes) : declareSymbol(file.locals, void 0, node, symbolFlags, symbolExcludes); 31105 } 31106 function hasExportDeclarations(node) { 31107 const body = isSourceFile(node) ? node : tryCast(node.body, isModuleBlock); 31108 return !!body && body.statements.some((s) => isExportDeclaration(s) || isExportAssignment(s)); 31109 } 31110 function setExportContextFlag(node) { 31111 if (node.flags & 16777216 /* Ambient */ && !hasExportDeclarations(node)) { 31112 node.flags |= 64 /* ExportContext */; 31113 } else { 31114 node.flags &= ~64 /* ExportContext */; 31115 } 31116 } 31117 function bindModuleDeclaration(node) { 31118 setExportContextFlag(node); 31119 if (isAmbientModule(node)) { 31120 if (hasSyntacticModifier(node, 1 /* Export */)) { 31121 errorOnFirstToken(node, Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); 31122 } 31123 if (isModuleAugmentationExternal(node)) { 31124 declareModuleSymbol(node); 31125 } else { 31126 let pattern; 31127 if (node.name.kind === 10 /* StringLiteral */) { 31128 const { text } = node.name; 31129 pattern = tryParsePattern(text); 31130 if (pattern === void 0) { 31131 errorOnFirstToken(node.name, Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character, text); 31132 } 31133 } 31134 const symbol = declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 110735 /* ValueModuleExcludes */); 31135 file.patternAmbientModules = append(file.patternAmbientModules, pattern && !isString(pattern) ? { pattern, symbol } : void 0); 31136 } 31137 } else { 31138 const state = declareModuleSymbol(node); 31139 if (state !== 0 /* NonInstantiated */) { 31140 const { symbol } = node; 31141 symbol.constEnumOnlyModule = !(symbol.flags & (16 /* Function */ | 32 /* Class */ | 256 /* RegularEnum */)) && state === 2 /* ConstEnumOnly */ && symbol.constEnumOnlyModule !== false; 31142 } 31143 } 31144 } 31145 function declareModuleSymbol(node) { 31146 const state = getModuleInstanceState(node); 31147 const instantiated = state !== 0 /* NonInstantiated */; 31148 declareSymbolAndAddToSymbolTable( 31149 node, 31150 instantiated ? 512 /* ValueModule */ : 1024 /* NamespaceModule */, 31151 instantiated ? 110735 /* ValueModuleExcludes */ : 0 /* NamespaceModuleExcludes */ 31152 ); 31153 return state; 31154 } 31155 function bindFunctionOrConstructorType(node) { 31156 const symbol = createSymbol(131072 /* Signature */, getDeclarationName(node)); 31157 addDeclarationToSymbol(symbol, node, 131072 /* Signature */); 31158 const typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); 31159 addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); 31160 typeLiteralSymbol.members = createSymbolTable(); 31161 typeLiteralSymbol.members.set(symbol.escapedName, symbol); 31162 } 31163 function bindObjectLiteralExpression(node) { 31164 return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object" /* Object */); 31165 } 31166 function bindJsxAttributes(node) { 31167 return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__jsxAttributes" /* JSXAttributes */); 31168 } 31169 function bindJsxAttribute(node, symbolFlags, symbolExcludes) { 31170 return declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); 31171 } 31172 function bindAnonymousDeclaration(node, symbolFlags, name) { 31173 const symbol = createSymbol(symbolFlags, name); 31174 if (symbolFlags & (8 /* EnumMember */ | 106500 /* ClassMember */)) { 31175 symbol.parent = container.symbol; 31176 } 31177 addDeclarationToSymbol(symbol, node, symbolFlags); 31178 return symbol; 31179 } 31180 function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { 31181 switch (blockScopeContainer.kind) { 31182 case 270 /* ModuleDeclaration */: 31183 declareModuleMember(node, symbolFlags, symbolExcludes); 31184 break; 31185 case 314 /* SourceFile */: 31186 if (isExternalOrCommonJsModule(container)) { 31187 declareModuleMember(node, symbolFlags, symbolExcludes); 31188 break; 31189 } 31190 default: 31191 if (!blockScopeContainer.locals) { 31192 blockScopeContainer.locals = createSymbolTable(); 31193 addToContainerChain(blockScopeContainer); 31194 } 31195 declareSymbol(blockScopeContainer.locals, void 0, node, symbolFlags, symbolExcludes); 31196 } 31197 } 31198 function delayedBindJSDocTypedefTag() { 31199 if (!delayedTypeAliases) { 31200 return; 31201 } 31202 const saveContainer = container; 31203 const saveLastContainer = lastContainer; 31204 const saveBlockScopeContainer = blockScopeContainer; 31205 const saveParent = parent; 31206 const saveCurrentFlow = currentFlow; 31207 for (const typeAlias of delayedTypeAliases) { 31208 const host = typeAlias.parent.parent; 31209 container = findAncestor(host.parent, (n) => !!(getContainerFlags(n) & 1 /* IsContainer */)) || file; 31210 blockScopeContainer = getEnclosingBlockScopeContainer(host) || file; 31211 currentFlow = initFlowNode({ flags: 2 /* Start */ }); 31212 parent = typeAlias; 31213 bind(typeAlias.typeExpression); 31214 const declName = getNameOfDeclaration(typeAlias); 31215 if ((isJSDocEnumTag(typeAlias) || !typeAlias.fullName) && declName && isPropertyAccessEntityNameExpression(declName.parent)) { 31216 const isTopLevel = isTopLevelNamespaceAssignment(declName.parent); 31217 if (isTopLevel) { 31218 bindPotentiallyMissingNamespaces( 31219 file.symbol, 31220 declName.parent, 31221 isTopLevel, 31222 !!findAncestor(declName, (d) => isPropertyAccessExpression(d) && d.name.escapedText === "prototype"), 31223 false 31224 ); 31225 const oldContainer = container; 31226 switch (getAssignmentDeclarationPropertyAccessKind(declName.parent)) { 31227 case 1 /* ExportsProperty */: 31228 case 2 /* ModuleExports */: 31229 if (!isExternalOrCommonJsModule(file)) { 31230 container = void 0; 31231 } else { 31232 container = file; 31233 } 31234 break; 31235 case 4 /* ThisProperty */: 31236 container = declName.parent.expression; 31237 break; 31238 case 3 /* PrototypeProperty */: 31239 container = declName.parent.expression.name; 31240 break; 31241 case 5 /* Property */: 31242 container = isExportsOrModuleExportsOrAlias(file, declName.parent.expression) ? file : isPropertyAccessExpression(declName.parent.expression) ? declName.parent.expression.name : declName.parent.expression; 31243 break; 31244 case 0 /* None */: 31245 return Debug.fail("Shouldn't have detected typedef or enum on non-assignment declaration"); 31246 } 31247 if (container) { 31248 declareModuleMember(typeAlias, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); 31249 } 31250 container = oldContainer; 31251 } 31252 } else if (isJSDocEnumTag(typeAlias) || !typeAlias.fullName || typeAlias.fullName.kind === 79 /* Identifier */) { 31253 parent = typeAlias.parent; 31254 bindBlockScopedDeclaration(typeAlias, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); 31255 } else { 31256 bind(typeAlias.fullName); 31257 } 31258 } 31259 container = saveContainer; 31260 lastContainer = saveLastContainer; 31261 blockScopeContainer = saveBlockScopeContainer; 31262 parent = saveParent; 31263 currentFlow = saveCurrentFlow; 31264 } 31265 function checkContextualIdentifier(node) { 31266 if (!file.parseDiagnostics.length && !(node.flags & 16777216 /* Ambient */) && !(node.flags & 8388608 /* JSDoc */) && !isIdentifierName(node)) { 31267 if (inStrictMode && node.originalKeywordKind >= 118 /* FirstFutureReservedWord */ && node.originalKeywordKind <= 126 /* LastFutureReservedWord */) { 31268 file.bindDiagnostics.push(createDiagnosticForNode2( 31269 node, 31270 getStrictModeIdentifierMessage(node), 31271 declarationNameToString(node) 31272 )); 31273 } else if (node.originalKeywordKind === 134 /* AwaitKeyword */) { 31274 if (isExternalModule(file) && isInTopLevelContext(node)) { 31275 file.bindDiagnostics.push(createDiagnosticForNode2( 31276 node, 31277 Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module, 31278 declarationNameToString(node) 31279 )); 31280 } else if (node.flags & 32768 /* AwaitContext */) { 31281 file.bindDiagnostics.push(createDiagnosticForNode2( 31282 node, 31283 Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, 31284 declarationNameToString(node) 31285 )); 31286 } 31287 } else if (node.originalKeywordKind === 126 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) { 31288 file.bindDiagnostics.push(createDiagnosticForNode2( 31289 node, 31290 Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, 31291 declarationNameToString(node) 31292 )); 31293 } 31294 } 31295 } 31296 function getStrictModeIdentifierMessage(node) { 31297 if (getContainingClass(node)) { 31298 return Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode; 31299 } 31300 if (file.externalModuleIndicator) { 31301 return Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode; 31302 } 31303 return Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode; 31304 } 31305 function checkPrivateIdentifier(node) { 31306 if (node.escapedText === "#constructor") { 31307 if (!file.parseDiagnostics.length) { 31308 file.bindDiagnostics.push(createDiagnosticForNode2( 31309 node, 31310 Diagnostics.constructor_is_a_reserved_word, 31311 declarationNameToString(node) 31312 )); 31313 } 31314 } 31315 } 31316 function checkStrictModeBinaryExpression(node) { 31317 if (inStrictMode && isLeftHandSideExpression(node.left) && isAssignmentOperator(node.operatorToken.kind)) { 31318 checkStrictModeEvalOrArguments(node, node.left); 31319 } 31320 } 31321 function checkStrictModeCatchClause(node) { 31322 if (inStrictMode && node.variableDeclaration) { 31323 checkStrictModeEvalOrArguments(node, node.variableDeclaration.name); 31324 } 31325 } 31326 function checkStrictModeDeleteExpression(node) { 31327 if (inStrictMode && node.expression.kind === 79 /* Identifier */) { 31328 const span = getErrorSpanForNode(file, node.expression); 31329 file.bindDiagnostics.push(createFileDiagnostic(file, span.start, span.length, Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode)); 31330 } 31331 } 31332 function isEvalOrArgumentsIdentifier(node) { 31333 return isIdentifier(node) && (node.escapedText === "eval" || node.escapedText === "arguments"); 31334 } 31335 function checkStrictModeEvalOrArguments(contextNode, name) { 31336 if (name && name.kind === 79 /* Identifier */) { 31337 const identifier = name; 31338 if (isEvalOrArgumentsIdentifier(identifier)) { 31339 const span = getErrorSpanForNode(file, name); 31340 file.bindDiagnostics.push(createFileDiagnostic( 31341 file, 31342 span.start, 31343 span.length, 31344 getStrictModeEvalOrArgumentsMessage(contextNode), 31345 idText(identifier) 31346 )); 31347 } 31348 } 31349 } 31350 function getStrictModeEvalOrArgumentsMessage(node) { 31351 if (getContainingClass(node)) { 31352 return Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode; 31353 } 31354 if (file.externalModuleIndicator) { 31355 return Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode; 31356 } 31357 return Diagnostics.Invalid_use_of_0_in_strict_mode; 31358 } 31359 function checkStrictModeFunctionName(node) { 31360 if (inStrictMode) { 31361 checkStrictModeEvalOrArguments(node, node.name); 31362 } 31363 } 31364 function getStrictModeBlockScopeFunctionDeclarationMessage(node) { 31365 if (getContainingClass(node)) { 31366 return Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode; 31367 } 31368 if (file.externalModuleIndicator) { 31369 return Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode; 31370 } 31371 return Diagnostics.Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5; 31372 } 31373 function checkStrictModeFunctionDeclaration(node) { 31374 if (languageVersion < 2 /* ES2015 */) { 31375 if (blockScopeContainer.kind !== 314 /* SourceFile */ && blockScopeContainer.kind !== 270 /* ModuleDeclaration */ && !isFunctionLikeOrClassStaticBlockDeclaration(blockScopeContainer)) { 31376 const errorSpan = getErrorSpanForNode(file, node); 31377 file.bindDiagnostics.push(createFileDiagnostic( 31378 file, 31379 errorSpan.start, 31380 errorSpan.length, 31381 getStrictModeBlockScopeFunctionDeclarationMessage(node) 31382 )); 31383 } 31384 } 31385 } 31386 function checkStrictModeNumericLiteral(node) { 31387 if (languageVersion < 1 /* ES5 */ && inStrictMode && node.numericLiteralFlags & 32 /* Octal */) { 31388 file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Octal_literals_are_not_allowed_in_strict_mode)); 31389 } 31390 } 31391 function checkStrictModePostfixUnaryExpression(node) { 31392 if (inStrictMode) { 31393 checkStrictModeEvalOrArguments(node, node.operand); 31394 } 31395 } 31396 function checkStrictModePrefixUnaryExpression(node) { 31397 if (inStrictMode) { 31398 if (node.operator === 45 /* PlusPlusToken */ || node.operator === 46 /* MinusMinusToken */) { 31399 checkStrictModeEvalOrArguments(node, node.operand); 31400 } 31401 } 31402 } 31403 function checkStrictModeWithStatement(node) { 31404 if (inStrictMode) { 31405 errorOnFirstToken(node, Diagnostics.with_statements_are_not_allowed_in_strict_mode); 31406 } 31407 } 31408 function checkStrictModeLabeledStatement(node) { 31409 if (inStrictMode && getEmitScriptTarget(options) >= 2 /* ES2015 */) { 31410 if (isDeclarationStatement(node.statement) || isVariableStatement(node.statement)) { 31411 errorOnFirstToken(node.label, Diagnostics.A_label_is_not_allowed_here); 31412 } 31413 } 31414 } 31415 function errorOnFirstToken(node, message, arg0, arg1, arg2) { 31416 const span = getSpanOfTokenAtPosition(file, node.pos); 31417 file.bindDiagnostics.push(createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2)); 31418 } 31419 function errorOrSuggestionOnNode(isError, node, message) { 31420 errorOrSuggestionOnRange(isError, node, node, message); 31421 } 31422 function errorOrSuggestionOnRange(isError, startNode, endNode, message) { 31423 addErrorOrSuggestionDiagnostic(isError, { pos: getTokenPosOfNode(startNode, file), end: endNode.end }, message); 31424 } 31425 function addErrorOrSuggestionDiagnostic(isError, range, message) { 31426 const diag2 = createFileDiagnostic(file, range.pos, range.end - range.pos, message); 31427 if (isError) { 31428 file.bindDiagnostics.push(diag2); 31429 } else { 31430 file.bindSuggestionDiagnostics = append(file.bindSuggestionDiagnostics, { ...diag2, category: 2 /* Suggestion */ }); 31431 } 31432 } 31433 function bind(node) { 31434 if (!node) { 31435 return; 31436 } 31437 setParent(node, parent); 31438 if (tracing) 31439 node.tracingPath = file.path; 31440 const saveInStrictMode = inStrictMode; 31441 bindWorker(node); 31442 if (node.kind > 164 /* LastToken */) { 31443 const saveParent = parent; 31444 parent = node; 31445 const containerFlags = getContainerFlags(node); 31446 if (containerFlags === 0 /* None */) { 31447 bindChildren(node); 31448 } else { 31449 bindContainer(node, containerFlags); 31450 } 31451 parent = saveParent; 31452 } else { 31453 const saveParent = parent; 31454 if (node.kind === 1 /* EndOfFileToken */) 31455 parent = node; 31456 bindJSDoc(node); 31457 parent = saveParent; 31458 } 31459 inStrictMode = saveInStrictMode; 31460 } 31461 function bindJSDoc(node) { 31462 if (hasJSDocNodes(node)) { 31463 if (isInJSFile(node)) { 31464 for (const j of node.jsDoc) { 31465 bind(j); 31466 } 31467 } else { 31468 for (const j of node.jsDoc) { 31469 setParent(j, node); 31470 setParentRecursive(j, false); 31471 } 31472 } 31473 } 31474 } 31475 function updateStrictModeStatementList(statements) { 31476 if (!inStrictMode) { 31477 for (const statement of statements) { 31478 if (!isPrologueDirective(statement)) { 31479 return; 31480 } 31481 if (isUseStrictPrologueDirective(statement)) { 31482 inStrictMode = true; 31483 return; 31484 } 31485 } 31486 } 31487 } 31488 function isUseStrictPrologueDirective(node) { 31489 const nodeText = getSourceTextOfNodeFromSourceFile(file, node.expression); 31490 return nodeText === '"use strict"' || nodeText === "'use strict'"; 31491 } 31492 function bindWorker(node) { 31493 switch (node.kind) { 31494 case 79 /* Identifier */: 31495 if (node.isInJSDocNamespace) { 31496 let parentNode = node.parent; 31497 while (parentNode && !isJSDocTypeAlias(parentNode)) { 31498 parentNode = parentNode.parent; 31499 } 31500 bindBlockScopedDeclaration(parentNode, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); 31501 break; 31502 } 31503 case 109 /* ThisKeyword */: 31504 if (currentFlow && (isExpression(node) || parent.kind === 306 /* ShorthandPropertyAssignment */)) { 31505 node.flowNode = currentFlow; 31506 } 31507 return checkContextualIdentifier(node); 31508 case 165 /* QualifiedName */: 31509 if (currentFlow && isPartOfTypeQuery(node)) { 31510 node.flowNode = currentFlow; 31511 } 31512 break; 31513 case 237 /* MetaProperty */: 31514 case 107 /* SuperKeyword */: 31515 node.flowNode = currentFlow; 31516 break; 31517 case 80 /* PrivateIdentifier */: 31518 return checkPrivateIdentifier(node); 31519 case 211 /* PropertyAccessExpression */: 31520 case 212 /* ElementAccessExpression */: 31521 const expr = node; 31522 if (currentFlow && isNarrowableReference(expr)) { 31523 expr.flowNode = currentFlow; 31524 } 31525 if (isSpecialPropertyDeclaration(expr)) { 31526 bindSpecialPropertyDeclaration(expr); 31527 } 31528 if (isInJSFile(expr) && file.commonJsModuleIndicator && isModuleExportsAccessExpression(expr) && !lookupSymbolForName(blockScopeContainer, "module")) { 31529 declareSymbol( 31530 file.locals, 31531 void 0, 31532 expr.expression, 31533 1 /* FunctionScopedVariable */ | 134217728 /* ModuleExports */, 31534 111550 /* FunctionScopedVariableExcludes */ 31535 ); 31536 } 31537 break; 31538 case 227 /* BinaryExpression */: 31539 const specialKind = getAssignmentDeclarationKind(node); 31540 switch (specialKind) { 31541 case 1 /* ExportsProperty */: 31542 bindExportsPropertyAssignment(node); 31543 break; 31544 case 2 /* ModuleExports */: 31545 bindModuleExportsAssignment(node); 31546 break; 31547 case 3 /* PrototypeProperty */: 31548 bindPrototypePropertyAssignment(node.left, node); 31549 break; 31550 case 6 /* Prototype */: 31551 bindPrototypeAssignment(node); 31552 break; 31553 case 4 /* ThisProperty */: 31554 bindThisPropertyAssignment(node); 31555 break; 31556 case 5 /* Property */: 31557 const expression = node.left.expression; 31558 if (isInJSFile(node) && isIdentifier(expression)) { 31559 const symbol = lookupSymbolForName(blockScopeContainer, expression.escapedText); 31560 if (isThisInitializedDeclaration(symbol == null ? void 0 : symbol.valueDeclaration)) { 31561 bindThisPropertyAssignment(node); 31562 break; 31563 } 31564 } 31565 bindSpecialPropertyAssignment(node); 31566 break; 31567 case 0 /* None */: 31568 break; 31569 default: 31570 Debug.fail("Unknown binary expression special property assignment kind"); 31571 } 31572 return checkStrictModeBinaryExpression(node); 31573 case 301 /* CatchClause */: 31574 return checkStrictModeCatchClause(node); 31575 case 221 /* DeleteExpression */: 31576 return checkStrictModeDeleteExpression(node); 31577 case 8 /* NumericLiteral */: 31578 return checkStrictModeNumericLiteral(node); 31579 case 226 /* PostfixUnaryExpression */: 31580 return checkStrictModePostfixUnaryExpression(node); 31581 case 225 /* PrefixUnaryExpression */: 31582 return checkStrictModePrefixUnaryExpression(node); 31583 case 255 /* WithStatement */: 31584 return checkStrictModeWithStatement(node); 31585 case 257 /* LabeledStatement */: 31586 return checkStrictModeLabeledStatement(node); 31587 case 197 /* ThisType */: 31588 seenThisKeyword = true; 31589 return; 31590 case 182 /* TypePredicate */: 31591 break; 31592 case 167 /* TypeParameter */: 31593 return bindTypeParameter(node); 31594 case 168 /* Parameter */: 31595 return bindParameter(node); 31596 case 261 /* VariableDeclaration */: 31597 return bindVariableDeclarationOrBindingElement(node); 31598 case 208 /* BindingElement */: 31599 node.flowNode = currentFlow; 31600 return bindVariableDeclarationOrBindingElement(node); 31601 case 171 /* PropertyDeclaration */: 31602 case 172 /* AnnotationPropertyDeclaration */: 31603 case 170 /* PropertySignature */: 31604 return bindPropertyWorker(node); 31605 case 305 /* PropertyAssignment */: 31606 case 306 /* ShorthandPropertyAssignment */: 31607 return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); 31608 case 308 /* EnumMember */: 31609 return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); 31610 case 179 /* CallSignature */: 31611 case 180 /* ConstructSignature */: 31612 case 181 /* IndexSignature */: 31613 return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); 31614 case 174 /* MethodDeclaration */: 31615 case 173 /* MethodSignature */: 31616 return bindPropertyOrMethodOrAccessor( 31617 node, 31618 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), 31619 isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 103359 /* MethodExcludes */ 31620 ); 31621 case 263 /* FunctionDeclaration */: 31622 return bindFunctionDeclaration(node); 31623 case 176 /* Constructor */: 31624 return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, 0 /* None */); 31625 case 177 /* GetAccessor */: 31626 return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 46015 /* GetAccessorExcludes */); 31627 case 178 /* SetAccessor */: 31628 return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 78783 /* SetAccessorExcludes */); 31629 case 184 /* FunctionType */: 31630 case 326 /* JSDocFunctionType */: 31631 case 332 /* JSDocSignature */: 31632 case 185 /* ConstructorType */: 31633 return bindFunctionOrConstructorType(node); 31634 case 187 /* TypeLiteral */: 31635 case 331 /* JSDocTypeLiteral */: 31636 case 200 /* MappedType */: 31637 return bindAnonymousTypeWorker(node); 31638 case 341 /* JSDocClassTag */: 31639 return bindJSDocClassTag(node); 31640 case 210 /* ObjectLiteralExpression */: 31641 return bindObjectLiteralExpression(node); 31642 case 218 /* FunctionExpression */: 31643 case 219 /* ArrowFunction */: 31644 return bindFunctionExpression(node); 31645 case 213 /* CallExpression */: 31646 const assignmentKind = getAssignmentDeclarationKind(node); 31647 switch (assignmentKind) { 31648 case 7 /* ObjectDefinePropertyValue */: 31649 return bindObjectDefinePropertyAssignment(node); 31650 case 8 /* ObjectDefinePropertyExports */: 31651 return bindObjectDefinePropertyExport(node); 31652 case 9 /* ObjectDefinePrototypeProperty */: 31653 return bindObjectDefinePrototypeProperty(node); 31654 case 0 /* None */: 31655 break; 31656 default: 31657 return Debug.fail("Unknown call expression assignment declaration kind"); 31658 } 31659 if (isInJSFile(node)) { 31660 bindCallExpression(node); 31661 } 31662 break; 31663 case 232 /* ClassExpression */: 31664 case 264 /* ClassDeclaration */: 31665 case 265 /* StructDeclaration */: 31666 inStrictMode = true; 31667 return bindClassLikeDeclaration(node); 31668 case 266 /* AnnotationDeclaration */: 31669 return bindAnnotationDeclaration(node); 31670 case 267 /* InterfaceDeclaration */: 31671 return bindBlockScopedDeclaration(node, 64 /* Interface */, 788872 /* InterfaceExcludes */); 31672 case 268 /* TypeAliasDeclaration */: 31673 return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */); 31674 case 269 /* EnumDeclaration */: 31675 return bindEnumDeclaration(node); 31676 case 270 /* ModuleDeclaration */: 31677 return bindModuleDeclaration(node); 31678 case 295 /* JsxAttributes */: 31679 return bindJsxAttributes(node); 31680 case 294 /* JsxAttribute */: 31681 return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); 31682 case 274 /* ImportEqualsDeclaration */: 31683 case 277 /* NamespaceImport */: 31684 case 279 /* ImportSpecifier */: 31685 case 284 /* ExportSpecifier */: 31686 return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); 31687 case 273 /* NamespaceExportDeclaration */: 31688 return bindNamespaceExportDeclaration(node); 31689 case 276 /* ImportClause */: 31690 return bindImportClause(node); 31691 case 281 /* ExportDeclaration */: 31692 return bindExportDeclaration(node); 31693 case 280 /* ExportAssignment */: 31694 return bindExportAssignment(node); 31695 case 314 /* SourceFile */: 31696 updateStrictModeStatementList(node.statements); 31697 return bindSourceFileIfExternalModule(); 31698 case 242 /* Block */: 31699 if (!isFunctionLikeOrClassStaticBlockDeclaration(node.parent)) { 31700 return; 31701 } 31702 case 271 /* ModuleBlock */: 31703 return updateStrictModeStatementList(node.statements); 31704 case 349 /* JSDocParameterTag */: 31705 if (node.parent.kind === 332 /* JSDocSignature */) { 31706 return bindParameter(node); 31707 } 31708 if (node.parent.kind !== 331 /* JSDocTypeLiteral */) { 31709 break; 31710 } 31711 case 356 /* JSDocPropertyTag */: 31712 const propTag = node; 31713 const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 325 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; 31714 return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); 31715 case 354 /* JSDocTypedefTag */: 31716 case 347 /* JSDocCallbackTag */: 31717 case 348 /* JSDocEnumTag */: 31718 return (delayedTypeAliases || (delayedTypeAliases = [])).push(node); 31719 } 31720 } 31721 function bindPropertyWorker(node) { 31722 const isAutoAccessor = isAutoAccessorPropertyDeclaration(node); 31723 const includes = isAutoAccessor ? 98304 /* Accessor */ : 4 /* Property */; 31724 const excludes = isAutoAccessor ? 13247 /* AccessorExcludes */ : 0 /* PropertyExcludes */; 31725 const isOptional = !isAnnotationPropertyDeclaration(node) && node.questionToken ? 16777216 /* Optional */ : 0 /* None */; 31726 const annotationPropHasDefaultValue = isAnnotationPropertyDeclaration(node) && node.initializer !== void 0 ? 16777216 /* Optional */ : 0 /* None */; 31727 return bindPropertyOrMethodOrAccessor(node, includes | isOptional | annotationPropHasDefaultValue, excludes); 31728 } 31729 function bindAnonymousTypeWorker(node) { 31730 return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type" /* Type */); 31731 } 31732 function bindSourceFileIfExternalModule() { 31733 setExportContextFlag(file); 31734 if (isExternalModule(file)) { 31735 bindSourceFileAsExternalModule(); 31736 } else if (isJsonSourceFile(file)) { 31737 bindSourceFileAsExternalModule(); 31738 const originalSymbol = file.symbol; 31739 declareSymbol(file.symbol.exports, file.symbol, file, 4 /* Property */, 67108863 /* All */); 31740 file.symbol = originalSymbol; 31741 } 31742 } 31743 function bindSourceFileAsExternalModule() { 31744 bindAnonymousDeclaration(file, 512 /* ValueModule */, `"${removeFileExtension(file.fileName)}"`); 31745 } 31746 function bindExportAssignment(node) { 31747 if (!container.symbol || !container.symbol.exports) { 31748 bindAnonymousDeclaration(node, 111551 /* Value */, getDeclarationName(node)); 31749 } else { 31750 const flags = exportAssignmentIsAlias(node) ? 2097152 /* Alias */ : 4 /* Property */; 31751 const symbol = declareSymbol(container.symbol.exports, container.symbol, node, flags, 67108863 /* All */); 31752 if (node.isExportEquals) { 31753 setValueDeclaration(symbol, node); 31754 } 31755 } 31756 } 31757 function bindNamespaceExportDeclaration(node) { 31758 if (some(node.modifiers)) { 31759 file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Modifiers_cannot_appear_here)); 31760 } 31761 const diag2 = !isSourceFile(node.parent) ? Diagnostics.Global_module_exports_may_only_appear_at_top_level : !isExternalModule(node.parent) ? Diagnostics.Global_module_exports_may_only_appear_in_module_files : !node.parent.isDeclarationFile ? Diagnostics.Global_module_exports_may_only_appear_in_declaration_files : void 0; 31762 if (diag2) { 31763 file.bindDiagnostics.push(createDiagnosticForNode2(node, diag2)); 31764 } else { 31765 file.symbol.globalExports = file.symbol.globalExports || createSymbolTable(); 31766 declareSymbol(file.symbol.globalExports, file.symbol, node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); 31767 } 31768 } 31769 function bindExportDeclaration(node) { 31770 if (!container.symbol || !container.symbol.exports) { 31771 bindAnonymousDeclaration(node, 8388608 /* ExportStar */, getDeclarationName(node)); 31772 } else if (!node.exportClause) { 31773 declareSymbol(container.symbol.exports, container.symbol, node, 8388608 /* ExportStar */, 0 /* None */); 31774 } else if (isNamespaceExport(node.exportClause)) { 31775 setParent(node.exportClause, node); 31776 declareSymbol(container.symbol.exports, container.symbol, node.exportClause, 2097152 /* Alias */, 2097152 /* AliasExcludes */); 31777 } 31778 } 31779 function bindImportClause(node) { 31780 if (node.name) { 31781 declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); 31782 } 31783 } 31784 function setCommonJsModuleIndicator(node) { 31785 if (file.externalModuleIndicator && file.externalModuleIndicator !== true) { 31786 return false; 31787 } 31788 if (!file.commonJsModuleIndicator) { 31789 file.commonJsModuleIndicator = node; 31790 if (!file.externalModuleIndicator) { 31791 bindSourceFileAsExternalModule(); 31792 } 31793 } 31794 return true; 31795 } 31796 function bindObjectDefinePropertyExport(node) { 31797 if (!setCommonJsModuleIndicator(node)) { 31798 return; 31799 } 31800 const symbol = forEachIdentifierInEntityName(node.arguments[0], void 0, (id, symbol2) => { 31801 if (symbol2) { 31802 addDeclarationToSymbol(symbol2, id, 1536 /* Module */ | 67108864 /* Assignment */); 31803 } 31804 return symbol2; 31805 }); 31806 if (symbol) { 31807 const flags = 4 /* Property */ | 1048576 /* ExportValue */; 31808 declareSymbol(symbol.exports, symbol, node, flags, 0 /* None */); 31809 } 31810 } 31811 function bindExportsPropertyAssignment(node) { 31812 if (!setCommonJsModuleIndicator(node)) { 31813 return; 31814 } 31815 const symbol = forEachIdentifierInEntityName(node.left.expression, void 0, (id, symbol2) => { 31816 if (symbol2) { 31817 addDeclarationToSymbol(symbol2, id, 1536 /* Module */ | 67108864 /* Assignment */); 31818 } 31819 return symbol2; 31820 }); 31821 if (symbol) { 31822 const isAlias = isAliasableExpression(node.right) && (isExportsIdentifier(node.left.expression) || isModuleExportsAccessExpression(node.left.expression)); 31823 const flags = isAlias ? 2097152 /* Alias */ : 4 /* Property */ | 1048576 /* ExportValue */; 31824 setParent(node.left, node); 31825 declareSymbol(symbol.exports, symbol, node.left, flags, 0 /* None */); 31826 } 31827 } 31828 function bindModuleExportsAssignment(node) { 31829 if (!setCommonJsModuleIndicator(node)) { 31830 return; 31831 } 31832 const assignedExpression = getRightMostAssignedExpression(node.right); 31833 if (isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) { 31834 return; 31835 } 31836 if (isObjectLiteralExpression(assignedExpression) && every(assignedExpression.properties, isShorthandPropertyAssignment)) { 31837 forEach(assignedExpression.properties, bindExportAssignedObjectMemberAlias); 31838 return; 31839 } 31840 const flags = exportAssignmentIsAlias(node) ? 2097152 /* Alias */ : 4 /* Property */ | 1048576 /* ExportValue */ | 512 /* ValueModule */; 31841 const symbol = declareSymbol(file.symbol.exports, file.symbol, node, flags | 67108864 /* Assignment */, 0 /* None */); 31842 setValueDeclaration(symbol, node); 31843 } 31844 function bindExportAssignedObjectMemberAlias(node) { 31845 declareSymbol(file.symbol.exports, file.symbol, node, 2097152 /* Alias */ | 67108864 /* Assignment */, 0 /* None */); 31846 } 31847 function bindThisPropertyAssignment(node) { 31848 Debug.assert(isInJSFile(node)); 31849 const hasPrivateIdentifier = isBinaryExpression(node) && isPropertyAccessExpression(node.left) && isPrivateIdentifier(node.left.name) || isPropertyAccessExpression(node) && isPrivateIdentifier(node.name); 31850 if (hasPrivateIdentifier) { 31851 return; 31852 } 31853 const thisContainer = getThisContainer(node, false); 31854 switch (thisContainer.kind) { 31855 case 263 /* FunctionDeclaration */: 31856 case 218 /* FunctionExpression */: 31857 let constructorSymbol = thisContainer.symbol; 31858 if (isBinaryExpression(thisContainer.parent) && thisContainer.parent.operatorToken.kind === 63 /* EqualsToken */) { 31859 const l = thisContainer.parent.left; 31860 if (isBindableStaticAccessExpression(l) && isPrototypeAccess(l.expression)) { 31861 constructorSymbol = lookupSymbolForPropertyAccess(l.expression.expression, thisParentContainer); 31862 } 31863 } 31864 if (constructorSymbol && constructorSymbol.valueDeclaration) { 31865 constructorSymbol.members = constructorSymbol.members || createSymbolTable(); 31866 if (hasDynamicName(node)) { 31867 bindDynamicallyNamedThisPropertyAssignment(node, constructorSymbol, constructorSymbol.members); 31868 } else { 31869 declareSymbol(constructorSymbol.members, constructorSymbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* PropertyExcludes */ & ~4 /* Property */); 31870 } 31871 addDeclarationToSymbol(constructorSymbol, constructorSymbol.valueDeclaration, 32 /* Class */); 31872 } 31873 break; 31874 case 176 /* Constructor */: 31875 case 171 /* PropertyDeclaration */: 31876 case 172 /* AnnotationPropertyDeclaration */: 31877 case 174 /* MethodDeclaration */: 31878 case 177 /* GetAccessor */: 31879 case 178 /* SetAccessor */: 31880 case 175 /* ClassStaticBlockDeclaration */: 31881 const containingClass = thisContainer.parent; 31882 const symbolTable = isStatic(thisContainer) ? containingClass.symbol.exports : containingClass.symbol.members; 31883 if (hasDynamicName(node)) { 31884 bindDynamicallyNamedThisPropertyAssignment(node, containingClass.symbol, symbolTable); 31885 } else { 31886 declareSymbol(symbolTable, containingClass.symbol, node, 4 /* Property */ | 67108864 /* Assignment */, 0 /* None */, true); 31887 } 31888 break; 31889 case 314 /* SourceFile */: 31890 if (hasDynamicName(node)) { 31891 break; 31892 } else if (thisContainer.commonJsModuleIndicator) { 31893 declareSymbol(thisContainer.symbol.exports, thisContainer.symbol, node, 4 /* Property */ | 1048576 /* ExportValue */, 0 /* None */); 31894 } else { 31895 declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 111550 /* FunctionScopedVariableExcludes */); 31896 } 31897 break; 31898 default: 31899 Debug.failBadSyntaxKind(thisContainer); 31900 } 31901 } 31902 function bindDynamicallyNamedThisPropertyAssignment(node, symbol, symbolTable) { 31903 declareSymbol(symbolTable, symbol, node, 4 /* Property */, 0 /* None */, true, true); 31904 addLateBoundAssignmentDeclarationToSymbol(node, symbol); 31905 } 31906 function addLateBoundAssignmentDeclarationToSymbol(node, symbol) { 31907 if (symbol) { 31908 (symbol.assignmentDeclarationMembers || (symbol.assignmentDeclarationMembers = new Map2())).set(getNodeId(node), node); 31909 } 31910 } 31911 function bindSpecialPropertyDeclaration(node) { 31912 if (node.expression.kind === 109 /* ThisKeyword */) { 31913 bindThisPropertyAssignment(node); 31914 } else if (isBindableStaticAccessExpression(node) && node.parent.parent.kind === 314 /* SourceFile */) { 31915 if (isPrototypeAccess(node.expression)) { 31916 bindPrototypePropertyAssignment(node, node.parent); 31917 } else { 31918 bindStaticPropertyAssignment(node); 31919 } 31920 } 31921 } 31922 function bindPrototypeAssignment(node) { 31923 setParent(node.left, node); 31924 setParent(node.right, node); 31925 bindPropertyAssignment(node.left.expression, node.left, false, true); 31926 } 31927 function bindObjectDefinePrototypeProperty(node) { 31928 const namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0].expression); 31929 if (namespaceSymbol && namespaceSymbol.valueDeclaration) { 31930 addDeclarationToSymbol(namespaceSymbol, namespaceSymbol.valueDeclaration, 32 /* Class */); 31931 } 31932 bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, true); 31933 } 31934 function bindPrototypePropertyAssignment(lhs, parent2) { 31935 const classPrototype = lhs.expression; 31936 const constructorFunction = classPrototype.expression; 31937 setParent(constructorFunction, classPrototype); 31938 setParent(classPrototype, lhs); 31939 setParent(lhs, parent2); 31940 bindPropertyAssignment(constructorFunction, lhs, true, true); 31941 } 31942 function bindObjectDefinePropertyAssignment(node) { 31943 let namespaceSymbol = lookupSymbolForPropertyAccess(node.arguments[0]); 31944 const isToplevel = node.parent.parent.kind === 314 /* SourceFile */; 31945 namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, node.arguments[0], isToplevel, false, false); 31946 bindPotentiallyNewExpandoMemberToNamespace(node, namespaceSymbol, false); 31947 } 31948 function bindSpecialPropertyAssignment(node) { 31949 var _a2; 31950 const parentSymbol = lookupSymbolForPropertyAccess(node.left.expression, container) || lookupSymbolForPropertyAccess(node.left.expression, blockScopeContainer); 31951 if (!isInJSFile(node) && !isFunctionSymbol(parentSymbol)) { 31952 return; 31953 } 31954 const rootExpr = getLeftmostAccessExpression(node.left); 31955 if (isIdentifier(rootExpr) && ((_a2 = lookupSymbolForName(container, rootExpr.escapedText)) == null ? void 0 : _a2.flags) & 2097152 /* Alias */) { 31956 return; 31957 } 31958 setParent(node.left, node); 31959 setParent(node.right, node); 31960 if (isIdentifier(node.left.expression) && container === file && isExportsOrModuleExportsOrAlias(file, node.left.expression)) { 31961 bindExportsPropertyAssignment(node); 31962 } else if (hasDynamicName(node)) { 31963 bindAnonymousDeclaration(node, 4 /* Property */ | 67108864 /* Assignment */, "__computed" /* Computed */); 31964 const sym = bindPotentiallyMissingNamespaces(parentSymbol, node.left.expression, isTopLevelNamespaceAssignment(node.left), false, false); 31965 addLateBoundAssignmentDeclarationToSymbol(node, sym); 31966 } else { 31967 bindStaticPropertyAssignment(cast(node.left, isBindableStaticNameExpression)); 31968 } 31969 } 31970 function bindStaticPropertyAssignment(node) { 31971 Debug.assert(!isIdentifier(node)); 31972 setParent(node.expression, node); 31973 bindPropertyAssignment(node.expression, node, false, false); 31974 } 31975 function bindPotentiallyMissingNamespaces(namespaceSymbol, entityName, isToplevel, isPrototypeProperty, containerIsClass) { 31976 if ((namespaceSymbol == null ? void 0 : namespaceSymbol.flags) & 2097152 /* Alias */) { 31977 return namespaceSymbol; 31978 } 31979 if (isToplevel && !isPrototypeProperty) { 31980 const flags = 1536 /* Module */ | 67108864 /* Assignment */; 31981 const excludeFlags = 110735 /* ValueModuleExcludes */ & ~67108864 /* Assignment */; 31982 namespaceSymbol = forEachIdentifierInEntityName(entityName, namespaceSymbol, (id, symbol, parent2) => { 31983 if (symbol) { 31984 addDeclarationToSymbol(symbol, id, flags); 31985 return symbol; 31986 } else { 31987 const table = parent2 ? parent2.exports : file.jsGlobalAugmentations || (file.jsGlobalAugmentations = createSymbolTable()); 31988 return declareSymbol(table, parent2, id, flags, excludeFlags); 31989 } 31990 }); 31991 } 31992 if (containerIsClass && namespaceSymbol && namespaceSymbol.valueDeclaration) { 31993 addDeclarationToSymbol(namespaceSymbol, namespaceSymbol.valueDeclaration, 32 /* Class */); 31994 } 31995 return namespaceSymbol; 31996 } 31997 function bindPotentiallyNewExpandoMemberToNamespace(declaration, namespaceSymbol, isPrototypeProperty) { 31998 if (!namespaceSymbol || !isExpandoSymbol(namespaceSymbol)) { 31999 return; 32000 } 32001 const symbolTable = isPrototypeProperty ? namespaceSymbol.members || (namespaceSymbol.members = createSymbolTable()) : namespaceSymbol.exports || (namespaceSymbol.exports = createSymbolTable()); 32002 let includes = 0 /* None */; 32003 let excludes = 0 /* None */; 32004 if (isFunctionLikeDeclaration(getAssignedExpandoInitializer(declaration))) { 32005 includes = 8192 /* Method */; 32006 excludes = 103359 /* MethodExcludes */; 32007 } else if (isCallExpression(declaration) && isBindableObjectDefinePropertyCall(declaration)) { 32008 if (some(declaration.arguments[2].properties, (p) => { 32009 const id = getNameOfDeclaration(p); 32010 return !!id && isIdentifier(id) && idText(id) === "set"; 32011 })) { 32012 includes |= 65536 /* SetAccessor */ | 4 /* Property */; 32013 excludes |= 78783 /* SetAccessorExcludes */; 32014 } 32015 if (some(declaration.arguments[2].properties, (p) => { 32016 const id = getNameOfDeclaration(p); 32017 return !!id && isIdentifier(id) && idText(id) === "get"; 32018 })) { 32019 includes |= 32768 /* GetAccessor */ | 4 /* Property */; 32020 excludes |= 46015 /* GetAccessorExcludes */; 32021 } 32022 } 32023 if (includes === 0 /* None */) { 32024 includes = 4 /* Property */; 32025 excludes = 0 /* PropertyExcludes */; 32026 } 32027 declareSymbol(symbolTable, namespaceSymbol, declaration, includes | 67108864 /* Assignment */, excludes & ~67108864 /* Assignment */); 32028 } 32029 function isTopLevelNamespaceAssignment(propertyAccess) { 32030 return isBinaryExpression(propertyAccess.parent) ? getParentOfBinaryExpression(propertyAccess.parent).parent.kind === 314 /* SourceFile */ : propertyAccess.parent.parent.kind === 314 /* SourceFile */; 32031 } 32032 function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty, containerIsClass) { 32033 let namespaceSymbol = lookupSymbolForPropertyAccess(name, container) || lookupSymbolForPropertyAccess(name, blockScopeContainer); 32034 const isToplevel = isTopLevelNamespaceAssignment(propertyAccess); 32035 namespaceSymbol = bindPotentiallyMissingNamespaces(namespaceSymbol, propertyAccess.expression, isToplevel, isPrototypeProperty, containerIsClass); 32036 bindPotentiallyNewExpandoMemberToNamespace(propertyAccess, namespaceSymbol, isPrototypeProperty); 32037 } 32038 function isExpandoSymbol(symbol) { 32039 if (symbol.flags & (16 /* Function */ | 32 /* Class */ | 1024 /* NamespaceModule */)) { 32040 return true; 32041 } 32042 const node = symbol.valueDeclaration; 32043 if (node && isCallExpression(node)) { 32044 return !!getAssignedExpandoInitializer(node); 32045 } 32046 let init = !node ? void 0 : isVariableDeclaration(node) ? node.initializer : isBinaryExpression(node) ? node.right : isPropertyAccessExpression(node) && isBinaryExpression(node.parent) ? node.parent.right : void 0; 32047 init = init && getRightMostAssignedExpression(init); 32048 if (init) { 32049 const isPrototypeAssignment = isPrototypeAccess(isVariableDeclaration(node) ? node.name : isBinaryExpression(node) ? node.left : node); 32050 return !!getExpandoInitializer(isBinaryExpression(init) && (init.operatorToken.kind === 56 /* BarBarToken */ || init.operatorToken.kind === 60 /* QuestionQuestionToken */) ? init.right : init, isPrototypeAssignment); 32051 } 32052 return false; 32053 } 32054 function getParentOfBinaryExpression(expr) { 32055 while (isBinaryExpression(expr.parent)) { 32056 expr = expr.parent; 32057 } 32058 return expr.parent; 32059 } 32060 function lookupSymbolForPropertyAccess(node, lookupContainer = container) { 32061 if (isIdentifier(node)) { 32062 return lookupSymbolForName(lookupContainer, node.escapedText); 32063 } else { 32064 const symbol = lookupSymbolForPropertyAccess(node.expression); 32065 return symbol && symbol.exports && symbol.exports.get(getElementOrPropertyAccessName(node)); 32066 } 32067 } 32068 function forEachIdentifierInEntityName(e, parent2, action) { 32069 if (isExportsOrModuleExportsOrAlias(file, e)) { 32070 return file.symbol; 32071 } else if (isIdentifier(e)) { 32072 return action(e, lookupSymbolForPropertyAccess(e), parent2); 32073 } else { 32074 const s = forEachIdentifierInEntityName(e.expression, parent2, action); 32075 const name = getNameOrArgument(e); 32076 if (isPrivateIdentifier(name)) { 32077 Debug.fail("unexpected PrivateIdentifier"); 32078 } 32079 return action(name, s && s.exports && s.exports.get(getElementOrPropertyAccessName(e)), s); 32080 } 32081 } 32082 function bindCallExpression(node) { 32083 if (!file.commonJsModuleIndicator && isRequireCall(node, false)) { 32084 setCommonJsModuleIndicator(node); 32085 } 32086 } 32087 function bindClassLikeDeclaration(node) { 32088 if (node.kind === 264 /* ClassDeclaration */ || node.kind === 265 /* StructDeclaration */) { 32089 bindBlockScopedDeclaration(node, 32 /* Class */, 899503 /* ClassExcludes */); 32090 } else { 32091 const bindingName = node.name ? node.name.escapedText : "__class" /* Class */; 32092 bindAnonymousDeclaration(node, 32 /* Class */, bindingName); 32093 if (node.name) { 32094 classifiableNames.add(node.name.escapedText); 32095 } 32096 } 32097 const { symbol } = node; 32098 const prototypeSymbol = createSymbol(4 /* Property */ | 4194304 /* Prototype */, "prototype"); 32099 const symbolExport = symbol.exports.get(prototypeSymbol.escapedName); 32100 if (symbolExport) { 32101 if (node.name) { 32102 setParent(node.name, node); 32103 } 32104 file.bindDiagnostics.push(createDiagnosticForNode2(symbolExport.declarations[0], Diagnostics.Duplicate_identifier_0, symbolName(prototypeSymbol))); 32105 } 32106 symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol); 32107 prototypeSymbol.parent = symbol; 32108 } 32109 function bindAnnotationDeclaration(node) { 32110 Debug.assert(node.kind === 266 /* AnnotationDeclaration */); 32111 bindBlockScopedDeclaration(node, 32 /* Class */ | 268435456 /* Annotation */, 899503 /* ClassExcludes */); 32112 const { symbol } = node; 32113 const prototypeSymbol = createSymbol(4 /* Property */ | 4194304 /* Prototype */, "prototype"); 32114 const symbolExport = symbol.exports.get(prototypeSymbol.escapedName); 32115 if (symbolExport) { 32116 if (node.name) { 32117 setParent(node.name, node); 32118 } 32119 file.bindDiagnostics.push(createDiagnosticForNode2(symbolExport.declarations[0], Diagnostics.Duplicate_identifier_0, symbolName(prototypeSymbol))); 32120 } 32121 symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol); 32122 prototypeSymbol.parent = symbol; 32123 } 32124 function bindEnumDeclaration(node) { 32125 return isEnumConst(node) ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */) : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */); 32126 } 32127 function bindVariableDeclarationOrBindingElement(node) { 32128 if (inStrictMode) { 32129 checkStrictModeEvalOrArguments(node, node.name); 32130 } 32131 if (!isBindingPattern(node.name)) { 32132 const possibleVariableDecl = node.kind === 261 /* VariableDeclaration */ ? node : node.parent.parent; 32133 if (isInJSFile(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(possibleVariableDecl) && !getJSDocTypeTag(node) && !(getCombinedModifierFlags(node) & 1 /* Export */)) { 32134 declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); 32135 } else if (isBlockOrCatchScoped(node)) { 32136 bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 111551 /* BlockScopedVariableExcludes */); 32137 } else if (isParameterDeclaration(node)) { 32138 declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 111551 /* ParameterExcludes */); 32139 } else { 32140 declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 111550 /* FunctionScopedVariableExcludes */); 32141 } 32142 } 32143 } 32144 function bindParameter(node) { 32145 if (node.kind === 349 /* JSDocParameterTag */ && container.kind !== 332 /* JSDocSignature */) { 32146 return; 32147 } 32148 if (inStrictMode && !(node.flags & 16777216 /* Ambient */)) { 32149 checkStrictModeEvalOrArguments(node, node.name); 32150 } 32151 if (isBindingPattern(node.name)) { 32152 bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, "__" + node.parent.parameters.indexOf(node)); 32153 } else { 32154 declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 111551 /* ParameterExcludes */); 32155 } 32156 if (isParameterPropertyDeclaration(node, node.parent)) { 32157 const classDeclaration = node.parent.parent; 32158 declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), 0 /* PropertyExcludes */); 32159 } 32160 } 32161 function bindFunctionDeclaration(node) { 32162 if (!file.isDeclarationFile && !(node.flags & 16777216 /* Ambient */)) { 32163 if (isAsyncFunction(node)) { 32164 emitFlags |= 2048 /* HasAsyncFunctions */; 32165 } 32166 } 32167 checkStrictModeFunctionName(node); 32168 if (inStrictMode) { 32169 checkStrictModeFunctionDeclaration(node); 32170 bindBlockScopedDeclaration(node, 16 /* Function */, 110991 /* FunctionExcludes */); 32171 } else { 32172 declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 110991 /* FunctionExcludes */); 32173 } 32174 } 32175 function bindFunctionExpression(node) { 32176 if (!file.isDeclarationFile && !(node.flags & 16777216 /* Ambient */)) { 32177 if (isAsyncFunction(node)) { 32178 emitFlags |= 2048 /* HasAsyncFunctions */; 32179 } 32180 } 32181 if (currentFlow) { 32182 node.flowNode = currentFlow; 32183 } 32184 checkStrictModeFunctionName(node); 32185 const bindingName = node.name ? node.name.escapedText : "__function" /* Function */; 32186 return bindAnonymousDeclaration(node, 16 /* Function */, bindingName); 32187 } 32188 function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { 32189 if (!file.isDeclarationFile && !(node.flags & 16777216 /* Ambient */) && isAsyncFunction(node)) { 32190 emitFlags |= 2048 /* HasAsyncFunctions */; 32191 } 32192 if (currentFlow && isObjectLiteralOrClassExpressionMethodOrAccessor(node)) { 32193 node.flowNode = currentFlow; 32194 } 32195 return hasDynamicName(node) ? bindAnonymousDeclaration(node, symbolFlags, "__computed" /* Computed */) : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); 32196 } 32197 function getInferTypeContainer(node) { 32198 const extendsType = findAncestor(node, (n) => n.parent && isConditionalTypeNode(n.parent) && n.parent.extendsType === n); 32199 return extendsType && extendsType.parent; 32200 } 32201 function bindTypeParameter(node) { 32202 if (isJSDocTemplateTag(node.parent)) { 32203 const container2 = getEffectiveContainerForJSDocTemplateTag(node.parent); 32204 if (container2) { 32205 if (!container2.locals) { 32206 container2.locals = createSymbolTable(); 32207 } 32208 declareSymbol(container2.locals, void 0, node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); 32209 } else { 32210 declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); 32211 } 32212 } else if (node.parent.kind === 195 /* InferType */) { 32213 const container2 = getInferTypeContainer(node.parent); 32214 if (container2) { 32215 if (!container2.locals) { 32216 container2.locals = createSymbolTable(); 32217 } 32218 declareSymbol(container2.locals, void 0, node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); 32219 } else { 32220 bindAnonymousDeclaration(node, 262144 /* TypeParameter */, getDeclarationName(node)); 32221 } 32222 } else { 32223 declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 526824 /* TypeParameterExcludes */); 32224 } 32225 } 32226 function shouldReportErrorOnModuleDeclaration(node) { 32227 const instanceState = getModuleInstanceState(node); 32228 return instanceState === 1 /* Instantiated */ || instanceState === 2 /* ConstEnumOnly */ && shouldPreserveConstEnums(options); 32229 } 32230 function checkUnreachable(node) { 32231 if (!(currentFlow.flags & 1 /* Unreachable */)) { 32232 return false; 32233 } 32234 if (currentFlow === unreachableFlow) { 32235 const reportError = isStatementButNotDeclaration(node) && node.kind !== 243 /* EmptyStatement */ || node.kind === 264 /* ClassDeclaration */ || node.kind === 270 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node); 32236 if (reportError) { 32237 currentFlow = reportedUnreachableFlow; 32238 if (!options.allowUnreachableCode) { 32239 const isError = unreachableCodeIsError(options) && !(node.flags & 16777216 /* Ambient */) && (!isVariableStatement(node) || !!(getCombinedNodeFlags(node.declarationList) & 3 /* BlockScoped */) || node.declarationList.declarations.some((d) => !!d.initializer)); 32240 eachUnreachableRange(node, (start, end) => errorOrSuggestionOnRange(isError, start, end, Diagnostics.Unreachable_code_detected)); 32241 } 32242 } 32243 } 32244 return true; 32245 } 32246} 32247function eachUnreachableRange(node, cb) { 32248 if (isStatement(node) && isExecutableStatement(node) && isBlock(node.parent)) { 32249 const { statements } = node.parent; 32250 const slice = sliceAfter(statements, node); 32251 getRangesWhere(slice, isExecutableStatement, (start, afterEnd) => cb(slice[start], slice[afterEnd - 1])); 32252 } else { 32253 cb(node, node); 32254 } 32255} 32256function isExecutableStatement(s) { 32257 return !isFunctionDeclaration(s) && !isPurelyTypeDeclaration(s) && !isEnumDeclaration(s) && !(isVariableStatement(s) && !(getCombinedNodeFlags(s) & (1 /* Let */ | 2 /* Const */)) && s.declarationList.declarations.some((d) => !d.initializer)); 32258} 32259function isPurelyTypeDeclaration(s) { 32260 switch (s.kind) { 32261 case 267 /* InterfaceDeclaration */: 32262 case 268 /* TypeAliasDeclaration */: 32263 return true; 32264 case 270 /* ModuleDeclaration */: 32265 return getModuleInstanceState(s) !== 1 /* Instantiated */; 32266 case 269 /* EnumDeclaration */: 32267 return hasSyntacticModifier(s, 2048 /* Const */); 32268 default: 32269 return false; 32270 } 32271} 32272function isExportsOrModuleExportsOrAlias(sourceFile, node) { 32273 let i = 0; 32274 const q = createQueue(); 32275 q.enqueue(node); 32276 while (!q.isEmpty() && i < 100) { 32277 i++; 32278 node = q.dequeue(); 32279 if (isExportsIdentifier(node) || isModuleExportsAccessExpression(node)) { 32280 return true; 32281 } else if (isIdentifier(node)) { 32282 const symbol = lookupSymbolForName(sourceFile, node.escapedText); 32283 if (!!symbol && !!symbol.valueDeclaration && isVariableDeclaration(symbol.valueDeclaration) && !!symbol.valueDeclaration.initializer) { 32284 const init = symbol.valueDeclaration.initializer; 32285 q.enqueue(init); 32286 if (isAssignmentExpression(init, true)) { 32287 q.enqueue(init.left); 32288 q.enqueue(init.right); 32289 } 32290 } 32291 } 32292 } 32293 return false; 32294} 32295function lookupSymbolForName(container, name) { 32296 const local = container.locals && container.locals.get(name); 32297 if (local) { 32298 return local.exportSymbol || local; 32299 } 32300 if (isSourceFile(container) && container.jsGlobalAugmentations && container.jsGlobalAugmentations.has(name)) { 32301 return container.jsGlobalAugmentations.get(name); 32302 } 32303 return container.symbol && container.symbol.exports && container.symbol.exports.get(name); 32304} 32305 32306// src/compiler/checker.ts 32307var nextSymbolId = 1; 32308var nextNodeId = 1; 32309var TypeFacts = /* @__PURE__ */ ((TypeFacts3) => { 32310 TypeFacts3[TypeFacts3["None"] = 0] = "None"; 32311 TypeFacts3[TypeFacts3["TypeofEQString"] = 1] = "TypeofEQString"; 32312 TypeFacts3[TypeFacts3["TypeofEQNumber"] = 2] = "TypeofEQNumber"; 32313 TypeFacts3[TypeFacts3["TypeofEQBigInt"] = 4] = "TypeofEQBigInt"; 32314 TypeFacts3[TypeFacts3["TypeofEQBoolean"] = 8] = "TypeofEQBoolean"; 32315 TypeFacts3[TypeFacts3["TypeofEQSymbol"] = 16] = "TypeofEQSymbol"; 32316 TypeFacts3[TypeFacts3["TypeofEQObject"] = 32] = "TypeofEQObject"; 32317 TypeFacts3[TypeFacts3["TypeofEQFunction"] = 64] = "TypeofEQFunction"; 32318 TypeFacts3[TypeFacts3["TypeofEQHostObject"] = 128] = "TypeofEQHostObject"; 32319 TypeFacts3[TypeFacts3["TypeofNEString"] = 256] = "TypeofNEString"; 32320 TypeFacts3[TypeFacts3["TypeofNENumber"] = 512] = "TypeofNENumber"; 32321 TypeFacts3[TypeFacts3["TypeofNEBigInt"] = 1024] = "TypeofNEBigInt"; 32322 TypeFacts3[TypeFacts3["TypeofNEBoolean"] = 2048] = "TypeofNEBoolean"; 32323 TypeFacts3[TypeFacts3["TypeofNESymbol"] = 4096] = "TypeofNESymbol"; 32324 TypeFacts3[TypeFacts3["TypeofNEObject"] = 8192] = "TypeofNEObject"; 32325 TypeFacts3[TypeFacts3["TypeofNEFunction"] = 16384] = "TypeofNEFunction"; 32326 TypeFacts3[TypeFacts3["TypeofNEHostObject"] = 32768] = "TypeofNEHostObject"; 32327 TypeFacts3[TypeFacts3["EQUndefined"] = 65536] = "EQUndefined"; 32328 TypeFacts3[TypeFacts3["EQNull"] = 131072] = "EQNull"; 32329 TypeFacts3[TypeFacts3["EQUndefinedOrNull"] = 262144] = "EQUndefinedOrNull"; 32330 TypeFacts3[TypeFacts3["NEUndefined"] = 524288] = "NEUndefined"; 32331 TypeFacts3[TypeFacts3["NENull"] = 1048576] = "NENull"; 32332 TypeFacts3[TypeFacts3["NEUndefinedOrNull"] = 2097152] = "NEUndefinedOrNull"; 32333 TypeFacts3[TypeFacts3["Truthy"] = 4194304] = "Truthy"; 32334 TypeFacts3[TypeFacts3["Falsy"] = 8388608] = "Falsy"; 32335 TypeFacts3[TypeFacts3["IsUndefined"] = 16777216] = "IsUndefined"; 32336 TypeFacts3[TypeFacts3["IsNull"] = 33554432] = "IsNull"; 32337 TypeFacts3[TypeFacts3["IsUndefinedOrNull"] = 50331648] = "IsUndefinedOrNull"; 32338 TypeFacts3[TypeFacts3["All"] = 134217727] = "All"; 32339 TypeFacts3[TypeFacts3["BaseStringStrictFacts"] = 3735041] = "BaseStringStrictFacts"; 32340 TypeFacts3[TypeFacts3["BaseStringFacts"] = 12582401] = "BaseStringFacts"; 32341 TypeFacts3[TypeFacts3["StringStrictFacts"] = 16317953] = "StringStrictFacts"; 32342 TypeFacts3[TypeFacts3["StringFacts"] = 16776705] = "StringFacts"; 32343 TypeFacts3[TypeFacts3["EmptyStringStrictFacts"] = 12123649] = "EmptyStringStrictFacts"; 32344 TypeFacts3[TypeFacts3["EmptyStringFacts"] = 12582401 /* BaseStringFacts */] = "EmptyStringFacts"; 32345 TypeFacts3[TypeFacts3["NonEmptyStringStrictFacts"] = 7929345] = "NonEmptyStringStrictFacts"; 32346 TypeFacts3[TypeFacts3["NonEmptyStringFacts"] = 16776705] = "NonEmptyStringFacts"; 32347 TypeFacts3[TypeFacts3["BaseNumberStrictFacts"] = 3734786] = "BaseNumberStrictFacts"; 32348 TypeFacts3[TypeFacts3["BaseNumberFacts"] = 12582146] = "BaseNumberFacts"; 32349 TypeFacts3[TypeFacts3["NumberStrictFacts"] = 16317698] = "NumberStrictFacts"; 32350 TypeFacts3[TypeFacts3["NumberFacts"] = 16776450] = "NumberFacts"; 32351 TypeFacts3[TypeFacts3["ZeroNumberStrictFacts"] = 12123394] = "ZeroNumberStrictFacts"; 32352 TypeFacts3[TypeFacts3["ZeroNumberFacts"] = 12582146 /* BaseNumberFacts */] = "ZeroNumberFacts"; 32353 TypeFacts3[TypeFacts3["NonZeroNumberStrictFacts"] = 7929090] = "NonZeroNumberStrictFacts"; 32354 TypeFacts3[TypeFacts3["NonZeroNumberFacts"] = 16776450] = "NonZeroNumberFacts"; 32355 TypeFacts3[TypeFacts3["BaseBigIntStrictFacts"] = 3734276] = "BaseBigIntStrictFacts"; 32356 TypeFacts3[TypeFacts3["BaseBigIntFacts"] = 12581636] = "BaseBigIntFacts"; 32357 TypeFacts3[TypeFacts3["BigIntStrictFacts"] = 16317188] = "BigIntStrictFacts"; 32358 TypeFacts3[TypeFacts3["BigIntFacts"] = 16775940] = "BigIntFacts"; 32359 TypeFacts3[TypeFacts3["ZeroBigIntStrictFacts"] = 12122884] = "ZeroBigIntStrictFacts"; 32360 TypeFacts3[TypeFacts3["ZeroBigIntFacts"] = 12581636 /* BaseBigIntFacts */] = "ZeroBigIntFacts"; 32361 TypeFacts3[TypeFacts3["NonZeroBigIntStrictFacts"] = 7928580] = "NonZeroBigIntStrictFacts"; 32362 TypeFacts3[TypeFacts3["NonZeroBigIntFacts"] = 16775940] = "NonZeroBigIntFacts"; 32363 TypeFacts3[TypeFacts3["BaseBooleanStrictFacts"] = 3733256] = "BaseBooleanStrictFacts"; 32364 TypeFacts3[TypeFacts3["BaseBooleanFacts"] = 12580616] = "BaseBooleanFacts"; 32365 TypeFacts3[TypeFacts3["BooleanStrictFacts"] = 16316168] = "BooleanStrictFacts"; 32366 TypeFacts3[TypeFacts3["BooleanFacts"] = 16774920] = "BooleanFacts"; 32367 TypeFacts3[TypeFacts3["FalseStrictFacts"] = 12121864] = "FalseStrictFacts"; 32368 TypeFacts3[TypeFacts3["FalseFacts"] = 12580616 /* BaseBooleanFacts */] = "FalseFacts"; 32369 TypeFacts3[TypeFacts3["TrueStrictFacts"] = 7927560] = "TrueStrictFacts"; 32370 TypeFacts3[TypeFacts3["TrueFacts"] = 16774920] = "TrueFacts"; 32371 TypeFacts3[TypeFacts3["SymbolStrictFacts"] = 7925520] = "SymbolStrictFacts"; 32372 TypeFacts3[TypeFacts3["SymbolFacts"] = 16772880] = "SymbolFacts"; 32373 TypeFacts3[TypeFacts3["ObjectStrictFacts"] = 7888800] = "ObjectStrictFacts"; 32374 TypeFacts3[TypeFacts3["ObjectFacts"] = 16736160] = "ObjectFacts"; 32375 TypeFacts3[TypeFacts3["FunctionStrictFacts"] = 7880640] = "FunctionStrictFacts"; 32376 TypeFacts3[TypeFacts3["FunctionFacts"] = 16728e3] = "FunctionFacts"; 32377 TypeFacts3[TypeFacts3["VoidFacts"] = 9830144] = "VoidFacts"; 32378 TypeFacts3[TypeFacts3["UndefinedFacts"] = 26607360] = "UndefinedFacts"; 32379 TypeFacts3[TypeFacts3["NullFacts"] = 42917664] = "NullFacts"; 32380 TypeFacts3[TypeFacts3["EmptyObjectStrictFacts"] = 83427327] = "EmptyObjectStrictFacts"; 32381 TypeFacts3[TypeFacts3["EmptyObjectFacts"] = 83886079] = "EmptyObjectFacts"; 32382 TypeFacts3[TypeFacts3["UnknownFacts"] = 83886079] = "UnknownFacts"; 32383 TypeFacts3[TypeFacts3["AllTypeofNE"] = 556800] = "AllTypeofNE"; 32384 TypeFacts3[TypeFacts3["OrFactsMask"] = 8256] = "OrFactsMask"; 32385 TypeFacts3[TypeFacts3["AndFactsMask"] = 134209471] = "AndFactsMask"; 32386 return TypeFacts3; 32387})(TypeFacts || {}); 32388var typeofNEFacts = new Map2(getEntries({ 32389 string: 256 /* TypeofNEString */, 32390 number: 512 /* TypeofNENumber */, 32391 bigint: 1024 /* TypeofNEBigInt */, 32392 boolean: 2048 /* TypeofNEBoolean */, 32393 symbol: 4096 /* TypeofNESymbol */, 32394 undefined: 524288 /* NEUndefined */, 32395 object: 8192 /* TypeofNEObject */, 32396 function: 16384 /* TypeofNEFunction */ 32397})); 32398var CheckMode = /* @__PURE__ */ ((CheckMode3) => { 32399 CheckMode3[CheckMode3["Normal"] = 0] = "Normal"; 32400 CheckMode3[CheckMode3["Contextual"] = 1] = "Contextual"; 32401 CheckMode3[CheckMode3["Inferential"] = 2] = "Inferential"; 32402 CheckMode3[CheckMode3["SkipContextSensitive"] = 4] = "SkipContextSensitive"; 32403 CheckMode3[CheckMode3["SkipGenericFunctions"] = 8] = "SkipGenericFunctions"; 32404 CheckMode3[CheckMode3["IsForSignatureHelp"] = 16] = "IsForSignatureHelp"; 32405 CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 32] = "IsForStringLiteralArgumentCompletions"; 32406 CheckMode3[CheckMode3["RestBindingElement"] = 64] = "RestBindingElement"; 32407 CheckMode3[CheckMode3["SkipEtsComponentBody"] = 128] = "SkipEtsComponentBody"; 32408 return CheckMode3; 32409})(CheckMode || {}); 32410var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => { 32411 SignatureCheckMode3[SignatureCheckMode3["BivariantCallback"] = 1] = "BivariantCallback"; 32412 SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback"; 32413 SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes"; 32414 SignatureCheckMode3[SignatureCheckMode3["StrictArity"] = 8] = "StrictArity"; 32415 SignatureCheckMode3[SignatureCheckMode3["Callback"] = 3] = "Callback"; 32416 return SignatureCheckMode3; 32417})(SignatureCheckMode || {}); 32418var isNotOverloadAndNotAccessor = and(isNotOverload, isNotAccessor); 32419var intrinsicTypeKinds = new Map2(getEntries({ 32420 Uppercase: 0 /* Uppercase */, 32421 Lowercase: 1 /* Lowercase */, 32422 Capitalize: 2 /* Capitalize */, 32423 Uncapitalize: 3 /* Uncapitalize */ 32424})); 32425function getNodeId(node) { 32426 if (!node.id) { 32427 node.id = nextNodeId; 32428 nextNodeId++; 32429 } 32430 return node.id; 32431} 32432function getSymbolId(symbol) { 32433 if (!symbol.id) { 32434 symbol.id = nextSymbolId; 32435 nextSymbolId++; 32436 } 32437 return symbol.id; 32438} 32439function isNotAccessor(declaration) { 32440 return !isAccessor(declaration); 32441} 32442function isNotOverload(declaration) { 32443 return declaration.kind !== 263 /* FunctionDeclaration */ && declaration.kind !== 174 /* MethodDeclaration */ || !!declaration.body; 32444} 32445var JsxNames; 32446((JsxNames2) => { 32447 JsxNames2.JSX = "JSX"; 32448 JsxNames2.IntrinsicElements = "IntrinsicElements"; 32449 JsxNames2.ElementClass = "ElementClass"; 32450 JsxNames2.ElementAttributesPropertyNameContainer = "ElementAttributesProperty"; 32451 JsxNames2.ElementChildrenAttributeNameContainer = "ElementChildrenAttribute"; 32452 JsxNames2.Element = "Element"; 32453 JsxNames2.IntrinsicAttributes = "IntrinsicAttributes"; 32454 JsxNames2.IntrinsicClassAttributes = "IntrinsicClassAttributes"; 32455 JsxNames2.LibraryManagedAttributes = "LibraryManagedAttributes"; 32456})(JsxNames || (JsxNames = {})); 32457 32458// src/compiler/visitorPublic.ts 32459function visitNode(node, visitor, test, lift) { 32460 if (node === void 0 || visitor === void 0) { 32461 return node; 32462 } 32463 const visited = visitor(node); 32464 if (visited === node) { 32465 return node; 32466 } 32467 let visitedNode; 32468 if (visited === void 0) { 32469 return void 0; 32470 } else if (isArray(visited)) { 32471 visitedNode = (lift || extractSingleNode)(visited); 32472 } else { 32473 visitedNode = visited; 32474 } 32475 Debug.assertNode(visitedNode, test); 32476 return visitedNode; 32477} 32478function visitNodes2(nodes, visitor, test, start, count) { 32479 if (nodes === void 0 || visitor === void 0) { 32480 return nodes; 32481 } 32482 const length2 = nodes.length; 32483 if (start === void 0 || start < 0) { 32484 start = 0; 32485 } 32486 if (count === void 0 || count > length2 - start) { 32487 count = length2 - start; 32488 } 32489 let hasTrailingComma; 32490 let pos = -1; 32491 let end = -1; 32492 if (start > 0 || count < length2) { 32493 hasTrailingComma = nodes.hasTrailingComma && start + count === length2; 32494 } else { 32495 pos = nodes.pos; 32496 end = nodes.end; 32497 hasTrailingComma = nodes.hasTrailingComma; 32498 } 32499 const updated = visitArrayWorker(nodes, visitor, test, start, count); 32500 if (updated !== nodes) { 32501 const updatedArray = factory.createNodeArray(updated, hasTrailingComma); 32502 setTextRangePosEnd(updatedArray, pos, end); 32503 return updatedArray; 32504 } 32505 return nodes; 32506} 32507function visitArrayWorker(nodes, visitor, test, start, count) { 32508 let updated; 32509 const length2 = nodes.length; 32510 if (start > 0 || count < length2) { 32511 updated = []; 32512 } 32513 for (let i = 0; i < count; i++) { 32514 const node = nodes[i + start]; 32515 const visited = node !== void 0 ? visitor(node) : void 0; 32516 if (updated !== void 0 || visited === void 0 || visited !== node) { 32517 if (updated === void 0) { 32518 updated = nodes.slice(0, i); 32519 } 32520 if (visited) { 32521 if (isArray(visited)) { 32522 for (const visitedNode of visited) { 32523 void Debug.assertNode(visitedNode, test); 32524 updated.push(visitedNode); 32525 } 32526 } else { 32527 void Debug.assertNode(visited, test); 32528 updated.push(visited); 32529 } 32530 } 32531 } 32532 } 32533 return updated != null ? updated : nodes; 32534} 32535function visitLexicalEnvironment(statements, visitor, context, start, ensureUseStrict, nodesVisitor = visitNodes2) { 32536 context.startLexicalEnvironment(); 32537 statements = nodesVisitor(statements, visitor, isStatement, start); 32538 if (ensureUseStrict) 32539 statements = context.factory.ensureUseStrict(statements); 32540 return factory.mergeLexicalEnvironment(statements, context.endLexicalEnvironment()); 32541} 32542function visitParameterList(nodes, visitor, context, nodesVisitor = visitNodes2) { 32543 let updated; 32544 context.startLexicalEnvironment(); 32545 if (nodes) { 32546 context.setLexicalEnvironmentFlags(1 /* InParameters */, true); 32547 updated = nodesVisitor(nodes, visitor, isParameterDeclaration); 32548 if (context.getLexicalEnvironmentFlags() & 2 /* VariablesHoistedInParameters */ && getEmitScriptTarget(context.getCompilerOptions()) >= 2 /* ES2015 */) { 32549 updated = addDefaultValueAssignmentsIfNeeded(updated, context); 32550 } 32551 context.setLexicalEnvironmentFlags(1 /* InParameters */, false); 32552 } 32553 context.suspendLexicalEnvironment(); 32554 return updated; 32555} 32556function addDefaultValueAssignmentsIfNeeded(parameters, context) { 32557 let result; 32558 for (let i = 0; i < parameters.length; i++) { 32559 const parameter = parameters[i]; 32560 const updated = addDefaultValueAssignmentIfNeeded(parameter, context); 32561 if (result || updated !== parameter) { 32562 if (!result) 32563 result = parameters.slice(0, i); 32564 result[i] = updated; 32565 } 32566 } 32567 if (result) { 32568 return setTextRange(context.factory.createNodeArray(result, parameters.hasTrailingComma), parameters); 32569 } 32570 return parameters; 32571} 32572function addDefaultValueAssignmentIfNeeded(parameter, context) { 32573 return parameter.dotDotDotToken ? parameter : isBindingPattern(parameter.name) ? addDefaultValueAssignmentForBindingPattern(parameter, context) : parameter.initializer ? addDefaultValueAssignmentForInitializer(parameter, parameter.name, parameter.initializer, context) : parameter; 32574} 32575function addDefaultValueAssignmentForBindingPattern(parameter, context) { 32576 const { factory: factory2 } = context; 32577 context.addInitializationStatement( 32578 factory2.createVariableStatement( 32579 void 0, 32580 factory2.createVariableDeclarationList([ 32581 factory2.createVariableDeclaration( 32582 parameter.name, 32583 void 0, 32584 parameter.type, 32585 parameter.initializer ? factory2.createConditionalExpression( 32586 factory2.createStrictEquality( 32587 factory2.getGeneratedNameForNode(parameter), 32588 factory2.createVoidZero() 32589 ), 32590 void 0, 32591 parameter.initializer, 32592 void 0, 32593 factory2.getGeneratedNameForNode(parameter) 32594 ) : factory2.getGeneratedNameForNode(parameter) 32595 ) 32596 ]) 32597 ) 32598 ); 32599 return factory2.updateParameterDeclaration( 32600 parameter, 32601 parameter.modifiers, 32602 parameter.dotDotDotToken, 32603 factory2.getGeneratedNameForNode(parameter), 32604 parameter.questionToken, 32605 parameter.type, 32606 void 0 32607 ); 32608} 32609function addDefaultValueAssignmentForInitializer(parameter, name, initializer, context) { 32610 const factory2 = context.factory; 32611 context.addInitializationStatement( 32612 factory2.createIfStatement( 32613 factory2.createTypeCheck(factory2.cloneNode(name), "undefined"), 32614 setEmitFlags( 32615 setTextRange( 32616 factory2.createBlock([ 32617 factory2.createExpressionStatement( 32618 setEmitFlags( 32619 setTextRange( 32620 factory2.createAssignment( 32621 setEmitFlags(factory2.cloneNode(name), 48 /* NoSourceMap */), 32622 setEmitFlags(initializer, 48 /* NoSourceMap */ | getEmitFlags(initializer) | 1536 /* NoComments */) 32623 ), 32624 parameter 32625 ), 32626 1536 /* NoComments */ 32627 ) 32628 ) 32629 ]), 32630 parameter 32631 ), 32632 1 /* SingleLine */ | 32 /* NoTrailingSourceMap */ | 384 /* NoTokenSourceMaps */ | 1536 /* NoComments */ 32633 ) 32634 ) 32635 ); 32636 return factory2.updateParameterDeclaration( 32637 parameter, 32638 parameter.modifiers, 32639 parameter.dotDotDotToken, 32640 parameter.name, 32641 parameter.questionToken, 32642 parameter.type, 32643 void 0 32644 ); 32645} 32646function visitFunctionBody(node, visitor, context, nodeVisitor = visitNode) { 32647 context.resumeLexicalEnvironment(); 32648 const updated = nodeVisitor(node, visitor, isConciseBody); 32649 const declarations = context.endLexicalEnvironment(); 32650 if (some(declarations)) { 32651 if (!updated) { 32652 return context.factory.createBlock(declarations); 32653 } 32654 const block = context.factory.converters.convertToFunctionBlock(updated); 32655 const statements = factory.mergeLexicalEnvironment(block.statements, declarations); 32656 return context.factory.updateBlock(block, statements); 32657 } 32658 return updated; 32659} 32660function visitIterationBody(body, visitor, context, nodeVisitor = visitNode) { 32661 context.startBlockScope(); 32662 const updated = nodeVisitor(body, visitor, isStatement, context.factory.liftToBlock); 32663 const declarations = context.endBlockScope(); 32664 if (some(declarations)) { 32665 if (isBlock(updated)) { 32666 declarations.push(...updated.statements); 32667 return context.factory.updateBlock(updated, declarations); 32668 } 32669 declarations.push(updated); 32670 return context.factory.createBlock(declarations); 32671 } 32672 return updated; 32673} 32674var visitEachChildTable = { 32675 [79 /* Identifier */]: function visitEachChildOfIdentifier(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 32676 return context.factory.updateIdentifier( 32677 node, 32678 nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration) 32679 ); 32680 }, 32681 [165 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 32682 return context.factory.updateQualifiedName( 32683 node, 32684 nodeVisitor(node.left, visitor, isEntityName), 32685 nodeVisitor(node.right, visitor, isIdentifier) 32686 ); 32687 }, 32688 [166 /* ComputedPropertyName */]: function visitEachChildOfComputedPropertyName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 32689 return context.factory.updateComputedPropertyName( 32690 node, 32691 nodeVisitor(node.expression, visitor, isExpression) 32692 ); 32693 }, 32694 [167 /* TypeParameter */]: function visitEachChildOfTypeParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 32695 return context.factory.updateTypeParameterDeclaration( 32696 node, 32697 nodesVisitor(node.modifiers, visitor, isModifier), 32698 nodeVisitor(node.name, visitor, isIdentifier), 32699 nodeVisitor(node.constraint, visitor, isTypeNode), 32700 nodeVisitor(node.default, visitor, isTypeNode) 32701 ); 32702 }, 32703 [168 /* Parameter */]: function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { 32704 return context.factory.updateParameterDeclaration( 32705 node, 32706 nodesVisitor(node.modifiers, visitor, isModifierLike), 32707 nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), 32708 nodeVisitor(node.name, visitor, isBindingName), 32709 nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), 32710 nodeVisitor(node.type, visitor, isTypeNode), 32711 nodeVisitor(node.initializer, visitor, isExpression) 32712 ); 32713 }, 32714 [169 /* Decorator */]: function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 32715 return context.factory.updateDecorator( 32716 node, 32717 nodeVisitor(node.expression, visitor, isExpression), 32718 node.annotationDeclaration 32719 ); 32720 }, 32721 [170 /* PropertySignature */]: function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { 32722 return context.factory.updatePropertySignature( 32723 node, 32724 nodesVisitor(node.modifiers, visitor, isModifier), 32725 nodeVisitor(node.name, visitor, isPropertyName), 32726 nodeVisitor(node.questionToken, tokenVisitor, isToken), 32727 nodeVisitor(node.type, visitor, isTypeNode) 32728 ); 32729 }, 32730 [171 /* PropertyDeclaration */]: function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { 32731 var _a2; 32732 return context.factory.updatePropertyDeclaration( 32733 node, 32734 nodesVisitor(node.modifiers, visitor, isModifierLike), 32735 nodeVisitor(node.name, visitor, isPropertyName), 32736 nodeVisitor((_a2 = node.questionToken) != null ? _a2 : node.exclamationToken, tokenVisitor, isQuestionOrExclamationToken), 32737 nodeVisitor(node.type, visitor, isTypeNode), 32738 nodeVisitor(node.initializer, visitor, isExpression) 32739 ); 32740 }, 32741 [172 /* AnnotationPropertyDeclaration */]: function visitEachChildOfAnnotationPropertyDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 32742 return context.factory.updateAnnotationPropertyDeclaration( 32743 node, 32744 nodeVisitor(node.name, visitor, isPropertyName), 32745 nodeVisitor(node.type, visitor, isTypeNode), 32746 nodeVisitor(node.initializer, visitor, isExpression) 32747 ); 32748 }, 32749 [173 /* MethodSignature */]: function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { 32750 return context.factory.updateMethodSignature( 32751 node, 32752 nodesVisitor(node.modifiers, visitor, isModifier), 32753 nodeVisitor(node.name, visitor, isPropertyName), 32754 nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), 32755 nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), 32756 nodesVisitor(node.parameters, visitor, isParameterDeclaration), 32757 nodeVisitor(node.type, visitor, isTypeNode) 32758 ); 32759 }, 32760 [174 /* MethodDeclaration */]: function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { 32761 return context.factory.updateMethodDeclaration( 32762 node, 32763 nodesVisitor(node.modifiers, visitor, isModifierLike), 32764 nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), 32765 nodeVisitor(node.name, visitor, isPropertyName), 32766 nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), 32767 nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), 32768 visitParameterList(node.parameters, visitor, context, nodesVisitor), 32769 nodeVisitor(node.type, visitor, isTypeNode), 32770 visitFunctionBody(node.body, visitor, context, nodeVisitor) 32771 ); 32772 }, 32773 [176 /* Constructor */]: function visitEachChildOfConstructorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 32774 return context.factory.updateConstructorDeclaration( 32775 node, 32776 nodesVisitor(node.modifiers, visitor, isModifier), 32777 visitParameterList(node.parameters, visitor, context, nodesVisitor), 32778 visitFunctionBody(node.body, visitor, context, nodeVisitor) 32779 ); 32780 }, 32781 [177 /* GetAccessor */]: function visitEachChildOfGetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 32782 if (context.isLexicalEnvironmentSuspended && context.isLexicalEnvironmentSuspended()) { 32783 return context.factory.updateGetAccessorDeclaration( 32784 node, 32785 nodesVisitor(node.modifiers, visitor, isModifierLike), 32786 nodeVisitor(node.name, visitor, isPropertyName), 32787 nodesVisitor(node.parameters, visitor, isParameterDeclaration), 32788 nodeVisitor(node.type, visitor, isTypeNode), 32789 nodeVisitor(node.body, visitor, isConciseBody) 32790 ); 32791 } else { 32792 return context.factory.updateGetAccessorDeclaration( 32793 node, 32794 nodesVisitor(node.modifiers, visitor, isModifierLike), 32795 nodeVisitor(node.name, visitor, isPropertyName), 32796 visitParameterList(node.parameters, visitor, context, nodesVisitor), 32797 nodeVisitor(node.type, visitor, isTypeNode), 32798 visitFunctionBody(node.body, visitor, context, nodeVisitor) 32799 ); 32800 } 32801 }, 32802 [178 /* SetAccessor */]: function visitEachChildOfSetAccessorDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 32803 if (context.isLexicalEnvironmentSuspended && context.isLexicalEnvironmentSuspended()) { 32804 return context.factory.updateSetAccessorDeclaration( 32805 node, 32806 nodesVisitor(node.modifiers, visitor, isModifierLike), 32807 nodeVisitor(node.name, visitor, isPropertyName), 32808 nodesVisitor(node.parameters, visitor, isParameterDeclaration), 32809 nodeVisitor(node.body, visitor, isConciseBody) 32810 ); 32811 } else { 32812 return context.factory.updateSetAccessorDeclaration( 32813 node, 32814 nodesVisitor(node.modifiers, visitor, isModifierLike), 32815 nodeVisitor(node.name, visitor, isPropertyName), 32816 visitParameterList(node.parameters, visitor, context, nodesVisitor), 32817 visitFunctionBody(node.body, visitor, context, nodeVisitor) 32818 ); 32819 } 32820 }, 32821 [175 /* ClassStaticBlockDeclaration */]: function visitEachChildOfClassStaticBlockDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 32822 context.startLexicalEnvironment(); 32823 context.suspendLexicalEnvironment(); 32824 return context.factory.updateClassStaticBlockDeclaration( 32825 node, 32826 visitFunctionBody(node.body, visitor, context, nodeVisitor) 32827 ); 32828 }, 32829 [179 /* CallSignature */]: function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 32830 return context.factory.updateCallSignature( 32831 node, 32832 nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), 32833 nodesVisitor(node.parameters, visitor, isParameterDeclaration), 32834 nodeVisitor(node.type, visitor, isTypeNode) 32835 ); 32836 }, 32837 [180 /* ConstructSignature */]: function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 32838 return context.factory.updateConstructSignature( 32839 node, 32840 nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), 32841 nodesVisitor(node.parameters, visitor, isParameterDeclaration), 32842 nodeVisitor(node.type, visitor, isTypeNode) 32843 ); 32844 }, 32845 [181 /* IndexSignature */]: function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 32846 return context.factory.updateIndexSignature( 32847 node, 32848 nodesVisitor(node.modifiers, visitor, isModifier), 32849 nodesVisitor(node.parameters, visitor, isParameterDeclaration), 32850 nodeVisitor(node.type, visitor, isTypeNode) 32851 ); 32852 }, 32853 [182 /* TypePredicate */]: function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 32854 return context.factory.updateTypePredicateNode( 32855 node, 32856 nodeVisitor(node.assertsModifier, visitor, isAssertsKeyword), 32857 nodeVisitor(node.parameterName, visitor, isIdentifierOrThisTypeNode), 32858 nodeVisitor(node.type, visitor, isTypeNode) 32859 ); 32860 }, 32861 [183 /* TypeReference */]: function visitEachChildOfTypeReferenceNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 32862 return context.factory.updateTypeReferenceNode( 32863 node, 32864 nodeVisitor(node.typeName, visitor, isEntityName), 32865 nodesVisitor(node.typeArguments, visitor, isTypeNode) 32866 ); 32867 }, 32868 [184 /* FunctionType */]: function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 32869 return context.factory.updateFunctionTypeNode( 32870 node, 32871 nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), 32872 nodesVisitor(node.parameters, visitor, isParameterDeclaration), 32873 nodeVisitor(node.type, visitor, isTypeNode) 32874 ); 32875 }, 32876 [185 /* ConstructorType */]: function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 32877 return context.factory.updateConstructorTypeNode( 32878 node, 32879 nodesVisitor(node.modifiers, visitor, isModifier), 32880 nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), 32881 nodesVisitor(node.parameters, visitor, isParameterDeclaration), 32882 nodeVisitor(node.type, visitor, isTypeNode) 32883 ); 32884 }, 32885 [186 /* TypeQuery */]: function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 32886 return context.factory.updateTypeQueryNode( 32887 node, 32888 nodeVisitor(node.exprName, visitor, isEntityName), 32889 nodesVisitor(node.typeArguments, visitor, isTypeNode) 32890 ); 32891 }, 32892 [187 /* TypeLiteral */]: function visitEachChildOfTypeLiteralNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 32893 return context.factory.updateTypeLiteralNode( 32894 node, 32895 nodesVisitor(node.members, visitor, isTypeElement) 32896 ); 32897 }, 32898 [188 /* ArrayType */]: function visitEachChildOfArrayTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 32899 return context.factory.updateArrayTypeNode( 32900 node, 32901 nodeVisitor(node.elementType, visitor, isTypeNode) 32902 ); 32903 }, 32904 [189 /* TupleType */]: function visitEachChildOfTupleTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 32905 return context.factory.updateTupleTypeNode( 32906 node, 32907 nodesVisitor(node.elements, visitor, isTypeNode) 32908 ); 32909 }, 32910 [190 /* OptionalType */]: function visitEachChildOfOptionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 32911 return context.factory.updateOptionalTypeNode( 32912 node, 32913 nodeVisitor(node.type, visitor, isTypeNode) 32914 ); 32915 }, 32916 [191 /* RestType */]: function visitEachChildOfRestTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 32917 return context.factory.updateRestTypeNode( 32918 node, 32919 nodeVisitor(node.type, visitor, isTypeNode) 32920 ); 32921 }, 32922 [192 /* UnionType */]: function visitEachChildOfUnionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 32923 return context.factory.updateUnionTypeNode( 32924 node, 32925 nodesVisitor(node.types, visitor, isTypeNode) 32926 ); 32927 }, 32928 [193 /* IntersectionType */]: function visitEachChildOfIntersectionTypeNode(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 32929 return context.factory.updateIntersectionTypeNode( 32930 node, 32931 nodesVisitor(node.types, visitor, isTypeNode) 32932 ); 32933 }, 32934 [194 /* ConditionalType */]: function visitEachChildOfConditionalTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 32935 return context.factory.updateConditionalTypeNode( 32936 node, 32937 nodeVisitor(node.checkType, visitor, isTypeNode), 32938 nodeVisitor(node.extendsType, visitor, isTypeNode), 32939 nodeVisitor(node.trueType, visitor, isTypeNode), 32940 nodeVisitor(node.falseType, visitor, isTypeNode) 32941 ); 32942 }, 32943 [195 /* InferType */]: function visitEachChildOfInferTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 32944 return context.factory.updateInferTypeNode( 32945 node, 32946 nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration) 32947 ); 32948 }, 32949 [205 /* ImportType */]: function visitEachChildOfImportTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 32950 return context.factory.updateImportTypeNode( 32951 node, 32952 nodeVisitor(node.argument, visitor, isTypeNode), 32953 nodeVisitor(node.assertions, visitor, isImportTypeAssertionContainer), 32954 nodeVisitor(node.qualifier, visitor, isEntityName), 32955 nodesVisitor(node.typeArguments, visitor, isTypeNode), 32956 node.isTypeOf 32957 ); 32958 }, 32959 [304 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 32960 return context.factory.updateImportTypeAssertionContainer( 32961 node, 32962 nodeVisitor(node.assertClause, visitor, isAssertClause), 32963 node.multiLine 32964 ); 32965 }, 32966 [202 /* NamedTupleMember */]: function visitEachChildOfNamedTupleMember(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { 32967 return context.factory.updateNamedTupleMember( 32968 node, 32969 nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), 32970 nodeVisitor(node.name, visitor, isIdentifier), 32971 nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), 32972 nodeVisitor(node.type, visitor, isTypeNode) 32973 ); 32974 }, 32975 [196 /* ParenthesizedType */]: function visitEachChildOfParenthesizedType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 32976 return context.factory.updateParenthesizedType( 32977 node, 32978 nodeVisitor(node.type, visitor, isTypeNode) 32979 ); 32980 }, 32981 [198 /* TypeOperator */]: function visitEachChildOfTypeOperatorNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 32982 return context.factory.updateTypeOperatorNode( 32983 node, 32984 nodeVisitor(node.type, visitor, isTypeNode) 32985 ); 32986 }, 32987 [199 /* IndexedAccessType */]: function visitEachChildOfIndexedAccessType(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 32988 return context.factory.updateIndexedAccessTypeNode( 32989 node, 32990 nodeVisitor(node.objectType, visitor, isTypeNode), 32991 nodeVisitor(node.indexType, visitor, isTypeNode) 32992 ); 32993 }, 32994 [200 /* MappedType */]: function visitEachChildOfMappedType(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { 32995 return context.factory.updateMappedTypeNode( 32996 node, 32997 nodeVisitor(node.readonlyToken, tokenVisitor, isReadonlyKeywordOrPlusOrMinusToken), 32998 nodeVisitor(node.typeParameter, visitor, isTypeParameterDeclaration), 32999 nodeVisitor(node.nameType, visitor, isTypeNode), 33000 nodeVisitor(node.questionToken, tokenVisitor, isQuestionOrPlusOrMinusToken), 33001 nodeVisitor(node.type, visitor, isTypeNode), 33002 nodesVisitor(node.members, visitor, isTypeElement) 33003 ); 33004 }, 33005 [201 /* LiteralType */]: function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33006 return context.factory.updateLiteralTypeNode( 33007 node, 33008 nodeVisitor(node.literal, visitor, isExpression) 33009 ); 33010 }, 33011 [203 /* TemplateLiteralType */]: function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33012 return context.factory.updateTemplateLiteralType( 33013 node, 33014 nodeVisitor(node.head, visitor, isTemplateHead), 33015 nodesVisitor(node.templateSpans, visitor, isTemplateLiteralTypeSpan) 33016 ); 33017 }, 33018 [204 /* TemplateLiteralTypeSpan */]: function visitEachChildOfTemplateLiteralTypeSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33019 return context.factory.updateTemplateLiteralTypeSpan( 33020 node, 33021 nodeVisitor(node.type, visitor, isTypeNode), 33022 nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail) 33023 ); 33024 }, 33025 [206 /* ObjectBindingPattern */]: function visitEachChildOfObjectBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 33026 return context.factory.updateObjectBindingPattern( 33027 node, 33028 nodesVisitor(node.elements, visitor, isBindingElement) 33029 ); 33030 }, 33031 [207 /* ArrayBindingPattern */]: function visitEachChildOfArrayBindingPattern(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 33032 return context.factory.updateArrayBindingPattern( 33033 node, 33034 nodesVisitor(node.elements, visitor, isArrayBindingElement) 33035 ); 33036 }, 33037 [208 /* BindingElement */]: function visitEachChildOfBindingElement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { 33038 return context.factory.updateBindingElement( 33039 node, 33040 nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken), 33041 nodeVisitor(node.propertyName, visitor, isPropertyName), 33042 nodeVisitor(node.name, visitor, isBindingName), 33043 nodeVisitor(node.initializer, visitor, isExpression) 33044 ); 33045 }, 33046 [209 /* ArrayLiteralExpression */]: function visitEachChildOfArrayLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 33047 return context.factory.updateArrayLiteralExpression( 33048 node, 33049 nodesVisitor(node.elements, visitor, isExpression) 33050 ); 33051 }, 33052 [210 /* ObjectLiteralExpression */]: function visitEachChildOfObjectLiteralExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 33053 return context.factory.updateObjectLiteralExpression( 33054 node, 33055 nodesVisitor(node.properties, visitor, isObjectLiteralElementLike) 33056 ); 33057 }, 33058 [211 /* PropertyAccessExpression */]: function visitEachChildOfPropertyAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { 33059 return isPropertyAccessChain(node) ? context.factory.updatePropertyAccessChain( 33060 node, 33061 nodeVisitor(node.expression, visitor, isExpression), 33062 nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), 33063 nodeVisitor(node.name, visitor, isMemberName) 33064 ) : context.factory.updatePropertyAccessExpression( 33065 node, 33066 nodeVisitor(node.expression, visitor, isExpression), 33067 nodeVisitor(node.name, visitor, isMemberName) 33068 ); 33069 }, 33070 [212 /* ElementAccessExpression */]: function visitEachChildOfElementAccessExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { 33071 return isElementAccessChain(node) ? context.factory.updateElementAccessChain( 33072 node, 33073 nodeVisitor(node.expression, visitor, isExpression), 33074 nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), 33075 nodeVisitor(node.argumentExpression, visitor, isExpression) 33076 ) : context.factory.updateElementAccessExpression( 33077 node, 33078 nodeVisitor(node.expression, visitor, isExpression), 33079 nodeVisitor(node.argumentExpression, visitor, isExpression) 33080 ); 33081 }, 33082 [213 /* CallExpression */]: function visitEachChildOfCallExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { 33083 return isCallChain(node) ? context.factory.updateCallChain( 33084 node, 33085 nodeVisitor(node.expression, visitor, isExpression), 33086 nodeVisitor(node.questionDotToken, tokenVisitor, isQuestionDotToken), 33087 nodesVisitor(node.typeArguments, visitor, isTypeNode), 33088 nodesVisitor(node.arguments, visitor, isExpression) 33089 ) : context.factory.updateCallExpression( 33090 node, 33091 nodeVisitor(node.expression, visitor, isExpression), 33092 nodesVisitor(node.typeArguments, visitor, isTypeNode), 33093 nodesVisitor(node.arguments, visitor, isExpression) 33094 ); 33095 }, 33096 [220 /* EtsComponentExpression */]: function visitEachChildOfEtsComponentExpression(node, visitor, context, nodesVisitor, nodeVisitor) { 33097 return context.factory.updateEtsComponentExpression( 33098 node, 33099 nodeVisitor(node.expression, visitor, isExpression), 33100 nodesVisitor(node.arguments, visitor, isExpression), 33101 nodeVisitor(node.body, visitor, isBlock) 33102 ); 33103 }, 33104 [214 /* NewExpression */]: function visitEachChildOfNewExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33105 return context.factory.updateNewExpression( 33106 node, 33107 nodeVisitor(node.expression, visitor, isExpression), 33108 nodesVisitor(node.typeArguments, visitor, isTypeNode), 33109 nodesVisitor(node.arguments, visitor, isExpression) 33110 ); 33111 }, 33112 [215 /* TaggedTemplateExpression */]: function visitEachChildOfTaggedTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33113 return context.factory.updateTaggedTemplateExpression( 33114 node, 33115 nodeVisitor(node.tag, visitor, isExpression), 33116 nodesVisitor(node.typeArguments, visitor, isTypeNode), 33117 nodeVisitor(node.template, visitor, isTemplateLiteral) 33118 ); 33119 }, 33120 [216 /* TypeAssertionExpression */]: function visitEachChildOfTypeAssertionExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33121 return context.factory.updateTypeAssertion( 33122 node, 33123 nodeVisitor(node.type, visitor, isTypeNode), 33124 nodeVisitor(node.expression, visitor, isExpression) 33125 ); 33126 }, 33127 [217 /* ParenthesizedExpression */]: function visitEachChildOfParenthesizedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33128 return context.factory.updateParenthesizedExpression( 33129 node, 33130 nodeVisitor(node.expression, visitor, isExpression) 33131 ); 33132 }, 33133 [218 /* FunctionExpression */]: function visitEachChildOfFunctionExpression(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { 33134 return context.factory.updateFunctionExpression( 33135 node, 33136 nodesVisitor(node.modifiers, visitor, isModifier), 33137 nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), 33138 nodeVisitor(node.name, visitor, isIdentifier), 33139 nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), 33140 visitParameterList(node.parameters, visitor, context, nodesVisitor), 33141 nodeVisitor(node.type, visitor, isTypeNode), 33142 visitFunctionBody(node.body, visitor, context, nodeVisitor) 33143 ); 33144 }, 33145 [219 /* ArrowFunction */]: function visitEachChildOfArrowFunction(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { 33146 return context.factory.updateArrowFunction( 33147 node, 33148 nodesVisitor(node.modifiers, visitor, isModifier), 33149 nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), 33150 visitParameterList(node.parameters, visitor, context, nodesVisitor), 33151 nodeVisitor(node.type, visitor, isTypeNode), 33152 nodeVisitor(node.equalsGreaterThanToken, tokenVisitor, isEqualsGreaterThanToken), 33153 visitFunctionBody(node.body, visitor, context, nodeVisitor) 33154 ); 33155 }, 33156 [221 /* DeleteExpression */]: function visitEachChildOfDeleteExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33157 return context.factory.updateDeleteExpression( 33158 node, 33159 nodeVisitor(node.expression, visitor, isExpression) 33160 ); 33161 }, 33162 [222 /* TypeOfExpression */]: function visitEachChildOfTypeOfExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33163 return context.factory.updateTypeOfExpression( 33164 node, 33165 nodeVisitor(node.expression, visitor, isExpression) 33166 ); 33167 }, 33168 [223 /* VoidExpression */]: function visitEachChildOfVoidExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33169 return context.factory.updateVoidExpression( 33170 node, 33171 nodeVisitor(node.expression, visitor, isExpression) 33172 ); 33173 }, 33174 [224 /* AwaitExpression */]: function visitEachChildOfAwaitExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33175 return context.factory.updateAwaitExpression( 33176 node, 33177 nodeVisitor(node.expression, visitor, isExpression) 33178 ); 33179 }, 33180 [225 /* PrefixUnaryExpression */]: function visitEachChildOfPrefixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33181 return context.factory.updatePrefixUnaryExpression( 33182 node, 33183 nodeVisitor(node.operand, visitor, isExpression) 33184 ); 33185 }, 33186 [226 /* PostfixUnaryExpression */]: function visitEachChildOfPostfixUnaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33187 return context.factory.updatePostfixUnaryExpression( 33188 node, 33189 nodeVisitor(node.operand, visitor, isExpression) 33190 ); 33191 }, 33192 [227 /* BinaryExpression */]: function visitEachChildOfBinaryExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { 33193 return context.factory.updateBinaryExpression( 33194 node, 33195 nodeVisitor(node.left, visitor, isExpression), 33196 nodeVisitor(node.operatorToken, tokenVisitor, isBinaryOperatorToken), 33197 nodeVisitor(node.right, visitor, isExpression) 33198 ); 33199 }, 33200 [228 /* ConditionalExpression */]: function visitEachChildOfConditionalExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { 33201 return context.factory.updateConditionalExpression( 33202 node, 33203 nodeVisitor(node.condition, visitor, isExpression), 33204 nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken), 33205 nodeVisitor(node.whenTrue, visitor, isExpression), 33206 nodeVisitor(node.colonToken, tokenVisitor, isColonToken), 33207 nodeVisitor(node.whenFalse, visitor, isExpression) 33208 ); 33209 }, 33210 [229 /* TemplateExpression */]: function visitEachChildOfTemplateExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33211 return context.factory.updateTemplateExpression( 33212 node, 33213 nodeVisitor(node.head, visitor, isTemplateHead), 33214 nodesVisitor(node.templateSpans, visitor, isTemplateSpan) 33215 ); 33216 }, 33217 [230 /* YieldExpression */]: function visitEachChildOfYieldExpression(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { 33218 return context.factory.updateYieldExpression( 33219 node, 33220 nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), 33221 nodeVisitor(node.expression, visitor, isExpression) 33222 ); 33223 }, 33224 [231 /* SpreadElement */]: function visitEachChildOfSpreadElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33225 return context.factory.updateSpreadElement( 33226 node, 33227 nodeVisitor(node.expression, visitor, isExpression) 33228 ); 33229 }, 33230 [232 /* ClassExpression */]: function visitEachChildOfClassExpression(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33231 return context.factory.updateClassExpression( 33232 node, 33233 nodesVisitor(node.modifiers, visitor, isModifierLike), 33234 nodeVisitor(node.name, visitor, isIdentifier), 33235 nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), 33236 nodesVisitor(node.heritageClauses, visitor, isHeritageClause), 33237 nodesVisitor(node.members, visitor, isClassElement) 33238 ); 33239 }, 33240 [234 /* ExpressionWithTypeArguments */]: function visitEachChildOfExpressionWithTypeArguments(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33241 return context.factory.updateExpressionWithTypeArguments( 33242 node, 33243 nodeVisitor(node.expression, visitor, isExpression), 33244 nodesVisitor(node.typeArguments, visitor, isTypeNode) 33245 ); 33246 }, 33247 [235 /* AsExpression */]: function visitEachChildOfAsExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33248 return context.factory.updateAsExpression( 33249 node, 33250 nodeVisitor(node.expression, visitor, isExpression), 33251 nodeVisitor(node.type, visitor, isTypeNode) 33252 ); 33253 }, 33254 [239 /* SatisfiesExpression */]: function visitEachChildOfSatisfiesExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33255 return context.factory.updateSatisfiesExpression( 33256 node, 33257 nodeVisitor(node.expression, visitor, isExpression), 33258 nodeVisitor(node.type, visitor, isTypeNode) 33259 ); 33260 }, 33261 [236 /* NonNullExpression */]: function visitEachChildOfNonNullExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33262 return isOptionalChain(node) ? context.factory.updateNonNullChain( 33263 node, 33264 nodeVisitor(node.expression, visitor, isExpression) 33265 ) : context.factory.updateNonNullExpression( 33266 node, 33267 nodeVisitor(node.expression, visitor, isExpression) 33268 ); 33269 }, 33270 [237 /* MetaProperty */]: function visitEachChildOfMetaProperty(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33271 return context.factory.updateMetaProperty( 33272 node, 33273 nodeVisitor(node.name, visitor, isIdentifier) 33274 ); 33275 }, 33276 [240 /* TemplateSpan */]: function visitEachChildOfTemplateSpan(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33277 return context.factory.updateTemplateSpan( 33278 node, 33279 nodeVisitor(node.expression, visitor, isExpression), 33280 nodeVisitor(node.literal, visitor, isTemplateMiddleOrTemplateTail) 33281 ); 33282 }, 33283 [242 /* Block */]: function visitEachChildOfBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 33284 return context.factory.updateBlock( 33285 node, 33286 nodesVisitor(node.statements, visitor, isStatement) 33287 ); 33288 }, 33289 [244 /* VariableStatement */]: function visitEachChildOfVariableStatement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33290 return context.factory.updateVariableStatement( 33291 node, 33292 nodesVisitor(node.modifiers, visitor, isModifier), 33293 nodeVisitor(node.declarationList, visitor, isVariableDeclarationList) 33294 ); 33295 }, 33296 [245 /* ExpressionStatement */]: function visitEachChildOfExpressionStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33297 return context.factory.updateExpressionStatement( 33298 node, 33299 nodeVisitor(node.expression, visitor, isExpression) 33300 ); 33301 }, 33302 [246 /* IfStatement */]: function visitEachChildOfIfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33303 return context.factory.updateIfStatement( 33304 node, 33305 nodeVisitor(node.expression, visitor, isExpression), 33306 nodeVisitor(node.thenStatement, visitor, isStatement, context.factory.liftToBlock), 33307 nodeVisitor(node.elseStatement, visitor, isStatement, context.factory.liftToBlock) 33308 ); 33309 }, 33310 [247 /* DoStatement */]: function visitEachChildOfDoStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33311 return context.factory.updateDoStatement( 33312 node, 33313 visitIterationBody(node.statement, visitor, context, nodeVisitor), 33314 nodeVisitor(node.expression, visitor, isExpression) 33315 ); 33316 }, 33317 [248 /* WhileStatement */]: function visitEachChildOfWhileStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33318 return context.factory.updateWhileStatement( 33319 node, 33320 nodeVisitor(node.expression, visitor, isExpression), 33321 visitIterationBody(node.statement, visitor, context, nodeVisitor) 33322 ); 33323 }, 33324 [249 /* ForStatement */]: function visitEachChildOfForStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33325 return context.factory.updateForStatement( 33326 node, 33327 nodeVisitor(node.initializer, visitor, isForInitializer), 33328 nodeVisitor(node.condition, visitor, isExpression), 33329 nodeVisitor(node.incrementor, visitor, isExpression), 33330 visitIterationBody(node.statement, visitor, context, nodeVisitor) 33331 ); 33332 }, 33333 [250 /* ForInStatement */]: function visitEachChildOfForInStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33334 return context.factory.updateForInStatement( 33335 node, 33336 nodeVisitor(node.initializer, visitor, isForInitializer), 33337 nodeVisitor(node.expression, visitor, isExpression), 33338 visitIterationBody(node.statement, visitor, context, nodeVisitor) 33339 ); 33340 }, 33341 [251 /* ForOfStatement */]: function visitEachChildOfForOfStatement(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { 33342 return context.factory.updateForOfStatement( 33343 node, 33344 nodeVisitor(node.awaitModifier, tokenVisitor, isAwaitKeyword), 33345 nodeVisitor(node.initializer, visitor, isForInitializer), 33346 nodeVisitor(node.expression, visitor, isExpression), 33347 visitIterationBody(node.statement, visitor, context, nodeVisitor) 33348 ); 33349 }, 33350 [252 /* ContinueStatement */]: function visitEachChildOfContinueStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33351 return context.factory.updateContinueStatement( 33352 node, 33353 nodeVisitor(node.label, visitor, isIdentifier) 33354 ); 33355 }, 33356 [253 /* BreakStatement */]: function visitEachChildOfBreakStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33357 return context.factory.updateBreakStatement( 33358 node, 33359 nodeVisitor(node.label, visitor, isIdentifier) 33360 ); 33361 }, 33362 [254 /* ReturnStatement */]: function visitEachChildOfReturnStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33363 return context.factory.updateReturnStatement( 33364 node, 33365 nodeVisitor(node.expression, visitor, isExpression) 33366 ); 33367 }, 33368 [255 /* WithStatement */]: function visitEachChildOfWithStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33369 return context.factory.updateWithStatement( 33370 node, 33371 nodeVisitor(node.expression, visitor, isExpression), 33372 nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock) 33373 ); 33374 }, 33375 [256 /* SwitchStatement */]: function visitEachChildOfSwitchStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33376 return context.factory.updateSwitchStatement( 33377 node, 33378 nodeVisitor(node.expression, visitor, isExpression), 33379 nodeVisitor(node.caseBlock, visitor, isCaseBlock) 33380 ); 33381 }, 33382 [257 /* LabeledStatement */]: function visitEachChildOfLabeledStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33383 return context.factory.updateLabeledStatement( 33384 node, 33385 nodeVisitor(node.label, visitor, isIdentifier), 33386 nodeVisitor(node.statement, visitor, isStatement, context.factory.liftToBlock) 33387 ); 33388 }, 33389 [258 /* ThrowStatement */]: function visitEachChildOfThrowStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33390 return context.factory.updateThrowStatement( 33391 node, 33392 nodeVisitor(node.expression, visitor, isExpression) 33393 ); 33394 }, 33395 [259 /* TryStatement */]: function visitEachChildOfTryStatement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33396 return context.factory.updateTryStatement( 33397 node, 33398 nodeVisitor(node.tryBlock, visitor, isBlock), 33399 nodeVisitor(node.catchClause, visitor, isCatchClause), 33400 nodeVisitor(node.finallyBlock, visitor, isBlock) 33401 ); 33402 }, 33403 [261 /* VariableDeclaration */]: function visitEachChildOfVariableDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, tokenVisitor) { 33404 return context.factory.updateVariableDeclaration( 33405 node, 33406 nodeVisitor(node.name, visitor, isBindingName), 33407 nodeVisitor(node.exclamationToken, tokenVisitor, isExclamationToken), 33408 nodeVisitor(node.type, visitor, isTypeNode), 33409 nodeVisitor(node.initializer, visitor, isExpression) 33410 ); 33411 }, 33412 [262 /* VariableDeclarationList */]: function visitEachChildOfVariableDeclarationList(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 33413 return context.factory.updateVariableDeclarationList( 33414 node, 33415 nodesVisitor(node.declarations, visitor, isVariableDeclaration) 33416 ); 33417 }, 33418 [263 /* FunctionDeclaration */]: function visitEachChildOfFunctionDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) { 33419 return context.factory.updateFunctionDeclaration( 33420 node, 33421 nodesVisitor(node.modifiers, visitor, isModifier), 33422 nodeVisitor(node.asteriskToken, tokenVisitor, isAsteriskToken), 33423 nodeVisitor(node.name, visitor, isIdentifier), 33424 nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), 33425 visitParameterList(node.parameters, visitor, context, nodesVisitor), 33426 nodeVisitor(node.type, visitor, isTypeNode), 33427 visitFunctionBody(node.body, visitor, context, nodeVisitor) 33428 ); 33429 }, 33430 [264 /* ClassDeclaration */]: function visitEachChildOfClassDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33431 return context.factory.updateClassDeclaration( 33432 node, 33433 nodesVisitor(node.modifiers, visitor, isModifierLike), 33434 nodeVisitor(node.name, visitor, isIdentifier), 33435 nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), 33436 nodesVisitor(node.heritageClauses, visitor, isHeritageClause), 33437 nodesVisitor(node.members, visitor, isClassElement) 33438 ); 33439 }, 33440 [265 /* StructDeclaration */]: function visitEachChildOfStructDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33441 return context.factory.updateStructDeclaration( 33442 node, 33443 nodesVisitor(node.modifiers, visitor, isModifier), 33444 nodeVisitor(node.name, visitor, isIdentifier), 33445 nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), 33446 nodesVisitor(node.heritageClauses, visitor, isHeritageClause), 33447 nodesVisitor(node.members, visitor, isClassElement) 33448 ); 33449 }, 33450 [266 /* AnnotationDeclaration */]: function visitEachChildOfAnnotationDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33451 return context.factory.updateAnnotationDeclaration( 33452 node, 33453 nodesVisitor(node.modifiers, visitor, isModifier), 33454 nodeVisitor(node.name, visitor, isIdentifier), 33455 nodesVisitor(node.members, visitor, isAnnotationElement) 33456 ); 33457 }, 33458 [267 /* InterfaceDeclaration */]: function visitEachChildOfInterfaceDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33459 return context.factory.updateInterfaceDeclaration( 33460 node, 33461 nodesVisitor(node.modifiers, visitor, isModifier), 33462 nodeVisitor(node.name, visitor, isIdentifier), 33463 nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), 33464 nodesVisitor(node.heritageClauses, visitor, isHeritageClause), 33465 nodesVisitor(node.members, visitor, isTypeElement) 33466 ); 33467 }, 33468 [268 /* TypeAliasDeclaration */]: function visitEachChildOfTypeAliasDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33469 return context.factory.updateTypeAliasDeclaration( 33470 node, 33471 nodesVisitor(node.modifiers, visitor, isModifier), 33472 nodeVisitor(node.name, visitor, isIdentifier), 33473 nodesVisitor(node.typeParameters, visitor, isTypeParameterDeclaration), 33474 nodeVisitor(node.type, visitor, isTypeNode) 33475 ); 33476 }, 33477 [269 /* EnumDeclaration */]: function visitEachChildOfEnumDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33478 return context.factory.updateEnumDeclaration( 33479 node, 33480 nodesVisitor(node.modifiers, visitor, isModifier), 33481 nodeVisitor(node.name, visitor, isIdentifier), 33482 nodesVisitor(node.members, visitor, isEnumMember) 33483 ); 33484 }, 33485 [270 /* ModuleDeclaration */]: function visitEachChildOfModuleDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33486 return context.factory.updateModuleDeclaration( 33487 node, 33488 nodesVisitor(node.modifiers, visitor, isModifier), 33489 nodeVisitor(node.name, visitor, isModuleName), 33490 nodeVisitor(node.body, visitor, isModuleBody) 33491 ); 33492 }, 33493 [271 /* ModuleBlock */]: function visitEachChildOfModuleBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 33494 return context.factory.updateModuleBlock( 33495 node, 33496 nodesVisitor(node.statements, visitor, isStatement) 33497 ); 33498 }, 33499 [272 /* CaseBlock */]: function visitEachChildOfCaseBlock(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 33500 return context.factory.updateCaseBlock( 33501 node, 33502 nodesVisitor(node.clauses, visitor, isCaseOrDefaultClause) 33503 ); 33504 }, 33505 [273 /* NamespaceExportDeclaration */]: function visitEachChildOfNamespaceExportDeclaration(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33506 return context.factory.updateNamespaceExportDeclaration( 33507 node, 33508 nodeVisitor(node.name, visitor, isIdentifier) 33509 ); 33510 }, 33511 [274 /* ImportEqualsDeclaration */]: function visitEachChildOfImportEqualsDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33512 return context.factory.updateImportEqualsDeclaration( 33513 node, 33514 nodesVisitor(node.modifiers, visitor, isModifier), 33515 node.isTypeOnly, 33516 nodeVisitor(node.name, visitor, isIdentifier), 33517 nodeVisitor(node.moduleReference, visitor, isModuleReference) 33518 ); 33519 }, 33520 [275 /* ImportDeclaration */]: function visitEachChildOfImportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33521 return context.factory.updateImportDeclaration( 33522 node, 33523 nodesVisitor(node.modifiers, visitor, isModifier), 33524 nodeVisitor(node.importClause, visitor, isImportClause), 33525 nodeVisitor(node.moduleSpecifier, visitor, isExpression), 33526 nodeVisitor(node.assertClause, visitor, isAssertClause) 33527 ); 33528 }, 33529 [302 /* AssertClause */]: function visitEachChildOfAssertClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 33530 return context.factory.updateAssertClause( 33531 node, 33532 nodesVisitor(node.elements, visitor, isAssertEntry), 33533 node.multiLine 33534 ); 33535 }, 33536 [303 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33537 return context.factory.updateAssertEntry( 33538 node, 33539 nodeVisitor(node.name, visitor, isAssertionKey), 33540 nodeVisitor(node.value, visitor, isExpression) 33541 ); 33542 }, 33543 [276 /* ImportClause */]: function visitEachChildOfImportClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33544 return context.factory.updateImportClause( 33545 node, 33546 node.isTypeOnly, 33547 nodeVisitor(node.name, visitor, isIdentifier), 33548 nodeVisitor(node.namedBindings, visitor, isNamedImportBindings) 33549 ); 33550 }, 33551 [277 /* NamespaceImport */]: function visitEachChildOfNamespaceImport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33552 return context.factory.updateNamespaceImport( 33553 node, 33554 nodeVisitor(node.name, visitor, isIdentifier) 33555 ); 33556 }, 33557 [283 /* NamespaceExport */]: function visitEachChildOfNamespaceExport(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33558 return context.factory.updateNamespaceExport( 33559 node, 33560 nodeVisitor(node.name, visitor, isIdentifier) 33561 ); 33562 }, 33563 [278 /* NamedImports */]: function visitEachChildOfNamedImports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 33564 return context.factory.updateNamedImports( 33565 node, 33566 nodesVisitor(node.elements, visitor, isImportSpecifier) 33567 ); 33568 }, 33569 [279 /* ImportSpecifier */]: function visitEachChildOfImportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33570 return context.factory.updateImportSpecifier( 33571 node, 33572 node.isTypeOnly, 33573 nodeVisitor(node.propertyName, visitor, isIdentifier), 33574 nodeVisitor(node.name, visitor, isIdentifier) 33575 ); 33576 }, 33577 [280 /* ExportAssignment */]: function visitEachChildOfExportAssignment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33578 return context.factory.updateExportAssignment( 33579 node, 33580 nodesVisitor(node.modifiers, visitor, isModifier), 33581 nodeVisitor(node.expression, visitor, isExpression) 33582 ); 33583 }, 33584 [281 /* ExportDeclaration */]: function visitEachChildOfExportDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33585 return context.factory.updateExportDeclaration( 33586 node, 33587 nodesVisitor(node.modifiers, visitor, isModifier), 33588 node.isTypeOnly, 33589 nodeVisitor(node.exportClause, visitor, isNamedExportBindings), 33590 nodeVisitor(node.moduleSpecifier, visitor, isExpression), 33591 nodeVisitor(node.assertClause, visitor, isAssertClause) 33592 ); 33593 }, 33594 [282 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 33595 return context.factory.updateNamedExports( 33596 node, 33597 nodesVisitor(node.elements, visitor, isExportSpecifier) 33598 ); 33599 }, 33600 [284 /* ExportSpecifier */]: function visitEachChildOfExportSpecifier(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33601 return context.factory.updateExportSpecifier( 33602 node, 33603 node.isTypeOnly, 33604 nodeVisitor(node.propertyName, visitor, isIdentifier), 33605 nodeVisitor(node.name, visitor, isIdentifier) 33606 ); 33607 }, 33608 [286 /* ExternalModuleReference */]: function visitEachChildOfExternalModuleReference(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33609 return context.factory.updateExternalModuleReference( 33610 node, 33611 nodeVisitor(node.expression, visitor, isExpression) 33612 ); 33613 }, 33614 [287 /* JsxElement */]: function visitEachChildOfJsxElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33615 return context.factory.updateJsxElement( 33616 node, 33617 nodeVisitor(node.openingElement, visitor, isJsxOpeningElement), 33618 nodesVisitor(node.children, visitor, isJsxChild), 33619 nodeVisitor(node.closingElement, visitor, isJsxClosingElement) 33620 ); 33621 }, 33622 [288 /* JsxSelfClosingElement */]: function visitEachChildOfJsxSelfClosingElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33623 return context.factory.updateJsxSelfClosingElement( 33624 node, 33625 nodeVisitor(node.tagName, visitor, isJsxTagNameExpression), 33626 nodesVisitor(node.typeArguments, visitor, isTypeNode), 33627 nodeVisitor(node.attributes, visitor, isJsxAttributes) 33628 ); 33629 }, 33630 [289 /* JsxOpeningElement */]: function visitEachChildOfJsxOpeningElement(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33631 return context.factory.updateJsxOpeningElement( 33632 node, 33633 nodeVisitor(node.tagName, visitor, isJsxTagNameExpression), 33634 nodesVisitor(node.typeArguments, visitor, isTypeNode), 33635 nodeVisitor(node.attributes, visitor, isJsxAttributes) 33636 ); 33637 }, 33638 [290 /* JsxClosingElement */]: function visitEachChildOfJsxClosingElement(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33639 return context.factory.updateJsxClosingElement( 33640 node, 33641 nodeVisitor(node.tagName, visitor, isJsxTagNameExpression) 33642 ); 33643 }, 33644 [291 /* JsxFragment */]: function visitEachChildOfJsxFragment(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33645 return context.factory.updateJsxFragment( 33646 node, 33647 nodeVisitor(node.openingFragment, visitor, isJsxOpeningFragment), 33648 nodesVisitor(node.children, visitor, isJsxChild), 33649 nodeVisitor(node.closingFragment, visitor, isJsxClosingFragment) 33650 ); 33651 }, 33652 [294 /* JsxAttribute */]: function visitEachChildOfJsxAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33653 return context.factory.updateJsxAttribute( 33654 node, 33655 nodeVisitor(node.name, visitor, isIdentifier), 33656 nodeVisitor(node.initializer, visitor, isStringLiteralOrJsxExpression) 33657 ); 33658 }, 33659 [295 /* JsxAttributes */]: function visitEachChildOfJsxAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 33660 return context.factory.updateJsxAttributes( 33661 node, 33662 nodesVisitor(node.properties, visitor, isJsxAttributeLike) 33663 ); 33664 }, 33665 [296 /* JsxSpreadAttribute */]: function visitEachChildOfJsxSpreadAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33666 return context.factory.updateJsxSpreadAttribute( 33667 node, 33668 nodeVisitor(node.expression, visitor, isExpression) 33669 ); 33670 }, 33671 [297 /* JsxExpression */]: function visitEachChildOfJsxExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33672 return context.factory.updateJsxExpression( 33673 node, 33674 nodeVisitor(node.expression, visitor, isExpression) 33675 ); 33676 }, 33677 [298 /* CaseClause */]: function visitEachChildOfCaseClause(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) { 33678 return context.factory.updateCaseClause( 33679 node, 33680 nodeVisitor(node.expression, visitor, isExpression), 33681 nodesVisitor(node.statements, visitor, isStatement) 33682 ); 33683 }, 33684 [299 /* DefaultClause */]: function visitEachChildOfDefaultClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 33685 return context.factory.updateDefaultClause( 33686 node, 33687 nodesVisitor(node.statements, visitor, isStatement) 33688 ); 33689 }, 33690 [300 /* HeritageClause */]: function visitEachChildOfHeritageClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 33691 return context.factory.updateHeritageClause( 33692 node, 33693 nodesVisitor(node.types, visitor, isExpressionWithTypeArguments) 33694 ); 33695 }, 33696 [301 /* CatchClause */]: function visitEachChildOfCatchClause(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33697 return context.factory.updateCatchClause( 33698 node, 33699 nodeVisitor(node.variableDeclaration, visitor, isVariableDeclaration), 33700 nodeVisitor(node.block, visitor, isBlock) 33701 ); 33702 }, 33703 [305 /* PropertyAssignment */]: function visitEachChildOfPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33704 return context.factory.updatePropertyAssignment( 33705 node, 33706 nodeVisitor(node.name, visitor, isPropertyName), 33707 nodeVisitor(node.initializer, visitor, isExpression) 33708 ); 33709 }, 33710 [306 /* ShorthandPropertyAssignment */]: function visitEachChildOfShorthandPropertyAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33711 return context.factory.updateShorthandPropertyAssignment( 33712 node, 33713 nodeVisitor(node.name, visitor, isIdentifier), 33714 nodeVisitor(node.objectAssignmentInitializer, visitor, isExpression) 33715 ); 33716 }, 33717 [307 /* SpreadAssignment */]: function visitEachChildOfSpreadAssignment(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33718 return context.factory.updateSpreadAssignment( 33719 node, 33720 nodeVisitor(node.expression, visitor, isExpression) 33721 ); 33722 }, 33723 [308 /* EnumMember */]: function visitEachChildOfEnumMember(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33724 return context.factory.updateEnumMember( 33725 node, 33726 nodeVisitor(node.name, visitor, isPropertyName), 33727 nodeVisitor(node.initializer, visitor, isExpression) 33728 ); 33729 }, 33730 [314 /* SourceFile */]: function visitEachChildOfSourceFile(node, visitor, context, _nodesVisitor, _nodeVisitor, _tokenVisitor) { 33731 return context.factory.updateSourceFile( 33732 node, 33733 visitLexicalEnvironment(node.statements, visitor, context) 33734 ); 33735 }, 33736 [359 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { 33737 return context.factory.updatePartiallyEmittedExpression( 33738 node, 33739 nodeVisitor(node.expression, visitor, isExpression) 33740 ); 33741 }, 33742 [360 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { 33743 return context.factory.updateCommaListExpression( 33744 node, 33745 nodesVisitor(node.elements, visitor, isExpression) 33746 ); 33747 } 33748}; 33749function extractSingleNode(nodes) { 33750 Debug.assert(nodes.length <= 1, "Too many nodes written to output."); 33751 return singleOrUndefined(nodes); 33752} 33753 33754// src/compiler/sourcemap.ts 33755function isStringOrNull(x) { 33756 return typeof x === "string" || x === null; 33757} 33758function isRawSourceMap(x) { 33759 return x !== null && typeof x === "object" && x.version === 3 && typeof x.file === "string" && typeof x.mappings === "string" && isArray(x.sources) && every(x.sources, isString) && (x.sourceRoot === void 0 || x.sourceRoot === null || typeof x.sourceRoot === "string") && (x.sourcesContent === void 0 || x.sourcesContent === null || isArray(x.sourcesContent) && every(x.sourcesContent, isStringOrNull)) && (x.names === void 0 || x.names === null || isArray(x.names) && every(x.names, isString)); 33760} 33761function tryParseRawSourceMap(text) { 33762 try { 33763 const parsed = JSON.parse(text); 33764 if (isRawSourceMap(parsed)) { 33765 return parsed; 33766 } 33767 } catch (e) { 33768 } 33769 return void 0; 33770} 33771 33772// src/compiler/transformers/jsx.ts 33773var entities = new Map2(getEntries({ 33774 quot: 34, 33775 amp: 38, 33776 apos: 39, 33777 lt: 60, 33778 gt: 62, 33779 nbsp: 160, 33780 iexcl: 161, 33781 cent: 162, 33782 pound: 163, 33783 curren: 164, 33784 yen: 165, 33785 brvbar: 166, 33786 sect: 167, 33787 uml: 168, 33788 copy: 169, 33789 ordf: 170, 33790 laquo: 171, 33791 not: 172, 33792 shy: 173, 33793 reg: 174, 33794 macr: 175, 33795 deg: 176, 33796 plusmn: 177, 33797 sup2: 178, 33798 sup3: 179, 33799 acute: 180, 33800 micro: 181, 33801 para: 182, 33802 middot: 183, 33803 cedil: 184, 33804 sup1: 185, 33805 ordm: 186, 33806 raquo: 187, 33807 frac14: 188, 33808 frac12: 189, 33809 frac34: 190, 33810 iquest: 191, 33811 Agrave: 192, 33812 Aacute: 193, 33813 Acirc: 194, 33814 Atilde: 195, 33815 Auml: 196, 33816 Aring: 197, 33817 AElig: 198, 33818 Ccedil: 199, 33819 Egrave: 200, 33820 Eacute: 201, 33821 Ecirc: 202, 33822 Euml: 203, 33823 Igrave: 204, 33824 Iacute: 205, 33825 Icirc: 206, 33826 Iuml: 207, 33827 ETH: 208, 33828 Ntilde: 209, 33829 Ograve: 210, 33830 Oacute: 211, 33831 Ocirc: 212, 33832 Otilde: 213, 33833 Ouml: 214, 33834 times: 215, 33835 Oslash: 216, 33836 Ugrave: 217, 33837 Uacute: 218, 33838 Ucirc: 219, 33839 Uuml: 220, 33840 Yacute: 221, 33841 THORN: 222, 33842 szlig: 223, 33843 agrave: 224, 33844 aacute: 225, 33845 acirc: 226, 33846 atilde: 227, 33847 auml: 228, 33848 aring: 229, 33849 aelig: 230, 33850 ccedil: 231, 33851 egrave: 232, 33852 eacute: 233, 33853 ecirc: 234, 33854 euml: 235, 33855 igrave: 236, 33856 iacute: 237, 33857 icirc: 238, 33858 iuml: 239, 33859 eth: 240, 33860 ntilde: 241, 33861 ograve: 242, 33862 oacute: 243, 33863 ocirc: 244, 33864 otilde: 245, 33865 ouml: 246, 33866 divide: 247, 33867 oslash: 248, 33868 ugrave: 249, 33869 uacute: 250, 33870 ucirc: 251, 33871 uuml: 252, 33872 yacute: 253, 33873 thorn: 254, 33874 yuml: 255, 33875 OElig: 338, 33876 oelig: 339, 33877 Scaron: 352, 33878 scaron: 353, 33879 Yuml: 376, 33880 fnof: 402, 33881 circ: 710, 33882 tilde: 732, 33883 Alpha: 913, 33884 Beta: 914, 33885 Gamma: 915, 33886 Delta: 916, 33887 Epsilon: 917, 33888 Zeta: 918, 33889 Eta: 919, 33890 Theta: 920, 33891 Iota: 921, 33892 Kappa: 922, 33893 Lambda: 923, 33894 Mu: 924, 33895 Nu: 925, 33896 Xi: 926, 33897 Omicron: 927, 33898 Pi: 928, 33899 Rho: 929, 33900 Sigma: 931, 33901 Tau: 932, 33902 Upsilon: 933, 33903 Phi: 934, 33904 Chi: 935, 33905 Psi: 936, 33906 Omega: 937, 33907 alpha: 945, 33908 beta: 946, 33909 gamma: 947, 33910 delta: 948, 33911 epsilon: 949, 33912 zeta: 950, 33913 eta: 951, 33914 theta: 952, 33915 iota: 953, 33916 kappa: 954, 33917 lambda: 955, 33918 mu: 956, 33919 nu: 957, 33920 xi: 958, 33921 omicron: 959, 33922 pi: 960, 33923 rho: 961, 33924 sigmaf: 962, 33925 sigma: 963, 33926 tau: 964, 33927 upsilon: 965, 33928 phi: 966, 33929 chi: 967, 33930 psi: 968, 33931 omega: 969, 33932 thetasym: 977, 33933 upsih: 978, 33934 piv: 982, 33935 ensp: 8194, 33936 emsp: 8195, 33937 thinsp: 8201, 33938 zwnj: 8204, 33939 zwj: 8205, 33940 lrm: 8206, 33941 rlm: 8207, 33942 ndash: 8211, 33943 mdash: 8212, 33944 lsquo: 8216, 33945 rsquo: 8217, 33946 sbquo: 8218, 33947 ldquo: 8220, 33948 rdquo: 8221, 33949 bdquo: 8222, 33950 dagger: 8224, 33951 Dagger: 8225, 33952 bull: 8226, 33953 hellip: 8230, 33954 permil: 8240, 33955 prime: 8242, 33956 Prime: 8243, 33957 lsaquo: 8249, 33958 rsaquo: 8250, 33959 oline: 8254, 33960 frasl: 8260, 33961 euro: 8364, 33962 image: 8465, 33963 weierp: 8472, 33964 real: 8476, 33965 trade: 8482, 33966 alefsym: 8501, 33967 larr: 8592, 33968 uarr: 8593, 33969 rarr: 8594, 33970 darr: 8595, 33971 harr: 8596, 33972 crarr: 8629, 33973 lArr: 8656, 33974 uArr: 8657, 33975 rArr: 8658, 33976 dArr: 8659, 33977 hArr: 8660, 33978 forall: 8704, 33979 part: 8706, 33980 exist: 8707, 33981 empty: 8709, 33982 nabla: 8711, 33983 isin: 8712, 33984 notin: 8713, 33985 ni: 8715, 33986 prod: 8719, 33987 sum: 8721, 33988 minus: 8722, 33989 lowast: 8727, 33990 radic: 8730, 33991 prop: 8733, 33992 infin: 8734, 33993 ang: 8736, 33994 and: 8743, 33995 or: 8744, 33996 cap: 8745, 33997 cup: 8746, 33998 int: 8747, 33999 there4: 8756, 34000 sim: 8764, 34001 cong: 8773, 34002 asymp: 8776, 34003 ne: 8800, 34004 equiv: 8801, 34005 le: 8804, 34006 ge: 8805, 34007 sub: 8834, 34008 sup: 8835, 34009 nsub: 8836, 34010 sube: 8838, 34011 supe: 8839, 34012 oplus: 8853, 34013 otimes: 8855, 34014 perp: 8869, 34015 sdot: 8901, 34016 lceil: 8968, 34017 rceil: 8969, 34018 lfloor: 8970, 34019 rfloor: 8971, 34020 lang: 9001, 34021 rang: 9002, 34022 loz: 9674, 34023 spades: 9824, 34024 clubs: 9827, 34025 hearts: 9829, 34026 diams: 9830 34027})); 34028 34029// src/compiler/transformers/declarations.ts 34030function hasInternalAnnotation(range, currentSourceFile) { 34031 const comment = currentSourceFile.text.substring(range.pos, range.end); 34032 return stringContains(comment, "@internal"); 34033} 34034function isInternalDeclaration(node, currentSourceFile) { 34035 const parseTreeNode = getParseTreeNode(node); 34036 if (parseTreeNode && parseTreeNode.kind === 168 /* Parameter */) { 34037 const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode); 34038 const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0; 34039 const text = currentSourceFile.text; 34040 const commentRanges = previousSibling ? concatenate( 34041 getTrailingCommentRanges(text, skipTrivia(text, previousSibling.end + 1, false, true)), 34042 getLeadingCommentRanges(text, node.pos) 34043 ) : getTrailingCommentRanges(text, skipTrivia(text, node.pos, false, true)); 34044 return commentRanges && commentRanges.length && hasInternalAnnotation(last(commentRanges), currentSourceFile); 34045 } 34046 const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, currentSourceFile); 34047 return !!forEach(leadingCommentRanges, (range) => { 34048 return hasInternalAnnotation(range, currentSourceFile); 34049 }); 34050} 34051var declarationEmitNodeBuilderFlags = 1024 /* MultilineObjectLiterals */ | 2048 /* WriteClassExpressionAsTypeLiteral */ | 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 524288 /* AllowEmptyTuple */ | 4 /* GenerateNamesForShadowedTypeParams */ | 1 /* NoTruncation */; 34052 34053// src/compiler/transformer.ts 34054function noEmitSubstitution(_hint, node) { 34055 return node; 34056} 34057function noEmitNotification(hint, node, callback) { 34058 callback(hint, node); 34059} 34060 34061// src/compiler/emitter.ts 34062var brackets = createBracketsMap(); 34063function getCommonSourceDirectory(options, emittedFiles, currentDirectory, getCanonicalFileName, checkSourceFilesBelongToPath) { 34064 let commonSourceDirectory; 34065 if (options.rootDir) { 34066 commonSourceDirectory = getNormalizedAbsolutePath(options.rootDir, currentDirectory); 34067 checkSourceFilesBelongToPath == null ? void 0 : checkSourceFilesBelongToPath(options.rootDir); 34068 } else if (options.composite && options.configFilePath) { 34069 commonSourceDirectory = getDirectoryPath(normalizeSlashes(options.configFilePath)); 34070 checkSourceFilesBelongToPath == null ? void 0 : checkSourceFilesBelongToPath(commonSourceDirectory); 34071 } else { 34072 commonSourceDirectory = computeCommonSourceDirectoryOfFilenames(emittedFiles(), currentDirectory, getCanonicalFileName); 34073 } 34074 if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== directorySeparator) { 34075 commonSourceDirectory += directorySeparator; 34076 } 34077 return commonSourceDirectory; 34078} 34079var createPrinterWithDefaults = memoize(() => createPrinter({})); 34080var createPrinterWithRemoveComments = memoize(() => createPrinter({ removeComments: true })); 34081var createPrinterWithRemoveCommentsNeverAsciiEscape = memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true })); 34082var createPrinterWithRemoveCommentsOmitTrailingSemicolon = memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true })); 34083function createPrinter(printerOptions = {}, handlers = {}) { 34084 var { 34085 hasGlobalName, 34086 onEmitNode = noEmitNotification, 34087 isEmitNotificationEnabled, 34088 substituteNode = noEmitSubstitution, 34089 onBeforeEmitNode, 34090 onAfterEmitNode, 34091 onBeforeEmitNodeArray, 34092 onAfterEmitNodeArray, 34093 onBeforeEmitToken, 34094 onAfterEmitToken 34095 } = handlers; 34096 var extendedDiagnostics = !!printerOptions.extendedDiagnostics; 34097 var newLine = getNewLineCharacter(printerOptions); 34098 var moduleKind = getEmitModuleKind(printerOptions); 34099 var bundledHelpers = new Map2(); 34100 var removeCommentsCollection; 34101 var universalRemoveCommentsCollection; 34102 var currentSourceFile; 34103 var nodeIdToGeneratedName; 34104 var autoGeneratedIdToGeneratedName; 34105 var generatedNames; 34106 var formattedNameTempFlagsStack; 34107 var formattedNameTempFlags; 34108 var privateNameTempFlagsStack; 34109 var privateNameTempFlags; 34110 var tempFlagsStack; 34111 var tempFlags; 34112 var reservedNamesStack; 34113 var reservedNames; 34114 var preserveSourceNewlines = printerOptions.preserveSourceNewlines; 34115 var nextListElementPos; 34116 var writer; 34117 var ownWriter; 34118 var write = writeBase; 34119 var isOwnFileEmit; 34120 var bundleFileInfo = printerOptions.writeBundleFileInfo ? { sections: [] } : void 0; 34121 var relativeToBuildInfo = bundleFileInfo ? Debug.checkDefined(printerOptions.relativeToBuildInfo) : void 0; 34122 var recordInternalSection = printerOptions.recordInternalSection; 34123 var sourceFileTextPos = 0; 34124 var sourceFileTextKind = "text" /* Text */; 34125 var sourceMapsDisabled = true; 34126 var sourceMapGenerator; 34127 var sourceMapSource; 34128 var sourceMapSourceIndex = -1; 34129 var mostRecentlyAddedSourceMapSource; 34130 var mostRecentlyAddedSourceMapSourceIndex = -1; 34131 var containerPos = -1; 34132 var containerEnd = -1; 34133 var declarationListContainerEnd = -1; 34134 var currentLineMap; 34135 var detachedCommentsInfo; 34136 var hasWrittenComment = false; 34137 var commentsDisabled = !!printerOptions.removeComments; 34138 var lastSubstitution; 34139 var currentParenthesizerRule; 34140 var { enter: enterComment, exit: exitComment } = createTimerIf(extendedDiagnostics, "commentTime", "beforeComment", "afterComment"); 34141 var parenthesizer = factory.parenthesizer; 34142 var typeArgumentParenthesizerRuleSelector = { 34143 select: (index) => index === 0 ? parenthesizer.parenthesizeLeadingTypeArgument : void 0 34144 }; 34145 var emitBinaryExpression = createEmitBinaryExpression(); 34146 reset(); 34147 return { 34148 printNode, 34149 printList, 34150 printFile, 34151 printBundle, 34152 writeNode, 34153 writeList, 34154 writeFile: writeFile2, 34155 writeBundle, 34156 bundleFileInfo 34157 }; 34158 function printNode(hint, node, sourceFile) { 34159 switch (hint) { 34160 case 0 /* SourceFile */: 34161 Debug.assert(isSourceFile(node), "Expected a SourceFile node."); 34162 break; 34163 case 2 /* IdentifierName */: 34164 Debug.assert(isIdentifier(node), "Expected an Identifier node."); 34165 break; 34166 case 1 /* Expression */: 34167 Debug.assert(isExpression(node), "Expected an Expression node."); 34168 break; 34169 } 34170 switch (node.kind) { 34171 case 314 /* SourceFile */: 34172 return printFile(node); 34173 case 315 /* Bundle */: 34174 return printBundle(node); 34175 case 316 /* UnparsedSource */: 34176 return printUnparsedSource(node); 34177 } 34178 writeNode(hint, node, sourceFile, beginPrint()); 34179 return endPrint(); 34180 } 34181 function printList(format, nodes, sourceFile) { 34182 writeList(format, nodes, sourceFile, beginPrint()); 34183 return endPrint(); 34184 } 34185 function printBundle(bundle) { 34186 writeBundle(bundle, beginPrint(), void 0); 34187 return endPrint(); 34188 } 34189 function printFile(sourceFile) { 34190 writeFile2(sourceFile, beginPrint(), void 0); 34191 return endPrint(); 34192 } 34193 function printUnparsedSource(unparsed) { 34194 writeUnparsedSource(unparsed, beginPrint()); 34195 return endPrint(); 34196 } 34197 function writeNode(hint, node, sourceFile, output) { 34198 const previousWriter = writer; 34199 setWriter(output, void 0); 34200 print(hint, node, sourceFile); 34201 reset(); 34202 writer = previousWriter; 34203 } 34204 function writeList(format, nodes, sourceFile, output) { 34205 const previousWriter = writer; 34206 setWriter(output, void 0); 34207 if (sourceFile) { 34208 setSourceFile(sourceFile); 34209 } 34210 emitList(void 0, nodes, format); 34211 reset(); 34212 writer = previousWriter; 34213 } 34214 function getTextPosWithWriteLine() { 34215 return writer.getTextPosWithWriteLine ? writer.getTextPosWithWriteLine() : writer.getTextPos(); 34216 } 34217 function updateOrPushBundleFileTextLike(pos, end, kind) { 34218 const last2 = lastOrUndefined(bundleFileInfo.sections); 34219 if (last2 && last2.kind === kind) { 34220 last2.end = end; 34221 } else { 34222 bundleFileInfo.sections.push({ pos, end, kind }); 34223 } 34224 } 34225 function recordBundleFileInternalSectionStart(node) { 34226 if (recordInternalSection && bundleFileInfo && currentSourceFile && (isDeclaration(node) || isVariableStatement(node)) && isInternalDeclaration(node, currentSourceFile) && sourceFileTextKind !== "internal" /* Internal */) { 34227 const prevSourceFileTextKind = sourceFileTextKind; 34228 recordBundleFileTextLikeSection(writer.getTextPos()); 34229 sourceFileTextPos = getTextPosWithWriteLine(); 34230 sourceFileTextKind = "internal" /* Internal */; 34231 return prevSourceFileTextKind; 34232 } 34233 return void 0; 34234 } 34235 function recordBundleFileInternalSectionEnd(prevSourceFileTextKind) { 34236 if (prevSourceFileTextKind) { 34237 recordBundleFileTextLikeSection(writer.getTextPos()); 34238 sourceFileTextPos = getTextPosWithWriteLine(); 34239 sourceFileTextKind = prevSourceFileTextKind; 34240 } 34241 } 34242 function recordBundleFileTextLikeSection(end) { 34243 if (sourceFileTextPos < end) { 34244 updateOrPushBundleFileTextLike(sourceFileTextPos, end, sourceFileTextKind); 34245 return true; 34246 } 34247 return false; 34248 } 34249 function writeBundle(bundle, output, sourceMapGenerator2) { 34250 isOwnFileEmit = false; 34251 const previousWriter = writer; 34252 setWriter(output, sourceMapGenerator2); 34253 emitShebangIfNeeded(bundle); 34254 emitPrologueDirectivesIfNeeded(bundle); 34255 emitHelpers(bundle); 34256 emitSyntheticTripleSlashReferencesIfNeeded(bundle); 34257 for (const prepend of bundle.prepends) { 34258 writeLine(); 34259 const pos = writer.getTextPos(); 34260 const savedSections = bundleFileInfo && bundleFileInfo.sections; 34261 if (savedSections) 34262 bundleFileInfo.sections = []; 34263 print(4 /* Unspecified */, prepend, void 0); 34264 if (bundleFileInfo) { 34265 const newSections = bundleFileInfo.sections; 34266 bundleFileInfo.sections = savedSections; 34267 if (prepend.oldFileOfCurrentEmit) 34268 bundleFileInfo.sections.push(...newSections); 34269 else { 34270 newSections.forEach((section) => Debug.assert(isBundleFileTextLike(section))); 34271 bundleFileInfo.sections.push({ 34272 pos, 34273 end: writer.getTextPos(), 34274 kind: "prepend" /* Prepend */, 34275 data: relativeToBuildInfo(prepend.fileName), 34276 texts: newSections 34277 }); 34278 } 34279 } 34280 } 34281 sourceFileTextPos = getTextPosWithWriteLine(); 34282 for (const sourceFile of bundle.sourceFiles) { 34283 print(0 /* SourceFile */, sourceFile, sourceFile); 34284 } 34285 if (bundleFileInfo && bundle.sourceFiles.length) { 34286 const end = writer.getTextPos(); 34287 if (recordBundleFileTextLikeSection(end)) { 34288 const prologues = getPrologueDirectivesFromBundledSourceFiles(bundle); 34289 if (prologues) { 34290 if (!bundleFileInfo.sources) 34291 bundleFileInfo.sources = {}; 34292 bundleFileInfo.sources.prologues = prologues; 34293 } 34294 const helpers = getHelpersFromBundledSourceFiles(bundle); 34295 if (helpers) { 34296 if (!bundleFileInfo.sources) 34297 bundleFileInfo.sources = {}; 34298 bundleFileInfo.sources.helpers = helpers; 34299 } 34300 } 34301 } 34302 reset(); 34303 writer = previousWriter; 34304 } 34305 function writeUnparsedSource(unparsed, output) { 34306 const previousWriter = writer; 34307 setWriter(output, void 0); 34308 print(4 /* Unspecified */, unparsed, void 0); 34309 reset(); 34310 writer = previousWriter; 34311 } 34312 function writeFile2(sourceFile, output, sourceMapGenerator2) { 34313 removeCommentsCollection = sourceFile == null ? void 0 : sourceFile.reservedComments; 34314 universalRemoveCommentsCollection = sourceFile == null ? void 0 : sourceFile.universalReservedComments; 34315 isOwnFileEmit = true; 34316 const previousWriter = writer; 34317 setWriter(output, sourceMapGenerator2); 34318 emitShebangIfNeeded(sourceFile); 34319 emitPrologueDirectivesIfNeeded(sourceFile); 34320 print(0 /* SourceFile */, sourceFile, sourceFile); 34321 reset(); 34322 writer = previousWriter; 34323 } 34324 function beginPrint() { 34325 return ownWriter || (ownWriter = createTextWriter(newLine)); 34326 } 34327 function endPrint() { 34328 const text = ownWriter.getText(); 34329 ownWriter.clear(); 34330 return text; 34331 } 34332 function print(hint, node, sourceFile) { 34333 if (sourceFile) { 34334 setSourceFile(sourceFile); 34335 } 34336 pipelineEmit(hint, node, void 0); 34337 } 34338 function setSourceFile(sourceFile) { 34339 currentSourceFile = sourceFile; 34340 currentLineMap = void 0; 34341 detachedCommentsInfo = void 0; 34342 if (sourceFile) { 34343 setSourceMapSource(sourceFile); 34344 } 34345 } 34346 function setWriter(_writer, _sourceMapGenerator) { 34347 if (_writer && printerOptions.omitTrailingSemicolon) { 34348 _writer = getTrailingSemicolonDeferringWriter(_writer); 34349 } 34350 writer = _writer; 34351 sourceMapGenerator = _sourceMapGenerator; 34352 sourceMapsDisabled = !writer || !sourceMapGenerator; 34353 } 34354 function reset() { 34355 nodeIdToGeneratedName = []; 34356 autoGeneratedIdToGeneratedName = []; 34357 generatedNames = new Set2(); 34358 formattedNameTempFlagsStack = []; 34359 formattedNameTempFlags = new Map2(); 34360 privateNameTempFlagsStack = []; 34361 privateNameTempFlags = TempFlags.Auto; 34362 tempFlagsStack = []; 34363 tempFlags = TempFlags.Auto; 34364 reservedNamesStack = []; 34365 currentSourceFile = void 0; 34366 currentLineMap = void 0; 34367 detachedCommentsInfo = void 0; 34368 setWriter(void 0, void 0); 34369 } 34370 function getCurrentLineMap() { 34371 return currentLineMap || (currentLineMap = getLineStarts(Debug.checkDefined(currentSourceFile))); 34372 } 34373 function emit(node, parenthesizerRule) { 34374 if (node === void 0) 34375 return; 34376 const prevSourceFileTextKind = recordBundleFileInternalSectionStart(node); 34377 pipelineEmit(4 /* Unspecified */, node, parenthesizerRule); 34378 recordBundleFileInternalSectionEnd(prevSourceFileTextKind); 34379 } 34380 function emitIdentifierName(node) { 34381 if (node === void 0) 34382 return; 34383 pipelineEmit(2 /* IdentifierName */, node, void 0); 34384 } 34385 function emitExpression(node, parenthesizerRule) { 34386 if (node === void 0) 34387 return; 34388 pipelineEmit(1 /* Expression */, node, parenthesizerRule); 34389 } 34390 function emitJsxAttributeValue(node) { 34391 pipelineEmit(isStringLiteral(node) ? 6 /* JsxAttributeValue */ : 4 /* Unspecified */, node); 34392 } 34393 function beforeEmitNode(node) { 34394 if (preserveSourceNewlines && getEmitFlags(node) & 134217728 /* IgnoreSourceNewlines */) { 34395 preserveSourceNewlines = false; 34396 } 34397 } 34398 function afterEmitNode(savedPreserveSourceNewlines) { 34399 preserveSourceNewlines = savedPreserveSourceNewlines; 34400 } 34401 function pipelineEmit(emitHint, node, parenthesizerRule) { 34402 currentParenthesizerRule = parenthesizerRule; 34403 const pipelinePhase = getPipelinePhase(0 /* Notification */, emitHint, node); 34404 pipelinePhase(emitHint, node); 34405 currentParenthesizerRule = void 0; 34406 } 34407 function shouldEmitComments(node) { 34408 return !commentsDisabled && !isSourceFile(node); 34409 } 34410 function shouldEmitSourceMaps(node) { 34411 return !sourceMapsDisabled && !isSourceFile(node) && !isInJsonFile(node) && !isUnparsedSource(node) && !isUnparsedPrepend(node); 34412 } 34413 function getPipelinePhase(phase, emitHint, node) { 34414 switch (phase) { 34415 case 0 /* Notification */: 34416 if (onEmitNode !== noEmitNotification && (!isEmitNotificationEnabled || isEmitNotificationEnabled(node))) { 34417 return pipelineEmitWithNotification; 34418 } 34419 case 1 /* Substitution */: 34420 if (substituteNode !== noEmitSubstitution && (lastSubstitution = substituteNode(emitHint, node) || node) !== node) { 34421 if (currentParenthesizerRule) { 34422 lastSubstitution = currentParenthesizerRule(lastSubstitution); 34423 } 34424 return pipelineEmitWithSubstitution; 34425 } 34426 case 2 /* Comments */: 34427 if (shouldEmitComments(node)) { 34428 return pipelineEmitWithComments; 34429 } 34430 case 3 /* SourceMaps */: 34431 if (shouldEmitSourceMaps(node)) { 34432 return pipelineEmitWithSourceMaps; 34433 } 34434 case 4 /* Emit */: 34435 return pipelineEmitWithHint; 34436 default: 34437 return Debug.assertNever(phase); 34438 } 34439 } 34440 function getNextPipelinePhase(currentPhase, emitHint, node) { 34441 return getPipelinePhase(currentPhase + 1, emitHint, node); 34442 } 34443 function pipelineEmitWithNotification(hint, node) { 34444 const pipelinePhase = getNextPipelinePhase(0 /* Notification */, hint, node); 34445 onEmitNode(hint, node, pipelinePhase); 34446 } 34447 function pipelineEmitWithHint(hint, node) { 34448 onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(node); 34449 if (preserveSourceNewlines) { 34450 const savedPreserveSourceNewlines = preserveSourceNewlines; 34451 beforeEmitNode(node); 34452 pipelineEmitWithHintWorker(hint, node); 34453 afterEmitNode(savedPreserveSourceNewlines); 34454 } else { 34455 pipelineEmitWithHintWorker(hint, node); 34456 } 34457 onAfterEmitNode == null ? void 0 : onAfterEmitNode(node); 34458 currentParenthesizerRule = void 0; 34459 } 34460 function pipelineEmitWithHintWorker(hint, node, allowSnippets = true) { 34461 if (allowSnippets) { 34462 const snippet = getSnippetElement(node); 34463 if (snippet) { 34464 return emitSnippetNode(hint, node, snippet); 34465 } 34466 } 34467 if (hint === 0 /* SourceFile */) 34468 return emitSourceFile(cast(node, isSourceFile)); 34469 if (hint === 2 /* IdentifierName */) 34470 return emitIdentifier(cast(node, isIdentifier)); 34471 if (hint === 6 /* JsxAttributeValue */) 34472 return emitLiteral(cast(node, isStringLiteral), true); 34473 if (hint === 3 /* MappedTypeParameter */) 34474 return emitMappedTypeParameter(cast(node, isTypeParameterDeclaration)); 34475 if (hint === 5 /* EmbeddedStatement */) { 34476 Debug.assertNode(node, isEmptyStatement); 34477 return emitEmptyStatement(true); 34478 } 34479 if (hint === 4 /* Unspecified */) { 34480 switch (node.kind) { 34481 case 15 /* TemplateHead */: 34482 case 16 /* TemplateMiddle */: 34483 case 17 /* TemplateTail */: 34484 return emitLiteral(node, false); 34485 case 79 /* Identifier */: 34486 return emitIdentifier(node); 34487 case 80 /* PrivateIdentifier */: 34488 return emitPrivateIdentifier(node); 34489 case 165 /* QualifiedName */: 34490 return emitQualifiedName(node); 34491 case 166 /* ComputedPropertyName */: 34492 return emitComputedPropertyName(node); 34493 case 167 /* TypeParameter */: 34494 return emitTypeParameter(node); 34495 case 168 /* Parameter */: 34496 return emitParameter(node); 34497 case 169 /* Decorator */: 34498 return emitDecorator(node); 34499 case 170 /* PropertySignature */: 34500 return emitPropertySignature(node); 34501 case 171 /* PropertyDeclaration */: 34502 return emitPropertyDeclaration(node); 34503 case 172 /* AnnotationPropertyDeclaration */: 34504 return emitAnnotationPropertyDeclaration(node); 34505 case 173 /* MethodSignature */: 34506 return emitMethodSignature(node); 34507 case 174 /* MethodDeclaration */: 34508 return emitMethodDeclaration(node); 34509 case 175 /* ClassStaticBlockDeclaration */: 34510 return emitClassStaticBlockDeclaration(node); 34511 case 176 /* Constructor */: 34512 return emitConstructor(node); 34513 case 177 /* GetAccessor */: 34514 case 178 /* SetAccessor */: 34515 return emitAccessorDeclaration(node); 34516 case 179 /* CallSignature */: 34517 return emitCallSignature(node); 34518 case 180 /* ConstructSignature */: 34519 return emitConstructSignature(node); 34520 case 181 /* IndexSignature */: 34521 return emitIndexSignature(node); 34522 case 182 /* TypePredicate */: 34523 return emitTypePredicate(node); 34524 case 183 /* TypeReference */: 34525 return emitTypeReference(node); 34526 case 184 /* FunctionType */: 34527 return emitFunctionType(node); 34528 case 185 /* ConstructorType */: 34529 return emitConstructorType(node); 34530 case 186 /* TypeQuery */: 34531 return emitTypeQuery(node); 34532 case 187 /* TypeLiteral */: 34533 return emitTypeLiteral(node); 34534 case 188 /* ArrayType */: 34535 return emitArrayType(node); 34536 case 189 /* TupleType */: 34537 return emitTupleType(node); 34538 case 190 /* OptionalType */: 34539 return emitOptionalType(node); 34540 case 192 /* UnionType */: 34541 return emitUnionType(node); 34542 case 193 /* IntersectionType */: 34543 return emitIntersectionType(node); 34544 case 194 /* ConditionalType */: 34545 return emitConditionalType(node); 34546 case 195 /* InferType */: 34547 return emitInferType(node); 34548 case 196 /* ParenthesizedType */: 34549 return emitParenthesizedType(node); 34550 case 234 /* ExpressionWithTypeArguments */: 34551 return emitExpressionWithTypeArguments(node); 34552 case 197 /* ThisType */: 34553 return emitThisType(); 34554 case 198 /* TypeOperator */: 34555 return emitTypeOperator(node); 34556 case 199 /* IndexedAccessType */: 34557 return emitIndexedAccessType(node); 34558 case 200 /* MappedType */: 34559 return emitMappedType(node); 34560 case 201 /* LiteralType */: 34561 return emitLiteralType(node); 34562 case 202 /* NamedTupleMember */: 34563 return emitNamedTupleMember(node); 34564 case 203 /* TemplateLiteralType */: 34565 return emitTemplateType(node); 34566 case 204 /* TemplateLiteralTypeSpan */: 34567 return emitTemplateTypeSpan(node); 34568 case 205 /* ImportType */: 34569 return emitImportTypeNode(node); 34570 case 206 /* ObjectBindingPattern */: 34571 return emitObjectBindingPattern(node); 34572 case 207 /* ArrayBindingPattern */: 34573 return emitArrayBindingPattern(node); 34574 case 208 /* BindingElement */: 34575 return emitBindingElement(node); 34576 case 240 /* TemplateSpan */: 34577 return emitTemplateSpan(node); 34578 case 241 /* SemicolonClassElement */: 34579 return emitSemicolonClassElement(); 34580 case 242 /* Block */: 34581 return emitBlock(node); 34582 case 244 /* VariableStatement */: 34583 return emitVariableStatement(node); 34584 case 243 /* EmptyStatement */: 34585 return emitEmptyStatement(false); 34586 case 245 /* ExpressionStatement */: 34587 return emitExpressionStatement(node); 34588 case 246 /* IfStatement */: 34589 return emitIfStatement(node); 34590 case 247 /* DoStatement */: 34591 return emitDoStatement(node); 34592 case 248 /* WhileStatement */: 34593 return emitWhileStatement(node); 34594 case 249 /* ForStatement */: 34595 return emitForStatement(node); 34596 case 250 /* ForInStatement */: 34597 return emitForInStatement(node); 34598 case 251 /* ForOfStatement */: 34599 return emitForOfStatement(node); 34600 case 252 /* ContinueStatement */: 34601 return emitContinueStatement(node); 34602 case 253 /* BreakStatement */: 34603 return emitBreakStatement(node); 34604 case 254 /* ReturnStatement */: 34605 return emitReturnStatement(node); 34606 case 255 /* WithStatement */: 34607 return emitWithStatement(node); 34608 case 256 /* SwitchStatement */: 34609 return emitSwitchStatement(node); 34610 case 257 /* LabeledStatement */: 34611 return emitLabeledStatement(node); 34612 case 258 /* ThrowStatement */: 34613 return emitThrowStatement(node); 34614 case 259 /* TryStatement */: 34615 return emitTryStatement(node); 34616 case 260 /* DebuggerStatement */: 34617 return emitDebuggerStatement(node); 34618 case 261 /* VariableDeclaration */: 34619 return emitVariableDeclaration(node); 34620 case 262 /* VariableDeclarationList */: 34621 return emitVariableDeclarationList(node); 34622 case 263 /* FunctionDeclaration */: 34623 return emitFunctionDeclaration(node); 34624 case 264 /* ClassDeclaration */: 34625 return emitClassOrStructDeclaration(node); 34626 case 265 /* StructDeclaration */: 34627 return emitClassOrStructDeclaration(node); 34628 case 266 /* AnnotationDeclaration */: 34629 return emitAnnotationDeclaration(node); 34630 case 267 /* InterfaceDeclaration */: 34631 return emitInterfaceDeclaration(node); 34632 case 268 /* TypeAliasDeclaration */: 34633 return emitTypeAliasDeclaration(node); 34634 case 269 /* EnumDeclaration */: 34635 return emitEnumDeclaration(node); 34636 case 270 /* ModuleDeclaration */: 34637 return emitModuleDeclaration(node); 34638 case 271 /* ModuleBlock */: 34639 return emitModuleBlock(node); 34640 case 272 /* CaseBlock */: 34641 return emitCaseBlock(node); 34642 case 273 /* NamespaceExportDeclaration */: 34643 return emitNamespaceExportDeclaration(node); 34644 case 274 /* ImportEqualsDeclaration */: 34645 return emitImportEqualsDeclaration(node); 34646 case 275 /* ImportDeclaration */: 34647 return emitImportDeclaration(node); 34648 case 276 /* ImportClause */: 34649 return emitImportClause(node); 34650 case 277 /* NamespaceImport */: 34651 return emitNamespaceImport(node); 34652 case 283 /* NamespaceExport */: 34653 return emitNamespaceExport(node); 34654 case 278 /* NamedImports */: 34655 return emitNamedImports(node); 34656 case 279 /* ImportSpecifier */: 34657 return emitImportSpecifier(node); 34658 case 280 /* ExportAssignment */: 34659 return emitExportAssignment(node); 34660 case 281 /* ExportDeclaration */: 34661 return emitExportDeclaration(node); 34662 case 282 /* NamedExports */: 34663 return emitNamedExports(node); 34664 case 284 /* ExportSpecifier */: 34665 return emitExportSpecifier(node); 34666 case 302 /* AssertClause */: 34667 return emitAssertClause(node); 34668 case 303 /* AssertEntry */: 34669 return emitAssertEntry(node); 34670 case 285 /* MissingDeclaration */: 34671 return; 34672 case 286 /* ExternalModuleReference */: 34673 return emitExternalModuleReference(node); 34674 case 11 /* JsxText */: 34675 return emitJsxText(node); 34676 case 289 /* JsxOpeningElement */: 34677 case 292 /* JsxOpeningFragment */: 34678 return emitJsxOpeningElementOrFragment(node); 34679 case 290 /* JsxClosingElement */: 34680 case 293 /* JsxClosingFragment */: 34681 return emitJsxClosingElementOrFragment(node); 34682 case 294 /* JsxAttribute */: 34683 return emitJsxAttribute(node); 34684 case 295 /* JsxAttributes */: 34685 return emitJsxAttributes(node); 34686 case 296 /* JsxSpreadAttribute */: 34687 return emitJsxSpreadAttribute(node); 34688 case 297 /* JsxExpression */: 34689 return emitJsxExpression(node); 34690 case 298 /* CaseClause */: 34691 return emitCaseClause(node); 34692 case 299 /* DefaultClause */: 34693 return emitDefaultClause(node); 34694 case 300 /* HeritageClause */: 34695 return emitHeritageClause(node); 34696 case 301 /* CatchClause */: 34697 return emitCatchClause(node); 34698 case 305 /* PropertyAssignment */: 34699 return emitPropertyAssignment(node); 34700 case 306 /* ShorthandPropertyAssignment */: 34701 return emitShorthandPropertyAssignment(node); 34702 case 307 /* SpreadAssignment */: 34703 return emitSpreadAssignment(node); 34704 case 308 /* EnumMember */: 34705 return emitEnumMember(node); 34706 case 309 /* UnparsedPrologue */: 34707 return writeUnparsedNode(node); 34708 case 316 /* UnparsedSource */: 34709 case 310 /* UnparsedPrepend */: 34710 return emitUnparsedSourceOrPrepend(node); 34711 case 311 /* UnparsedText */: 34712 case 312 /* UnparsedInternalText */: 34713 return emitUnparsedTextLike(node); 34714 case 313 /* UnparsedSyntheticReference */: 34715 return emitUnparsedSyntheticReference(node); 34716 case 314 /* SourceFile */: 34717 return emitSourceFile(node); 34718 case 315 /* Bundle */: 34719 return Debug.fail("Bundles should be printed using printBundle"); 34720 case 317 /* InputFiles */: 34721 return Debug.fail("InputFiles should not be printed"); 34722 case 318 /* JSDocTypeExpression */: 34723 return emitJSDocTypeExpression(node); 34724 case 319 /* JSDocNameReference */: 34725 return emitJSDocNameReference(node); 34726 case 321 /* JSDocAllType */: 34727 return writePunctuation("*"); 34728 case 322 /* JSDocUnknownType */: 34729 return writePunctuation("?"); 34730 case 323 /* JSDocNullableType */: 34731 return emitJSDocNullableType(node); 34732 case 324 /* JSDocNonNullableType */: 34733 return emitJSDocNonNullableType(node); 34734 case 325 /* JSDocOptionalType */: 34735 return emitJSDocOptionalType(node); 34736 case 326 /* JSDocFunctionType */: 34737 return emitJSDocFunctionType(node); 34738 case 191 /* RestType */: 34739 case 327 /* JSDocVariadicType */: 34740 return emitRestOrJSDocVariadicType(node); 34741 case 328 /* JSDocNamepathType */: 34742 return; 34743 case 329 /* JSDoc */: 34744 return emitJSDoc(node); 34745 case 331 /* JSDocTypeLiteral */: 34746 return emitJSDocTypeLiteral(node); 34747 case 332 /* JSDocSignature */: 34748 return emitJSDocSignature(node); 34749 case 336 /* JSDocTag */: 34750 case 341 /* JSDocClassTag */: 34751 case 346 /* JSDocOverrideTag */: 34752 return emitJSDocSimpleTag(node); 34753 case 337 /* JSDocAugmentsTag */: 34754 case 338 /* JSDocImplementsTag */: 34755 return emitJSDocHeritageTag(node); 34756 case 339 /* JSDocAuthorTag */: 34757 case 340 /* JSDocDeprecatedTag */: 34758 return; 34759 case 342 /* JSDocPublicTag */: 34760 case 343 /* JSDocPrivateTag */: 34761 case 344 /* JSDocProtectedTag */: 34762 case 345 /* JSDocReadonlyTag */: 34763 return; 34764 case 347 /* JSDocCallbackTag */: 34765 return emitJSDocCallbackTag(node); 34766 case 349 /* JSDocParameterTag */: 34767 case 356 /* JSDocPropertyTag */: 34768 return emitJSDocPropertyLikeTag(node); 34769 case 348 /* JSDocEnumTag */: 34770 case 350 /* JSDocReturnTag */: 34771 case 351 /* JSDocThisTag */: 34772 case 352 /* JSDocTypeTag */: 34773 return emitJSDocSimpleTypedTag(node); 34774 case 353 /* JSDocTemplateTag */: 34775 return emitJSDocTemplateTag(node); 34776 case 354 /* JSDocTypedefTag */: 34777 return emitJSDocTypedefTag(node); 34778 case 355 /* JSDocSeeTag */: 34779 return emitJSDocSeeTag(node); 34780 case 358 /* NotEmittedStatement */: 34781 case 362 /* EndOfDeclarationMarker */: 34782 case 361 /* MergeDeclarationMarker */: 34783 return; 34784 } 34785 if (isExpression(node)) { 34786 hint = 1 /* Expression */; 34787 if (substituteNode !== noEmitSubstitution) { 34788 const substitute = substituteNode(hint, node) || node; 34789 if (substitute !== node) { 34790 node = substitute; 34791 if (currentParenthesizerRule) { 34792 node = currentParenthesizerRule(node); 34793 } 34794 } 34795 } 34796 } 34797 } 34798 if (hint === 1 /* Expression */) { 34799 switch (node.kind) { 34800 case 8 /* NumericLiteral */: 34801 case 9 /* BigIntLiteral */: 34802 return emitNumericOrBigIntLiteral(node); 34803 case 10 /* StringLiteral */: 34804 case 13 /* RegularExpressionLiteral */: 34805 case 14 /* NoSubstitutionTemplateLiteral */: 34806 return emitLiteral(node, false); 34807 case 79 /* Identifier */: 34808 return emitIdentifier(node); 34809 case 80 /* PrivateIdentifier */: 34810 return emitPrivateIdentifier(node); 34811 case 209 /* ArrayLiteralExpression */: 34812 return emitArrayLiteralExpression(node); 34813 case 210 /* ObjectLiteralExpression */: 34814 return emitObjectLiteralExpression(node); 34815 case 211 /* PropertyAccessExpression */: 34816 return emitPropertyAccessExpression(node); 34817 case 212 /* ElementAccessExpression */: 34818 return emitElementAccessExpression(node); 34819 case 213 /* CallExpression */: 34820 return emitCallExpression(node); 34821 case 214 /* NewExpression */: 34822 return emitNewExpression(node); 34823 case 215 /* TaggedTemplateExpression */: 34824 return emitTaggedTemplateExpression(node); 34825 case 216 /* TypeAssertionExpression */: 34826 return emitTypeAssertionExpression(node); 34827 case 217 /* ParenthesizedExpression */: 34828 return emitParenthesizedExpression(node); 34829 case 218 /* FunctionExpression */: 34830 return emitFunctionExpression(node); 34831 case 219 /* ArrowFunction */: 34832 return emitArrowFunction(node); 34833 case 221 /* DeleteExpression */: 34834 return emitDeleteExpression(node); 34835 case 222 /* TypeOfExpression */: 34836 return emitTypeOfExpression(node); 34837 case 223 /* VoidExpression */: 34838 return emitVoidExpression(node); 34839 case 224 /* AwaitExpression */: 34840 return emitAwaitExpression(node); 34841 case 225 /* PrefixUnaryExpression */: 34842 return emitPrefixUnaryExpression(node); 34843 case 226 /* PostfixUnaryExpression */: 34844 return emitPostfixUnaryExpression(node); 34845 case 227 /* BinaryExpression */: 34846 return emitBinaryExpression(node); 34847 case 228 /* ConditionalExpression */: 34848 return emitConditionalExpression(node); 34849 case 229 /* TemplateExpression */: 34850 return emitTemplateExpression(node); 34851 case 230 /* YieldExpression */: 34852 return emitYieldExpression(node); 34853 case 231 /* SpreadElement */: 34854 return emitSpreadElement(node); 34855 case 232 /* ClassExpression */: 34856 return emitClassExpression(node); 34857 case 233 /* OmittedExpression */: 34858 return; 34859 case 235 /* AsExpression */: 34860 return emitAsExpression(node); 34861 case 236 /* NonNullExpression */: 34862 return emitNonNullExpression(node); 34863 case 234 /* ExpressionWithTypeArguments */: 34864 return emitExpressionWithTypeArguments(node); 34865 case 239 /* SatisfiesExpression */: 34866 return emitSatisfiesExpression(node); 34867 case 237 /* MetaProperty */: 34868 return emitMetaProperty(node); 34869 case 238 /* SyntheticExpression */: 34870 return Debug.fail("SyntheticExpression should never be printed."); 34871 case 287 /* JsxElement */: 34872 return emitJsxElement(node); 34873 case 288 /* JsxSelfClosingElement */: 34874 return emitJsxSelfClosingElement(node); 34875 case 291 /* JsxFragment */: 34876 return emitJsxFragment(node); 34877 case 357 /* SyntaxList */: 34878 return Debug.fail("SyntaxList should not be printed"); 34879 case 358 /* NotEmittedStatement */: 34880 return; 34881 case 359 /* PartiallyEmittedExpression */: 34882 return emitPartiallyEmittedExpression(node); 34883 case 360 /* CommaListExpression */: 34884 return emitCommaList(node); 34885 case 361 /* MergeDeclarationMarker */: 34886 case 362 /* EndOfDeclarationMarker */: 34887 return; 34888 case 363 /* SyntheticReferenceExpression */: 34889 return Debug.fail("SyntheticReferenceExpression should not be printed"); 34890 } 34891 } 34892 if (isKeyword(node.kind)) 34893 return writeTokenNode(node, writeKeyword); 34894 if (isTokenKind(node.kind)) 34895 return writeTokenNode(node, writePunctuation); 34896 if (findAncestor(node, (elelment) => { 34897 return isEtsComponentExpression(elelment); 34898 })) { 34899 return; 34900 } 34901 Debug.fail(`Unhandled SyntaxKind: ${Debug.formatSyntaxKind(node.kind)}.`); 34902 } 34903 function emitMappedTypeParameter(node) { 34904 emit(node.name); 34905 writeSpace(); 34906 writeKeyword("in"); 34907 writeSpace(); 34908 emit(node.constraint); 34909 } 34910 function pipelineEmitWithSubstitution(hint, node) { 34911 const pipelinePhase = getNextPipelinePhase(1 /* Substitution */, hint, node); 34912 Debug.assertIsDefined(lastSubstitution); 34913 node = lastSubstitution; 34914 lastSubstitution = void 0; 34915 pipelinePhase(hint, node); 34916 } 34917 function getHelpersFromBundledSourceFiles(bundle) { 34918 let result; 34919 if (moduleKind === 0 /* None */ || printerOptions.noEmitHelpers) { 34920 return void 0; 34921 } 34922 const bundledHelpers2 = new Map2(); 34923 for (const sourceFile of bundle.sourceFiles) { 34924 const shouldSkip = getExternalHelpersModuleName(sourceFile) !== void 0; 34925 const helpers = getSortedEmitHelpers(sourceFile); 34926 if (!helpers) 34927 continue; 34928 for (const helper of helpers) { 34929 if (!helper.scoped && !shouldSkip && !bundledHelpers2.get(helper.name)) { 34930 bundledHelpers2.set(helper.name, true); 34931 (result || (result = [])).push(helper.name); 34932 } 34933 } 34934 } 34935 return result; 34936 } 34937 function emitHelpers(node) { 34938 let helpersEmitted = false; 34939 const bundle = node.kind === 315 /* Bundle */ ? node : void 0; 34940 if (bundle && moduleKind === 0 /* None */) { 34941 return; 34942 } 34943 const numPrepends = bundle ? bundle.prepends.length : 0; 34944 const numNodes = bundle ? bundle.sourceFiles.length + numPrepends : 1; 34945 for (let i = 0; i < numNodes; i++) { 34946 const currentNode = bundle ? i < numPrepends ? bundle.prepends[i] : bundle.sourceFiles[i - numPrepends] : node; 34947 const sourceFile = isSourceFile(currentNode) ? currentNode : isUnparsedSource(currentNode) ? void 0 : currentSourceFile; 34948 const shouldSkip = printerOptions.noEmitHelpers || !!sourceFile && hasRecordedExternalHelpers(sourceFile); 34949 const shouldBundle = (isSourceFile(currentNode) || isUnparsedSource(currentNode)) && !isOwnFileEmit; 34950 const helpers = isUnparsedSource(currentNode) ? currentNode.helpers : getSortedEmitHelpers(currentNode); 34951 if (helpers) { 34952 for (const helper of helpers) { 34953 if (!helper.scoped) { 34954 if (shouldSkip) 34955 continue; 34956 if (shouldBundle) { 34957 if (bundledHelpers.get(helper.name)) { 34958 continue; 34959 } 34960 bundledHelpers.set(helper.name, true); 34961 } 34962 } else if (bundle) { 34963 continue; 34964 } 34965 const pos = getTextPosWithWriteLine(); 34966 if (typeof helper.text === "string") { 34967 writeLines(helper.text); 34968 } else { 34969 writeLines(helper.text(makeFileLevelOptimisticUniqueName)); 34970 } 34971 if (bundleFileInfo) 34972 bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "emitHelpers" /* EmitHelpers */, data: helper.name }); 34973 helpersEmitted = true; 34974 } 34975 } 34976 } 34977 return helpersEmitted; 34978 } 34979 function getSortedEmitHelpers(node) { 34980 const helpers = getEmitHelpers(node); 34981 return helpers && stableSort(helpers, compareEmitHelpers); 34982 } 34983 function emitNumericOrBigIntLiteral(node) { 34984 emitLiteral(node, false); 34985 } 34986 function emitLiteral(node, jsxAttributeEscape) { 34987 const text = getLiteralTextOfNode(node, printerOptions.neverAsciiEscape, jsxAttributeEscape); 34988 if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 10 /* StringLiteral */ || isTemplateLiteralKind(node.kind))) { 34989 writeLiteral(text); 34990 } else { 34991 writeStringLiteral(text); 34992 } 34993 } 34994 function emitUnparsedSourceOrPrepend(unparsed) { 34995 for (const text of unparsed.texts) { 34996 writeLine(); 34997 emit(text); 34998 } 34999 } 35000 function writeUnparsedNode(unparsed) { 35001 writer.rawWrite(unparsed.parent.text.substring(unparsed.pos, unparsed.end)); 35002 } 35003 function emitUnparsedTextLike(unparsed) { 35004 const pos = getTextPosWithWriteLine(); 35005 writeUnparsedNode(unparsed); 35006 if (bundleFileInfo) { 35007 updateOrPushBundleFileTextLike( 35008 pos, 35009 writer.getTextPos(), 35010 unparsed.kind === 311 /* UnparsedText */ ? "text" /* Text */ : "internal" /* Internal */ 35011 ); 35012 } 35013 } 35014 function emitUnparsedSyntheticReference(unparsed) { 35015 const pos = getTextPosWithWriteLine(); 35016 writeUnparsedNode(unparsed); 35017 if (bundleFileInfo) { 35018 const section = clone(unparsed.section); 35019 section.pos = pos; 35020 section.end = writer.getTextPos(); 35021 bundleFileInfo.sections.push(section); 35022 } 35023 } 35024 function emitSnippetNode(hint, node, snippet) { 35025 switch (snippet.kind) { 35026 case 1 /* Placeholder */: 35027 emitPlaceholder(hint, node, snippet); 35028 break; 35029 case 0 /* TabStop */: 35030 emitTabStop(hint, node, snippet); 35031 break; 35032 } 35033 } 35034 function emitPlaceholder(hint, node, snippet) { 35035 nonEscapingWrite(`\${${snippet.order}:`); 35036 pipelineEmitWithHintWorker(hint, node, false); 35037 nonEscapingWrite(`}`); 35038 } 35039 function emitTabStop(hint, node, snippet) { 35040 Debug.assert( 35041 node.kind === 243 /* EmptyStatement */, 35042 `A tab stop cannot be attached to a node of kind ${Debug.formatSyntaxKind(node.kind)}.` 35043 ); 35044 Debug.assert( 35045 hint !== 5 /* EmbeddedStatement */, 35046 `A tab stop cannot be attached to an embedded statement.` 35047 ); 35048 nonEscapingWrite(`$${snippet.order}`); 35049 } 35050 function emitIdentifier(node) { 35051 const writeText = node.symbol ? writeSymbol : write; 35052 writeText(getTextOfNode2(node, false), node.symbol); 35053 emitList(node, node.typeArguments, 53776 /* TypeParameters */); 35054 } 35055 function emitPrivateIdentifier(node) { 35056 const writeText = node.symbol ? writeSymbol : write; 35057 writeText(getTextOfNode2(node, false), node.symbol); 35058 } 35059 function emitQualifiedName(node) { 35060 emitEntityName(node.left); 35061 writePunctuation("."); 35062 emit(node.right); 35063 } 35064 function emitEntityName(node) { 35065 if (node.kind === 79 /* Identifier */) { 35066 emitExpression(node); 35067 } else { 35068 emit(node); 35069 } 35070 } 35071 function emitComputedPropertyName(node) { 35072 writePunctuation("["); 35073 emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfComputedPropertyName); 35074 writePunctuation("]"); 35075 } 35076 function emitTypeParameter(node) { 35077 emitModifiers(node, node.modifiers); 35078 emit(node.name); 35079 if (node.constraint) { 35080 writeSpace(); 35081 writeKeyword("extends"); 35082 writeSpace(); 35083 emit(node.constraint); 35084 } 35085 if (node.default) { 35086 writeSpace(); 35087 writeOperator("="); 35088 writeSpace(); 35089 emit(node.default); 35090 } 35091 } 35092 function emitParameter(node) { 35093 emitDecoratorsAndModifiers(node, node.modifiers); 35094 emit(node.dotDotDotToken); 35095 emitNodeWithWriter(node.name, writeParameter); 35096 emit(node.questionToken); 35097 if (node.parent && node.parent.kind === 326 /* JSDocFunctionType */ && !node.name) { 35098 emit(node.type); 35099 } else { 35100 emitTypeAnnotation(node.type); 35101 } 35102 emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name ? node.name.end : node.modifiers ? node.modifiers.end : node.pos, node, parenthesizer.parenthesizeExpressionForDisallowedComma); 35103 } 35104 function emitDecorator(decorator) { 35105 writePunctuation("@"); 35106 emitExpression(decorator.expression, parenthesizer.parenthesizeLeftSideOfAccess); 35107 } 35108 function emitPropertySignature(node) { 35109 emitModifiers(node, node.modifiers); 35110 emitNodeWithWriter(node.name, writeProperty); 35111 emit(node.questionToken); 35112 emitTypeAnnotation(node.type); 35113 writeTrailingSemicolon(); 35114 } 35115 function emitPropertyDeclaration(node) { 35116 emitDecoratorsAndModifiers(node, node.modifiers); 35117 emit(node.name); 35118 emit(node.questionToken); 35119 emit(node.exclamationToken); 35120 emitTypeAnnotation(node.type); 35121 emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name.end, node); 35122 writeTrailingSemicolon(); 35123 } 35124 function emitAnnotationPropertyDeclaration(node) { 35125 emit(node.name); 35126 emitTypeAnnotation(node.type); 35127 emitInitializer(node.initializer, node.type ? node.type.end : node.name.end, node); 35128 writeTrailingSemicolon(); 35129 } 35130 function emitMethodSignature(node) { 35131 pushNameGenerationScope(node); 35132 emitModifiers(node, node.modifiers); 35133 emit(node.name); 35134 emit(node.questionToken); 35135 emitTypeParameters(node, node.typeParameters); 35136 emitParameters(node, node.parameters); 35137 emitTypeAnnotation(node.type); 35138 writeTrailingSemicolon(); 35139 popNameGenerationScope(node); 35140 } 35141 function emitMethodDeclaration(node) { 35142 emitDecoratorsAndModifiers(node, node.modifiers); 35143 emit(node.asteriskToken); 35144 emit(node.name); 35145 emit(node.questionToken); 35146 emitSignatureAndBody(node, emitSignatureHead); 35147 } 35148 function emitClassStaticBlockDeclaration(node) { 35149 writeKeyword("static"); 35150 emitBlockFunctionBody(node.body); 35151 } 35152 function emitConstructor(node) { 35153 emitModifiers(node, node.modifiers); 35154 writeKeyword("constructor"); 35155 emitSignatureAndBody(node, emitSignatureHead); 35156 } 35157 function emitAccessorDeclaration(node) { 35158 emitDecoratorsAndModifiers(node, node.modifiers); 35159 writeKeyword(node.kind === 177 /* GetAccessor */ ? "get" : "set"); 35160 writeSpace(); 35161 emit(node.name); 35162 emitSignatureAndBody(node, emitSignatureHead); 35163 } 35164 function emitCallSignature(node) { 35165 pushNameGenerationScope(node); 35166 emitTypeParameters(node, node.typeParameters); 35167 emitParameters(node, node.parameters); 35168 emitTypeAnnotation(node.type); 35169 writeTrailingSemicolon(); 35170 popNameGenerationScope(node); 35171 } 35172 function emitConstructSignature(node) { 35173 pushNameGenerationScope(node); 35174 writeKeyword("new"); 35175 writeSpace(); 35176 emitTypeParameters(node, node.typeParameters); 35177 emitParameters(node, node.parameters); 35178 emitTypeAnnotation(node.type); 35179 writeTrailingSemicolon(); 35180 popNameGenerationScope(node); 35181 } 35182 function emitIndexSignature(node) { 35183 emitModifiers(node, node.modifiers); 35184 emitParametersForIndexSignature(node, node.parameters); 35185 emitTypeAnnotation(node.type); 35186 writeTrailingSemicolon(); 35187 } 35188 function emitTemplateTypeSpan(node) { 35189 emit(node.type); 35190 emit(node.literal); 35191 } 35192 function emitSemicolonClassElement() { 35193 writeTrailingSemicolon(); 35194 } 35195 function emitTypePredicate(node) { 35196 if (node.assertsModifier) { 35197 emit(node.assertsModifier); 35198 writeSpace(); 35199 } 35200 emit(node.parameterName); 35201 if (node.type) { 35202 writeSpace(); 35203 writeKeyword("is"); 35204 writeSpace(); 35205 emit(node.type); 35206 } 35207 } 35208 function emitTypeReference(node) { 35209 emit(node.typeName); 35210 emitTypeArguments(node, node.typeArguments); 35211 } 35212 function emitFunctionType(node) { 35213 pushNameGenerationScope(node); 35214 emitTypeParameters(node, node.typeParameters); 35215 emitParametersForArrow(node, node.parameters); 35216 writeSpace(); 35217 writePunctuation("=>"); 35218 writeSpace(); 35219 emit(node.type); 35220 popNameGenerationScope(node); 35221 } 35222 function emitJSDocFunctionType(node) { 35223 writeKeyword("function"); 35224 emitParameters(node, node.parameters); 35225 writePunctuation(":"); 35226 emit(node.type); 35227 } 35228 function emitJSDocNullableType(node) { 35229 writePunctuation("?"); 35230 emit(node.type); 35231 } 35232 function emitJSDocNonNullableType(node) { 35233 writePunctuation("!"); 35234 emit(node.type); 35235 } 35236 function emitJSDocOptionalType(node) { 35237 emit(node.type); 35238 writePunctuation("="); 35239 } 35240 function emitConstructorType(node) { 35241 pushNameGenerationScope(node); 35242 emitModifiers(node, node.modifiers); 35243 writeKeyword("new"); 35244 writeSpace(); 35245 emitTypeParameters(node, node.typeParameters); 35246 emitParameters(node, node.parameters); 35247 writeSpace(); 35248 writePunctuation("=>"); 35249 writeSpace(); 35250 emit(node.type); 35251 popNameGenerationScope(node); 35252 } 35253 function emitTypeQuery(node) { 35254 writeKeyword("typeof"); 35255 writeSpace(); 35256 emit(node.exprName); 35257 emitTypeArguments(node, node.typeArguments); 35258 } 35259 function emitTypeLiteral(node) { 35260 writePunctuation("{"); 35261 const flags = getEmitFlags(node) & 1 /* SingleLine */ ? 768 /* SingleLineTypeLiteralMembers */ : 32897 /* MultiLineTypeLiteralMembers */; 35262 emitList(node, node.members, flags | 524288 /* NoSpaceIfEmpty */); 35263 writePunctuation("}"); 35264 } 35265 function emitArrayType(node) { 35266 emit(node.elementType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType); 35267 writePunctuation("["); 35268 writePunctuation("]"); 35269 } 35270 function emitRestOrJSDocVariadicType(node) { 35271 writePunctuation("..."); 35272 emit(node.type); 35273 } 35274 function emitTupleType(node) { 35275 emitTokenWithComment(22 /* OpenBracketToken */, node.pos, writePunctuation, node); 35276 const flags = getEmitFlags(node) & 1 /* SingleLine */ ? 528 /* SingleLineTupleTypeElements */ : 657 /* MultiLineTupleTypeElements */; 35277 emitList(node, node.elements, flags | 524288 /* NoSpaceIfEmpty */, parenthesizer.parenthesizeElementTypeOfTupleType); 35278 emitTokenWithComment(23 /* CloseBracketToken */, node.elements.end, writePunctuation, node); 35279 } 35280 function emitNamedTupleMember(node) { 35281 emit(node.dotDotDotToken); 35282 emit(node.name); 35283 emit(node.questionToken); 35284 emitTokenWithComment(58 /* ColonToken */, node.name.end, writePunctuation, node); 35285 writeSpace(); 35286 emit(node.type); 35287 } 35288 function emitOptionalType(node) { 35289 emit(node.type, parenthesizer.parenthesizeTypeOfOptionalType); 35290 writePunctuation("?"); 35291 } 35292 function emitUnionType(node) { 35293 emitList(node, node.types, 516 /* UnionTypeConstituents */, parenthesizer.parenthesizeConstituentTypeOfUnionType); 35294 } 35295 function emitIntersectionType(node) { 35296 emitList(node, node.types, 520 /* IntersectionTypeConstituents */, parenthesizer.parenthesizeConstituentTypeOfIntersectionType); 35297 } 35298 function emitConditionalType(node) { 35299 emit(node.checkType, parenthesizer.parenthesizeCheckTypeOfConditionalType); 35300 writeSpace(); 35301 writeKeyword("extends"); 35302 writeSpace(); 35303 emit(node.extendsType, parenthesizer.parenthesizeExtendsTypeOfConditionalType); 35304 writeSpace(); 35305 writePunctuation("?"); 35306 writeSpace(); 35307 emit(node.trueType); 35308 writeSpace(); 35309 writePunctuation(":"); 35310 writeSpace(); 35311 emit(node.falseType); 35312 } 35313 function emitInferType(node) { 35314 writeKeyword("infer"); 35315 writeSpace(); 35316 emit(node.typeParameter); 35317 } 35318 function emitParenthesizedType(node) { 35319 writePunctuation("("); 35320 emit(node.type); 35321 writePunctuation(")"); 35322 } 35323 function emitThisType() { 35324 writeKeyword("this"); 35325 } 35326 function emitTypeOperator(node) { 35327 writeTokenText(node.operator, writeKeyword); 35328 writeSpace(); 35329 const parenthesizerRule = node.operator === 147 /* ReadonlyKeyword */ ? parenthesizer.parenthesizeOperandOfReadonlyTypeOperator : parenthesizer.parenthesizeOperandOfTypeOperator; 35330 emit(node.type, parenthesizerRule); 35331 } 35332 function emitIndexedAccessType(node) { 35333 emit(node.objectType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType); 35334 writePunctuation("["); 35335 emit(node.indexType); 35336 writePunctuation("]"); 35337 } 35338 function emitMappedType(node) { 35339 const emitFlags = getEmitFlags(node); 35340 writePunctuation("{"); 35341 if (emitFlags & 1 /* SingleLine */) { 35342 writeSpace(); 35343 } else { 35344 writeLine(); 35345 increaseIndent(); 35346 } 35347 if (node.readonlyToken) { 35348 emit(node.readonlyToken); 35349 if (node.readonlyToken.kind !== 147 /* ReadonlyKeyword */) { 35350 writeKeyword("readonly"); 35351 } 35352 writeSpace(); 35353 } 35354 writePunctuation("["); 35355 pipelineEmit(3 /* MappedTypeParameter */, node.typeParameter); 35356 if (node.nameType) { 35357 writeSpace(); 35358 writeKeyword("as"); 35359 writeSpace(); 35360 emit(node.nameType); 35361 } 35362 writePunctuation("]"); 35363 if (node.questionToken) { 35364 emit(node.questionToken); 35365 if (node.questionToken.kind !== 57 /* QuestionToken */) { 35366 writePunctuation("?"); 35367 } 35368 } 35369 writePunctuation(":"); 35370 writeSpace(); 35371 emit(node.type); 35372 writeTrailingSemicolon(); 35373 if (emitFlags & 1 /* SingleLine */) { 35374 writeSpace(); 35375 } else { 35376 writeLine(); 35377 decreaseIndent(); 35378 } 35379 emitList(node, node.members, 2 /* PreserveLines */); 35380 writePunctuation("}"); 35381 } 35382 function emitLiteralType(node) { 35383 emitExpression(node.literal); 35384 } 35385 function emitTemplateType(node) { 35386 emit(node.head); 35387 emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */); 35388 } 35389 function emitImportTypeNode(node) { 35390 if (node.isTypeOf) { 35391 writeKeyword("typeof"); 35392 writeSpace(); 35393 } 35394 writeKeyword("import"); 35395 writePunctuation("("); 35396 emit(node.argument); 35397 if (node.assertions) { 35398 writePunctuation(","); 35399 writeSpace(); 35400 writePunctuation("{"); 35401 writeSpace(); 35402 writeKeyword("assert"); 35403 writePunctuation(":"); 35404 writeSpace(); 35405 const elements = node.assertions.assertClause.elements; 35406 emitList(node.assertions.assertClause, elements, 526226 /* ImportClauseEntries */); 35407 writeSpace(); 35408 writePunctuation("}"); 35409 } 35410 writePunctuation(")"); 35411 if (node.qualifier) { 35412 writePunctuation("."); 35413 emit(node.qualifier); 35414 } 35415 emitTypeArguments(node, node.typeArguments); 35416 } 35417 function emitObjectBindingPattern(node) { 35418 writePunctuation("{"); 35419 emitList(node, node.elements, 525136 /* ObjectBindingPatternElements */); 35420 writePunctuation("}"); 35421 } 35422 function emitArrayBindingPattern(node) { 35423 writePunctuation("["); 35424 emitList(node, node.elements, 524880 /* ArrayBindingPatternElements */); 35425 writePunctuation("]"); 35426 } 35427 function emitBindingElement(node) { 35428 emit(node.dotDotDotToken); 35429 if (node.propertyName) { 35430 emit(node.propertyName); 35431 writePunctuation(":"); 35432 writeSpace(); 35433 } 35434 emit(node.name); 35435 emitInitializer(node.initializer, node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); 35436 } 35437 function emitArrayLiteralExpression(node) { 35438 const elements = node.elements; 35439 const preferNewLine = node.multiLine ? 65536 /* PreferNewLine */ : 0 /* None */; 35440 emitExpressionList(node, elements, 8914 /* ArrayLiteralExpressionElements */ | preferNewLine, parenthesizer.parenthesizeExpressionForDisallowedComma); 35441 } 35442 function emitObjectLiteralExpression(node) { 35443 forEach(node.properties, generateMemberNames); 35444 const indentedFlag = getEmitFlags(node) & 65536 /* Indented */; 35445 if (indentedFlag) { 35446 increaseIndent(); 35447 } 35448 const preferNewLine = node.multiLine ? 65536 /* PreferNewLine */ : 0 /* None */; 35449 const allowTrailingComma = currentSourceFile && currentSourceFile.languageVersion >= 1 /* ES5 */ && !isJsonSourceFile(currentSourceFile) ? 64 /* AllowTrailingComma */ : 0 /* None */; 35450 emitList(node, node.properties, 526226 /* ObjectLiteralExpressionProperties */ | allowTrailingComma | preferNewLine); 35451 if (indentedFlag) { 35452 decreaseIndent(); 35453 } 35454 } 35455 function emitPropertyAccessExpression(node) { 35456 emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); 35457 const token = node.questionDotToken || setTextRangePosEnd(factory.createToken(24 /* DotToken */), node.expression.end, node.name.pos); 35458 const linesBeforeDot = getLinesBetweenNodes(node, node.expression, token); 35459 const linesAfterDot = getLinesBetweenNodes(node, token, node.name); 35460 writeLinesAndIndent(linesBeforeDot, false); 35461 const shouldEmitDotDot = token.kind !== 28 /* QuestionDotToken */ && mayNeedDotDotForPropertyAccess(node.expression) && !writer.hasTrailingComment() && !writer.hasTrailingWhitespace(); 35462 if (shouldEmitDotDot) { 35463 writePunctuation("."); 35464 } 35465 if (node.questionDotToken) { 35466 emit(token); 35467 } else { 35468 emitTokenWithComment(token.kind, node.expression.end, writePunctuation, node); 35469 } 35470 writeLinesAndIndent(linesAfterDot, false); 35471 emit(node.name); 35472 decreaseIndentIf(linesBeforeDot, linesAfterDot); 35473 } 35474 function mayNeedDotDotForPropertyAccess(expression) { 35475 expression = skipPartiallyEmittedExpressions(expression); 35476 if (isNumericLiteral(expression)) { 35477 const text = getLiteralTextOfNode(expression, true, false); 35478 return !expression.numericLiteralFlags && !stringContains(text, tokenToString(24 /* DotToken */)); 35479 } else if (isAccessExpression(expression)) { 35480 const constantValue = getConstantValue(expression); 35481 return typeof constantValue === "number" && isFinite(constantValue) && Math.floor(constantValue) === constantValue; 35482 } 35483 } 35484 function emitElementAccessExpression(node) { 35485 emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); 35486 emit(node.questionDotToken); 35487 emitTokenWithComment(22 /* OpenBracketToken */, node.expression.end, writePunctuation, node); 35488 emitExpression(node.argumentExpression); 35489 emitTokenWithComment(23 /* CloseBracketToken */, node.argumentExpression.end, writePunctuation, node); 35490 } 35491 function emitCallExpression(node) { 35492 const indirectCall = getEmitFlags(node) & 536870912 /* IndirectCall */; 35493 if (indirectCall) { 35494 writePunctuation("("); 35495 writeLiteral("0"); 35496 writePunctuation(","); 35497 writeSpace(); 35498 } 35499 emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); 35500 if (indirectCall) { 35501 writePunctuation(")"); 35502 } 35503 emit(node.questionDotToken); 35504 emitTypeArguments(node, node.typeArguments); 35505 emitExpressionList(node, node.arguments, 2576 /* CallExpressionArguments */, parenthesizer.parenthesizeExpressionForDisallowedComma); 35506 } 35507 function emitNewExpression(node) { 35508 emitTokenWithComment(104 /* NewKeyword */, node.pos, writeKeyword, node); 35509 writeSpace(); 35510 emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfNew); 35511 emitTypeArguments(node, node.typeArguments); 35512 emitExpressionList(node, node.arguments, 18960 /* NewExpressionArguments */, parenthesizer.parenthesizeExpressionForDisallowedComma); 35513 } 35514 function emitTaggedTemplateExpression(node) { 35515 const indirectCall = getEmitFlags(node) & 536870912 /* IndirectCall */; 35516 if (indirectCall) { 35517 writePunctuation("("); 35518 writeLiteral("0"); 35519 writePunctuation(","); 35520 writeSpace(); 35521 } 35522 emitExpression(node.tag, parenthesizer.parenthesizeLeftSideOfAccess); 35523 if (indirectCall) { 35524 writePunctuation(")"); 35525 } 35526 emitTypeArguments(node, node.typeArguments); 35527 writeSpace(); 35528 emitExpression(node.template); 35529 } 35530 function emitTypeAssertionExpression(node) { 35531 writePunctuation("<"); 35532 emit(node.type); 35533 writePunctuation(">"); 35534 emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); 35535 } 35536 function emitParenthesizedExpression(node) { 35537 const openParenPos = emitTokenWithComment(20 /* OpenParenToken */, node.pos, writePunctuation, node); 35538 const indented = writeLineSeparatorsAndIndentBefore(node.expression, node); 35539 emitExpression(node.expression, void 0); 35540 writeLineSeparatorsAfter(node.expression, node); 35541 decreaseIndentIf(indented); 35542 emitTokenWithComment(21 /* CloseParenToken */, node.expression ? node.expression.end : openParenPos, writePunctuation, node); 35543 } 35544 function emitFunctionExpression(node) { 35545 generateNameIfNeeded(node.name); 35546 emitFunctionDeclarationOrExpression(node); 35547 } 35548 function emitArrowFunction(node) { 35549 emitModifiers(node, node.modifiers); 35550 emitSignatureAndBody(node, emitArrowFunctionHead); 35551 } 35552 function emitArrowFunctionHead(node) { 35553 emitTypeParameters(node, node.typeParameters); 35554 emitParametersForArrow(node, node.parameters); 35555 emitTypeAnnotation(node.type); 35556 writeSpace(); 35557 emit(node.equalsGreaterThanToken); 35558 } 35559 function emitDeleteExpression(node) { 35560 emitTokenWithComment(90 /* DeleteKeyword */, node.pos, writeKeyword, node); 35561 writeSpace(); 35562 emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); 35563 } 35564 function emitTypeOfExpression(node) { 35565 emitTokenWithComment(113 /* TypeOfKeyword */, node.pos, writeKeyword, node); 35566 writeSpace(); 35567 emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); 35568 } 35569 function emitVoidExpression(node) { 35570 emitTokenWithComment(115 /* VoidKeyword */, node.pos, writeKeyword, node); 35571 writeSpace(); 35572 emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); 35573 } 35574 function emitAwaitExpression(node) { 35575 emitTokenWithComment(134 /* AwaitKeyword */, node.pos, writeKeyword, node); 35576 writeSpace(); 35577 emitExpression(node.expression, parenthesizer.parenthesizeOperandOfPrefixUnary); 35578 } 35579 function emitPrefixUnaryExpression(node) { 35580 writeTokenText(node.operator, writeOperator); 35581 if (shouldEmitWhitespaceBeforeOperand(node)) { 35582 writeSpace(); 35583 } 35584 emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPrefixUnary); 35585 } 35586 function shouldEmitWhitespaceBeforeOperand(node) { 35587 const operand = node.operand; 35588 return operand.kind === 225 /* PrefixUnaryExpression */ && (node.operator === 39 /* PlusToken */ && (operand.operator === 39 /* PlusToken */ || operand.operator === 45 /* PlusPlusToken */) || node.operator === 40 /* MinusToken */ && (operand.operator === 40 /* MinusToken */ || operand.operator === 46 /* MinusMinusToken */)); 35589 } 35590 function emitPostfixUnaryExpression(node) { 35591 emitExpression(node.operand, parenthesizer.parenthesizeOperandOfPostfixUnary); 35592 writeTokenText(node.operator, writeOperator); 35593 } 35594 function createEmitBinaryExpression() { 35595 return createBinaryExpressionTrampoline(onEnter, onLeft, onOperator, onRight, onExit, void 0); 35596 function onEnter(node, state) { 35597 if (state) { 35598 state.stackIndex++; 35599 state.preserveSourceNewlinesStack[state.stackIndex] = preserveSourceNewlines; 35600 state.containerPosStack[state.stackIndex] = containerPos; 35601 state.containerEndStack[state.stackIndex] = containerEnd; 35602 state.declarationListContainerEndStack[state.stackIndex] = declarationListContainerEnd; 35603 const emitComments2 = state.shouldEmitCommentsStack[state.stackIndex] = shouldEmitComments(node); 35604 const emitSourceMaps = state.shouldEmitSourceMapsStack[state.stackIndex] = shouldEmitSourceMaps(node); 35605 onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(node); 35606 if (emitComments2) 35607 emitCommentsBeforeNode(node); 35608 if (emitSourceMaps) 35609 emitSourceMapsBeforeNode(node); 35610 beforeEmitNode(node); 35611 } else { 35612 state = { 35613 stackIndex: 0, 35614 preserveSourceNewlinesStack: [void 0], 35615 containerPosStack: [-1], 35616 containerEndStack: [-1], 35617 declarationListContainerEndStack: [-1], 35618 shouldEmitCommentsStack: [false], 35619 shouldEmitSourceMapsStack: [false] 35620 }; 35621 } 35622 return state; 35623 } 35624 function onLeft(next, _workArea, parent) { 35625 return maybeEmitExpression(next, parent, "left"); 35626 } 35627 function onOperator(operatorToken, _state, node) { 35628 const isCommaOperator = operatorToken.kind !== 27 /* CommaToken */; 35629 const linesBeforeOperator = getLinesBetweenNodes(node, node.left, operatorToken); 35630 const linesAfterOperator = getLinesBetweenNodes(node, operatorToken, node.right); 35631 writeLinesAndIndent(linesBeforeOperator, isCommaOperator); 35632 emitLeadingCommentsOfPosition(operatorToken.pos); 35633 writeTokenNode(operatorToken, operatorToken.kind === 102 /* InKeyword */ ? writeKeyword : writeOperator); 35634 emitTrailingCommentsOfPosition(operatorToken.end, true); 35635 writeLinesAndIndent(linesAfterOperator, true); 35636 } 35637 function onRight(next, _workArea, parent) { 35638 return maybeEmitExpression(next, parent, "right"); 35639 } 35640 function onExit(node, state) { 35641 const linesBeforeOperator = getLinesBetweenNodes(node, node.left, node.operatorToken); 35642 const linesAfterOperator = getLinesBetweenNodes(node, node.operatorToken, node.right); 35643 decreaseIndentIf(linesBeforeOperator, linesAfterOperator); 35644 if (state.stackIndex > 0) { 35645 const savedPreserveSourceNewlines = state.preserveSourceNewlinesStack[state.stackIndex]; 35646 const savedContainerPos = state.containerPosStack[state.stackIndex]; 35647 const savedContainerEnd = state.containerEndStack[state.stackIndex]; 35648 const savedDeclarationListContainerEnd = state.declarationListContainerEndStack[state.stackIndex]; 35649 const shouldEmitComments2 = state.shouldEmitCommentsStack[state.stackIndex]; 35650 const shouldEmitSourceMaps2 = state.shouldEmitSourceMapsStack[state.stackIndex]; 35651 afterEmitNode(savedPreserveSourceNewlines); 35652 if (shouldEmitSourceMaps2) 35653 emitSourceMapsAfterNode(node); 35654 if (shouldEmitComments2) 35655 emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); 35656 onAfterEmitNode == null ? void 0 : onAfterEmitNode(node); 35657 state.stackIndex--; 35658 } 35659 } 35660 function maybeEmitExpression(next, parent, side) { 35661 const parenthesizerRule = side === "left" ? parenthesizer.getParenthesizeLeftSideOfBinaryForOperator(parent.operatorToken.kind) : parenthesizer.getParenthesizeRightSideOfBinaryForOperator(parent.operatorToken.kind); 35662 let pipelinePhase = getPipelinePhase(0 /* Notification */, 1 /* Expression */, next); 35663 if (pipelinePhase === pipelineEmitWithSubstitution) { 35664 Debug.assertIsDefined(lastSubstitution); 35665 next = parenthesizerRule(cast(lastSubstitution, isExpression)); 35666 pipelinePhase = getNextPipelinePhase(1 /* Substitution */, 1 /* Expression */, next); 35667 lastSubstitution = void 0; 35668 } 35669 if (pipelinePhase === pipelineEmitWithComments || pipelinePhase === pipelineEmitWithSourceMaps || pipelinePhase === pipelineEmitWithHint) { 35670 if (isBinaryExpression(next)) { 35671 return next; 35672 } 35673 } 35674 currentParenthesizerRule = parenthesizerRule; 35675 pipelinePhase(1 /* Expression */, next); 35676 } 35677 } 35678 function emitConditionalExpression(node) { 35679 const linesBeforeQuestion = getLinesBetweenNodes(node, node.condition, node.questionToken); 35680 const linesAfterQuestion = getLinesBetweenNodes(node, node.questionToken, node.whenTrue); 35681 const linesBeforeColon = getLinesBetweenNodes(node, node.whenTrue, node.colonToken); 35682 const linesAfterColon = getLinesBetweenNodes(node, node.colonToken, node.whenFalse); 35683 emitExpression(node.condition, parenthesizer.parenthesizeConditionOfConditionalExpression); 35684 writeLinesAndIndent(linesBeforeQuestion, true); 35685 emit(node.questionToken); 35686 writeLinesAndIndent(linesAfterQuestion, true); 35687 emitExpression(node.whenTrue, parenthesizer.parenthesizeBranchOfConditionalExpression); 35688 decreaseIndentIf(linesBeforeQuestion, linesAfterQuestion); 35689 writeLinesAndIndent(linesBeforeColon, true); 35690 emit(node.colonToken); 35691 writeLinesAndIndent(linesAfterColon, true); 35692 emitExpression(node.whenFalse, parenthesizer.parenthesizeBranchOfConditionalExpression); 35693 decreaseIndentIf(linesBeforeColon, linesAfterColon); 35694 } 35695 function emitTemplateExpression(node) { 35696 emit(node.head); 35697 emitList(node, node.templateSpans, 262144 /* TemplateExpressionSpans */); 35698 } 35699 function emitYieldExpression(node) { 35700 emitTokenWithComment(126 /* YieldKeyword */, node.pos, writeKeyword, node); 35701 emit(node.asteriskToken); 35702 emitExpressionWithLeadingSpace(node.expression && parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsiAndDisallowedComma); 35703 } 35704 function emitSpreadElement(node) { 35705 emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node); 35706 emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); 35707 } 35708 function emitClassExpression(node) { 35709 generateNameIfNeeded(node.name); 35710 emitClassOrStructDeclarationOrExpression(node); 35711 } 35712 function emitExpressionWithTypeArguments(node) { 35713 emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); 35714 emitTypeArguments(node, node.typeArguments); 35715 } 35716 function emitAsExpression(node) { 35717 emitExpression(node.expression, void 0); 35718 if (node.type) { 35719 writeSpace(); 35720 writeKeyword("as"); 35721 writeSpace(); 35722 emit(node.type); 35723 } 35724 } 35725 function emitNonNullExpression(node) { 35726 emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess); 35727 writeOperator("!"); 35728 } 35729 function emitSatisfiesExpression(node) { 35730 emitExpression(node.expression, void 0); 35731 if (node.type) { 35732 writeSpace(); 35733 writeKeyword("satisfies"); 35734 writeSpace(); 35735 emit(node.type); 35736 } 35737 } 35738 function emitMetaProperty(node) { 35739 writeToken(node.keywordToken, node.pos, writePunctuation); 35740 writePunctuation("."); 35741 emit(node.name); 35742 } 35743 function emitTemplateSpan(node) { 35744 emitExpression(node.expression); 35745 emit(node.literal); 35746 } 35747 function emitBlock(node) { 35748 emitBlockStatements(node, !node.multiLine && isEmptyBlock(node)); 35749 } 35750 function emitBlockStatements(node, forceSingleLine) { 35751 emitTokenWithComment(18 /* OpenBraceToken */, node.pos, writePunctuation, node); 35752 const format = forceSingleLine || getEmitFlags(node) & 1 /* SingleLine */ ? 768 /* SingleLineBlockStatements */ : 129 /* MultiLineBlockStatements */; 35753 emitList(node, node.statements, format); 35754 emitTokenWithComment(19 /* CloseBraceToken */, node.statements.end, writePunctuation, node, !!(format & 1 /* MultiLine */)); 35755 } 35756 function emitVariableStatement(node) { 35757 emitModifiers(node, node.modifiers); 35758 emit(node.declarationList); 35759 writeTrailingSemicolon(); 35760 } 35761 function emitEmptyStatement(isEmbeddedStatement) { 35762 if (isEmbeddedStatement) { 35763 writePunctuation(";"); 35764 } else { 35765 writeTrailingSemicolon(); 35766 } 35767 } 35768 function emitExpressionStatement(node) { 35769 emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfExpressionStatement); 35770 if (!currentSourceFile || !isJsonSourceFile(currentSourceFile) || nodeIsSynthesized(node.expression)) { 35771 writeTrailingSemicolon(); 35772 } 35773 } 35774 function emitIfStatement(node) { 35775 const openParenPos = emitTokenWithComment(100 /* IfKeyword */, node.pos, writeKeyword, node); 35776 writeSpace(); 35777 emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); 35778 emitExpression(node.expression); 35779 emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); 35780 emitEmbeddedStatement(node, node.thenStatement); 35781 if (node.elseStatement) { 35782 writeLineOrSpace(node, node.thenStatement, node.elseStatement); 35783 emitTokenWithComment(92 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); 35784 if (node.elseStatement.kind === 246 /* IfStatement */) { 35785 writeSpace(); 35786 emit(node.elseStatement); 35787 } else { 35788 emitEmbeddedStatement(node, node.elseStatement); 35789 } 35790 } 35791 } 35792 function emitWhileClause(node, startPos) { 35793 const openParenPos = emitTokenWithComment(116 /* WhileKeyword */, startPos, writeKeyword, node); 35794 writeSpace(); 35795 emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); 35796 emitExpression(node.expression); 35797 emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); 35798 } 35799 function emitDoStatement(node) { 35800 emitTokenWithComment(91 /* DoKeyword */, node.pos, writeKeyword, node); 35801 emitEmbeddedStatement(node, node.statement); 35802 if (isBlock(node.statement) && !preserveSourceNewlines) { 35803 writeSpace(); 35804 } else { 35805 writeLineOrSpace(node, node.statement, node.expression); 35806 } 35807 emitWhileClause(node, node.statement.end); 35808 writeTrailingSemicolon(); 35809 } 35810 function emitWhileStatement(node) { 35811 emitWhileClause(node, node.pos); 35812 emitEmbeddedStatement(node, node.statement); 35813 } 35814 function emitForStatement(node) { 35815 const openParenPos = emitTokenWithComment(98 /* ForKeyword */, node.pos, writeKeyword, node); 35816 writeSpace(); 35817 let pos = emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); 35818 emitForBinding(node.initializer); 35819 pos = emitTokenWithComment(26 /* SemicolonToken */, node.initializer ? node.initializer.end : pos, writePunctuation, node); 35820 emitExpressionWithLeadingSpace(node.condition); 35821 pos = emitTokenWithComment(26 /* SemicolonToken */, node.condition ? node.condition.end : pos, writePunctuation, node); 35822 emitExpressionWithLeadingSpace(node.incrementor); 35823 emitTokenWithComment(21 /* CloseParenToken */, node.incrementor ? node.incrementor.end : pos, writePunctuation, node); 35824 emitEmbeddedStatement(node, node.statement); 35825 } 35826 function emitForInStatement(node) { 35827 const openParenPos = emitTokenWithComment(98 /* ForKeyword */, node.pos, writeKeyword, node); 35828 writeSpace(); 35829 emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); 35830 emitForBinding(node.initializer); 35831 writeSpace(); 35832 emitTokenWithComment(102 /* InKeyword */, node.initializer.end, writeKeyword, node); 35833 writeSpace(); 35834 emitExpression(node.expression); 35835 emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); 35836 emitEmbeddedStatement(node, node.statement); 35837 } 35838 function emitForOfStatement(node) { 35839 const openParenPos = emitTokenWithComment(98 /* ForKeyword */, node.pos, writeKeyword, node); 35840 writeSpace(); 35841 emitWithTrailingSpace(node.awaitModifier); 35842 emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); 35843 emitForBinding(node.initializer); 35844 writeSpace(); 35845 emitTokenWithComment(164 /* OfKeyword */, node.initializer.end, writeKeyword, node); 35846 writeSpace(); 35847 emitExpression(node.expression); 35848 emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); 35849 emitEmbeddedStatement(node, node.statement); 35850 } 35851 function emitForBinding(node) { 35852 if (node !== void 0) { 35853 if (node.kind === 262 /* VariableDeclarationList */) { 35854 emit(node); 35855 } else { 35856 emitExpression(node); 35857 } 35858 } 35859 } 35860 function emitContinueStatement(node) { 35861 emitTokenWithComment(87 /* ContinueKeyword */, node.pos, writeKeyword, node); 35862 emitWithLeadingSpace(node.label); 35863 writeTrailingSemicolon(); 35864 } 35865 function emitBreakStatement(node) { 35866 emitTokenWithComment(81 /* BreakKeyword */, node.pos, writeKeyword, node); 35867 emitWithLeadingSpace(node.label); 35868 writeTrailingSemicolon(); 35869 } 35870 function emitTokenWithComment(token, pos, writer2, contextNode, indentLeading) { 35871 const node = getParseTreeNode(contextNode); 35872 const isSimilarNode = node && node.kind === contextNode.kind; 35873 const startPos = pos; 35874 if (isSimilarNode && currentSourceFile) { 35875 pos = skipTrivia(currentSourceFile.text, pos); 35876 } 35877 if (isSimilarNode && contextNode.pos !== startPos) { 35878 const needsIndent = indentLeading && currentSourceFile && !positionsAreOnSameLine(startPos, pos, currentSourceFile); 35879 if (needsIndent) { 35880 increaseIndent(); 35881 } 35882 emitLeadingCommentsOfPosition(startPos); 35883 if (needsIndent) { 35884 decreaseIndent(); 35885 } 35886 } 35887 pos = writeTokenText(token, writer2, pos); 35888 if (isSimilarNode && contextNode.end !== pos) { 35889 const isJsxExprContext = contextNode.kind === 297 /* JsxExpression */; 35890 emitTrailingCommentsOfPosition(pos, !isJsxExprContext, isJsxExprContext); 35891 } 35892 return pos; 35893 } 35894 function commentWillEmitNewLine(node) { 35895 return node.kind === 2 /* SingleLineCommentTrivia */ || !!node.hasTrailingNewLine; 35896 } 35897 function willEmitLeadingNewLine(node) { 35898 if (!currentSourceFile) 35899 return false; 35900 if (some(getLeadingCommentRanges(currentSourceFile.text, node.pos), commentWillEmitNewLine)) 35901 return true; 35902 if (some(getSyntheticLeadingComments(node), commentWillEmitNewLine)) 35903 return true; 35904 if (isPartiallyEmittedExpression(node)) { 35905 if (node.pos !== node.expression.pos) { 35906 if (some(getTrailingCommentRanges(currentSourceFile.text, node.expression.pos), commentWillEmitNewLine)) 35907 return true; 35908 } 35909 return willEmitLeadingNewLine(node.expression); 35910 } 35911 return false; 35912 } 35913 function parenthesizeExpressionForNoAsi(node) { 35914 if (!commentsDisabled && isPartiallyEmittedExpression(node) && willEmitLeadingNewLine(node)) { 35915 const parseNode = getParseTreeNode(node); 35916 if (parseNode && isParenthesizedExpression(parseNode)) { 35917 const parens = factory.createParenthesizedExpression(node.expression); 35918 setOriginalNode(parens, node); 35919 setTextRange(parens, parseNode); 35920 return parens; 35921 } 35922 return factory.createParenthesizedExpression(node); 35923 } 35924 return node; 35925 } 35926 function parenthesizeExpressionForNoAsiAndDisallowedComma(node) { 35927 return parenthesizeExpressionForNoAsi(parenthesizer.parenthesizeExpressionForDisallowedComma(node)); 35928 } 35929 function emitReturnStatement(node) { 35930 emitTokenWithComment(106 /* ReturnKeyword */, node.pos, writeKeyword, node); 35931 emitExpressionWithLeadingSpace(node.expression && parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsi); 35932 writeTrailingSemicolon(); 35933 } 35934 function emitWithStatement(node) { 35935 const openParenPos = emitTokenWithComment(117 /* WithKeyword */, node.pos, writeKeyword, node); 35936 writeSpace(); 35937 emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); 35938 emitExpression(node.expression); 35939 emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); 35940 emitEmbeddedStatement(node, node.statement); 35941 } 35942 function emitSwitchStatement(node) { 35943 const openParenPos = emitTokenWithComment(108 /* SwitchKeyword */, node.pos, writeKeyword, node); 35944 writeSpace(); 35945 emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); 35946 emitExpression(node.expression); 35947 emitTokenWithComment(21 /* CloseParenToken */, node.expression.end, writePunctuation, node); 35948 writeSpace(); 35949 emit(node.caseBlock); 35950 } 35951 function emitLabeledStatement(node) { 35952 emit(node.label); 35953 emitTokenWithComment(58 /* ColonToken */, node.label.end, writePunctuation, node); 35954 writeSpace(); 35955 emit(node.statement); 35956 } 35957 function emitThrowStatement(node) { 35958 emitTokenWithComment(110 /* ThrowKeyword */, node.pos, writeKeyword, node); 35959 emitExpressionWithLeadingSpace(parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsi); 35960 writeTrailingSemicolon(); 35961 } 35962 function emitTryStatement(node) { 35963 emitTokenWithComment(112 /* TryKeyword */, node.pos, writeKeyword, node); 35964 writeSpace(); 35965 emit(node.tryBlock); 35966 if (node.catchClause) { 35967 writeLineOrSpace(node, node.tryBlock, node.catchClause); 35968 emit(node.catchClause); 35969 } 35970 if (node.finallyBlock) { 35971 writeLineOrSpace(node, node.catchClause || node.tryBlock, node.finallyBlock); 35972 emitTokenWithComment(97 /* FinallyKeyword */, (node.catchClause || node.tryBlock).end, writeKeyword, node); 35973 writeSpace(); 35974 emit(node.finallyBlock); 35975 } 35976 } 35977 function emitDebuggerStatement(node) { 35978 writeToken(88 /* DebuggerKeyword */, node.pos, writeKeyword); 35979 writeTrailingSemicolon(); 35980 } 35981 function emitVariableDeclaration(node) { 35982 var _a2, _b, _c, _d, _e; 35983 emit(node.name); 35984 emit(node.exclamationToken); 35985 emitTypeAnnotation(node.type); 35986 emitInitializer(node.initializer, (_e = (_d = (_a2 = node.type) == null ? void 0 : _a2.end) != null ? _d : (_c = (_b = node.name.emitNode) == null ? void 0 : _b.typeNode) == null ? void 0 : _c.end) != null ? _e : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); 35987 } 35988 function emitVariableDeclarationList(node) { 35989 writeKeyword(isLet(node) ? "let" : isVarConst(node) ? "const" : "var"); 35990 writeSpace(); 35991 emitList(node, node.declarations, 528 /* VariableDeclarationList */); 35992 } 35993 function emitFunctionDeclaration(node) { 35994 emitFunctionDeclarationOrExpression(node); 35995 } 35996 function emitFunctionDeclarationOrExpression(node) { 35997 if (isFunctionDeclaration(node) && (isInEtsFile(node) || isInEtsFileWithOriginal(node))) { 35998 emitDecorators(node, node.illegalDecorators); 35999 getSourceFileOfNode; 36000 } 36001 emitModifiers(node, factory.createNodeArray(getModifiers(node))); 36002 writeKeyword("function"); 36003 emit(node.asteriskToken); 36004 writeSpace(); 36005 emitIdentifierName(node.name); 36006 emitSignatureAndBody(node, emitSignatureHead); 36007 } 36008 function emitSignatureAndBody(node, emitSignatureHead2) { 36009 const body = node.body; 36010 if (body) { 36011 if (isBlock(body)) { 36012 const indentedFlag = getEmitFlags(node) & 65536 /* Indented */; 36013 if (indentedFlag) { 36014 increaseIndent(); 36015 } 36016 pushNameGenerationScope(node); 36017 forEach(node.parameters, generateNames); 36018 generateNames(node.body); 36019 emitSignatureHead2(node); 36020 emitBlockFunctionBody(body); 36021 popNameGenerationScope(node); 36022 if (indentedFlag) { 36023 decreaseIndent(); 36024 } 36025 } else { 36026 emitSignatureHead2(node); 36027 writeSpace(); 36028 emitExpression(body, parenthesizer.parenthesizeConciseBodyOfArrowFunction); 36029 } 36030 } else { 36031 emitSignatureHead2(node); 36032 writeTrailingSemicolon(); 36033 } 36034 } 36035 function emitSignatureHead(node) { 36036 emitTypeParameters(node, node.typeParameters); 36037 emitParameters(node, node.parameters); 36038 emitTypeAnnotation(node.type); 36039 } 36040 function shouldEmitBlockFunctionBodyOnSingleLine(body) { 36041 if (getEmitFlags(body) & 1 /* SingleLine */) { 36042 return true; 36043 } 36044 if (body.multiLine) { 36045 return false; 36046 } 36047 if (!nodeIsSynthesized(body) && currentSourceFile && !rangeIsOnSingleLine(body, currentSourceFile)) { 36048 return false; 36049 } 36050 if (getLeadingLineTerminatorCount(body, firstOrUndefined(body.statements), 2 /* PreserveLines */) || getClosingLineTerminatorCount(body, lastOrUndefined(body.statements), 2 /* PreserveLines */, body.statements)) { 36051 return false; 36052 } 36053 let previousStatement; 36054 for (const statement of body.statements) { 36055 if (getSeparatingLineTerminatorCount(previousStatement, statement, 2 /* PreserveLines */) > 0) { 36056 return false; 36057 } 36058 previousStatement = statement; 36059 } 36060 return true; 36061 } 36062 function emitBlockFunctionBody(body) { 36063 onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(body); 36064 writeSpace(); 36065 writePunctuation("{"); 36066 increaseIndent(); 36067 const emitBlockFunctionBody2 = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine : emitBlockFunctionBodyWorker; 36068 emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody2); 36069 decreaseIndent(); 36070 writeToken(19 /* CloseBraceToken */, body.statements.end, writePunctuation, body); 36071 onAfterEmitNode == null ? void 0 : onAfterEmitNode(body); 36072 } 36073 function emitBlockFunctionBodyOnSingleLine(body) { 36074 emitBlockFunctionBodyWorker(body, true); 36075 } 36076 function emitBlockFunctionBodyWorker(body, emitBlockFunctionBodyOnSingleLine2) { 36077 const statementOffset = emitPrologueDirectives(body.statements); 36078 const pos = writer.getTextPos(); 36079 emitHelpers(body); 36080 if (statementOffset === 0 && pos === writer.getTextPos() && emitBlockFunctionBodyOnSingleLine2) { 36081 decreaseIndent(); 36082 emitList(body, body.statements, 768 /* SingleLineFunctionBodyStatements */); 36083 increaseIndent(); 36084 } else { 36085 emitList(body, body.statements, 1 /* MultiLineFunctionBodyStatements */, void 0, statementOffset); 36086 } 36087 } 36088 function emitClassOrStructDeclaration(node) { 36089 emitClassOrStructDeclarationOrExpression(node); 36090 } 36091 function emitClassOrStructDeclarationOrExpression(node) { 36092 forEach(node.members, generateMemberNames); 36093 emitDecoratorsAndModifiers(node, node.modifiers); 36094 if (isStructDeclaration(node)) { 36095 writeKeyword("struct"); 36096 } else { 36097 writeKeyword("class"); 36098 } 36099 if (node.name) { 36100 writeSpace(); 36101 emitIdentifierName(node.name); 36102 } 36103 const indentedFlag = getEmitFlags(node) & 65536 /* Indented */; 36104 if (indentedFlag) { 36105 increaseIndent(); 36106 } 36107 emitTypeParameters(node, node.typeParameters); 36108 emitList(node, node.heritageClauses, 0 /* ClassHeritageClauses */); 36109 writeSpace(); 36110 writePunctuation("{"); 36111 emitList(node, node.members, 129 /* ClassMembers */); 36112 writePunctuation("}"); 36113 if (indentedFlag) { 36114 decreaseIndent(); 36115 } 36116 } 36117 function emitInterfaceDeclaration(node) { 36118 emitModifiers(node, node.modifiers); 36119 writeKeyword("interface"); 36120 writeSpace(); 36121 emit(node.name); 36122 emitTypeParameters(node, node.typeParameters); 36123 emitList(node, node.heritageClauses, 512 /* HeritageClauses */); 36124 writeSpace(); 36125 writePunctuation("{"); 36126 emitList(node, node.members, 129 /* InterfaceMembers */); 36127 writePunctuation("}"); 36128 } 36129 function emitAnnotationDeclaration(node) { 36130 emitDecoratorsAndModifiers(node, node.modifiers); 36131 writeKeyword("@interface"); 36132 if (node.name) { 36133 writeSpace(); 36134 emitIdentifierName(node.name); 36135 } 36136 const indentedFlag = getEmitFlags(node) & 65536 /* Indented */; 36137 if (indentedFlag) { 36138 increaseIndent(); 36139 } 36140 writeSpace(); 36141 writePunctuation("{"); 36142 emitList(node, node.members, 129 /* ClassMembers */); 36143 writePunctuation("}"); 36144 if (indentedFlag) { 36145 decreaseIndent(); 36146 } 36147 } 36148 function emitTypeAliasDeclaration(node) { 36149 if (isSendableFunctionOrType(node, true)) { 36150 emitDecorators(node, node.illegalDecorators); 36151 } 36152 emitModifiers(node, node.modifiers); 36153 writeKeyword("type"); 36154 writeSpace(); 36155 emit(node.name); 36156 emitTypeParameters(node, node.typeParameters); 36157 writeSpace(); 36158 writePunctuation("="); 36159 writeSpace(); 36160 emit(node.type); 36161 writeTrailingSemicolon(); 36162 } 36163 function emitEnumDeclaration(node) { 36164 emitModifiers(node, node.modifiers); 36165 writeKeyword("enum"); 36166 writeSpace(); 36167 emit(node.name); 36168 writeSpace(); 36169 writePunctuation("{"); 36170 emitList(node, node.members, 145 /* EnumMembers */); 36171 writePunctuation("}"); 36172 } 36173 function emitModuleDeclaration(node) { 36174 emitModifiers(node, node.modifiers); 36175 if (~node.flags & 1024 /* GlobalAugmentation */) { 36176 writeKeyword(node.flags & 16 /* Namespace */ ? "namespace" : "module"); 36177 writeSpace(); 36178 } 36179 emit(node.name); 36180 let body = node.body; 36181 if (!body) 36182 return writeTrailingSemicolon(); 36183 while (body && isModuleDeclaration(body)) { 36184 writePunctuation("."); 36185 emit(body.name); 36186 body = body.body; 36187 } 36188 writeSpace(); 36189 emit(body); 36190 } 36191 function emitModuleBlock(node) { 36192 pushNameGenerationScope(node); 36193 forEach(node.statements, generateNames); 36194 emitBlockStatements(node, isEmptyBlock(node)); 36195 popNameGenerationScope(node); 36196 } 36197 function emitCaseBlock(node) { 36198 emitTokenWithComment(18 /* OpenBraceToken */, node.pos, writePunctuation, node); 36199 emitList(node, node.clauses, 129 /* CaseBlockClauses */); 36200 emitTokenWithComment(19 /* CloseBraceToken */, node.clauses.end, writePunctuation, node, true); 36201 } 36202 function emitImportEqualsDeclaration(node) { 36203 emitModifiers(node, node.modifiers); 36204 emitTokenWithComment(101 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); 36205 writeSpace(); 36206 if (node.isTypeOnly) { 36207 emitTokenWithComment(155 /* TypeKeyword */, node.pos, writeKeyword, node); 36208 writeSpace(); 36209 } 36210 emit(node.name); 36211 writeSpace(); 36212 emitTokenWithComment(63 /* EqualsToken */, node.name.end, writePunctuation, node); 36213 writeSpace(); 36214 emitModuleReference(node.moduleReference); 36215 writeTrailingSemicolon(); 36216 } 36217 function emitModuleReference(node) { 36218 if (node.kind === 79 /* Identifier */) { 36219 emitExpression(node); 36220 } else { 36221 emit(node); 36222 } 36223 } 36224 function emitImportDeclaration(node) { 36225 emitModifiers(node, node.modifiers); 36226 emitTokenWithComment(101 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); 36227 writeSpace(); 36228 if (node.importClause) { 36229 emit(node.importClause); 36230 writeSpace(); 36231 emitTokenWithComment(160 /* FromKeyword */, node.importClause.end, writeKeyword, node); 36232 writeSpace(); 36233 } 36234 emitExpression(node.moduleSpecifier); 36235 if (node.assertClause) { 36236 emitWithLeadingSpace(node.assertClause); 36237 } 36238 writeTrailingSemicolon(); 36239 } 36240 function emitImportClause(node) { 36241 if (node.isTypeOnly) { 36242 emitTokenWithComment(155 /* TypeKeyword */, node.pos, writeKeyword, node); 36243 writeSpace(); 36244 } else if (node.isLazy) { 36245 emitTokenWithComment(156 /* LazyKeyword */, node.pos, writeKeyword, node); 36246 writeSpace(); 36247 } 36248 emit(node.name); 36249 if (node.name && node.namedBindings) { 36250 emitTokenWithComment(27 /* CommaToken */, node.name.end, writePunctuation, node); 36251 writeSpace(); 36252 } 36253 emit(node.namedBindings); 36254 } 36255 function emitNamespaceImport(node) { 36256 const asPos = emitTokenWithComment(41 /* AsteriskToken */, node.pos, writePunctuation, node); 36257 writeSpace(); 36258 emitTokenWithComment(129 /* AsKeyword */, asPos, writeKeyword, node); 36259 writeSpace(); 36260 emit(node.name); 36261 } 36262 function emitNamedImports(node) { 36263 emitNamedImportsOrExports(node); 36264 } 36265 function emitImportSpecifier(node) { 36266 emitImportOrExportSpecifier(node); 36267 } 36268 function emitExportAssignment(node) { 36269 const nextPos = emitTokenWithComment(94 /* ExportKeyword */, node.pos, writeKeyword, node); 36270 writeSpace(); 36271 if (node.isExportEquals) { 36272 emitTokenWithComment(63 /* EqualsToken */, nextPos, writeOperator, node); 36273 } else { 36274 emitTokenWithComment(89 /* DefaultKeyword */, nextPos, writeKeyword, node); 36275 } 36276 writeSpace(); 36277 emitExpression(node.expression, node.isExportEquals ? parenthesizer.getParenthesizeRightSideOfBinaryForOperator(63 /* EqualsToken */) : parenthesizer.parenthesizeExpressionOfExportDefault); 36278 writeTrailingSemicolon(); 36279 } 36280 function emitExportDeclaration(node) { 36281 emitModifiers(node, node.modifiers); 36282 let nextPos = emitTokenWithComment(94 /* ExportKeyword */, node.pos, writeKeyword, node); 36283 writeSpace(); 36284 if (node.isTypeOnly) { 36285 nextPos = emitTokenWithComment(155 /* TypeKeyword */, nextPos, writeKeyword, node); 36286 writeSpace(); 36287 } 36288 if (node.exportClause) { 36289 emit(node.exportClause); 36290 } else { 36291 nextPos = emitTokenWithComment(41 /* AsteriskToken */, nextPos, writePunctuation, node); 36292 } 36293 if (node.moduleSpecifier) { 36294 writeSpace(); 36295 const fromPos = node.exportClause ? node.exportClause.end : nextPos; 36296 emitTokenWithComment(160 /* FromKeyword */, fromPos, writeKeyword, node); 36297 writeSpace(); 36298 emitExpression(node.moduleSpecifier); 36299 } 36300 if (node.assertClause) { 36301 emitWithLeadingSpace(node.assertClause); 36302 } 36303 writeTrailingSemicolon(); 36304 } 36305 function emitAssertClause(node) { 36306 emitTokenWithComment(131 /* AssertKeyword */, node.pos, writeKeyword, node); 36307 writeSpace(); 36308 const elements = node.elements; 36309 emitList(node, elements, 526226 /* ImportClauseEntries */); 36310 } 36311 function emitAssertEntry(node) { 36312 emit(node.name); 36313 writePunctuation(":"); 36314 writeSpace(); 36315 const value = node.value; 36316 if ((getEmitFlags(value) & 512 /* NoLeadingComments */) === 0) { 36317 const commentRange = getCommentRange(value); 36318 emitTrailingCommentsOfPosition(commentRange.pos); 36319 } 36320 emit(value); 36321 } 36322 function emitNamespaceExportDeclaration(node) { 36323 let nextPos = emitTokenWithComment(94 /* ExportKeyword */, node.pos, writeKeyword, node); 36324 writeSpace(); 36325 nextPos = emitTokenWithComment(129 /* AsKeyword */, nextPos, writeKeyword, node); 36326 writeSpace(); 36327 nextPos = emitTokenWithComment(144 /* NamespaceKeyword */, nextPos, writeKeyword, node); 36328 writeSpace(); 36329 emit(node.name); 36330 writeTrailingSemicolon(); 36331 } 36332 function emitNamespaceExport(node) { 36333 const asPos = emitTokenWithComment(41 /* AsteriskToken */, node.pos, writePunctuation, node); 36334 writeSpace(); 36335 emitTokenWithComment(129 /* AsKeyword */, asPos, writeKeyword, node); 36336 writeSpace(); 36337 emit(node.name); 36338 } 36339 function emitNamedExports(node) { 36340 emitNamedImportsOrExports(node); 36341 } 36342 function emitExportSpecifier(node) { 36343 emitImportOrExportSpecifier(node); 36344 } 36345 function emitNamedImportsOrExports(node) { 36346 writePunctuation("{"); 36347 emitList(node, node.elements, 525136 /* NamedImportsOrExportsElements */); 36348 writePunctuation("}"); 36349 } 36350 function emitImportOrExportSpecifier(node) { 36351 if (node.isTypeOnly) { 36352 writeKeyword("type"); 36353 writeSpace(); 36354 } 36355 if (node.propertyName) { 36356 emit(node.propertyName); 36357 writeSpace(); 36358 emitTokenWithComment(129 /* AsKeyword */, node.propertyName.end, writeKeyword, node); 36359 writeSpace(); 36360 } 36361 emit(node.name); 36362 } 36363 function emitExternalModuleReference(node) { 36364 writeKeyword("require"); 36365 writePunctuation("("); 36366 emitExpression(node.expression); 36367 writePunctuation(")"); 36368 } 36369 function emitJsxElement(node) { 36370 emit(node.openingElement); 36371 emitList(node, node.children, 262144 /* JsxElementOrFragmentChildren */); 36372 emit(node.closingElement); 36373 } 36374 function emitJsxSelfClosingElement(node) { 36375 writePunctuation("<"); 36376 emitJsxTagName(node.tagName); 36377 emitTypeArguments(node, node.typeArguments); 36378 writeSpace(); 36379 emit(node.attributes); 36380 writePunctuation("/>"); 36381 } 36382 function emitJsxFragment(node) { 36383 emit(node.openingFragment); 36384 emitList(node, node.children, 262144 /* JsxElementOrFragmentChildren */); 36385 emit(node.closingFragment); 36386 } 36387 function emitJsxOpeningElementOrFragment(node) { 36388 writePunctuation("<"); 36389 if (isJsxOpeningElement(node)) { 36390 const indented = writeLineSeparatorsAndIndentBefore(node.tagName, node); 36391 emitJsxTagName(node.tagName); 36392 emitTypeArguments(node, node.typeArguments); 36393 if (node.attributes.properties && node.attributes.properties.length > 0) { 36394 writeSpace(); 36395 } 36396 emit(node.attributes); 36397 writeLineSeparatorsAfter(node.attributes, node); 36398 decreaseIndentIf(indented); 36399 } 36400 writePunctuation(">"); 36401 } 36402 function emitJsxText(node) { 36403 writer.writeLiteral(node.text); 36404 } 36405 function emitJsxClosingElementOrFragment(node) { 36406 writePunctuation("</"); 36407 if (isJsxClosingElement(node)) { 36408 emitJsxTagName(node.tagName); 36409 } 36410 writePunctuation(">"); 36411 } 36412 function emitJsxAttributes(node) { 36413 emitList(node, node.properties, 262656 /* JsxElementAttributes */); 36414 } 36415 function emitJsxAttribute(node) { 36416 emit(node.name); 36417 emitNodeWithPrefix("=", writePunctuation, node.initializer, emitJsxAttributeValue); 36418 } 36419 function emitJsxSpreadAttribute(node) { 36420 writePunctuation("{..."); 36421 emitExpression(node.expression); 36422 writePunctuation("}"); 36423 } 36424 function hasTrailingCommentsAtPosition(pos) { 36425 let result = false; 36426 forEachTrailingCommentRange((currentSourceFile == null ? void 0 : currentSourceFile.text) || "", pos + 1, () => result = true); 36427 return result; 36428 } 36429 function hasLeadingCommentsAtPosition(pos) { 36430 let result = false; 36431 forEachLeadingCommentRange((currentSourceFile == null ? void 0 : currentSourceFile.text) || "", pos + 1, () => result = true); 36432 return result; 36433 } 36434 function hasCommentsAtPosition(pos) { 36435 return hasTrailingCommentsAtPosition(pos) || hasLeadingCommentsAtPosition(pos); 36436 } 36437 function emitJsxExpression(node) { 36438 var _a2; 36439 if (node.expression || !commentsDisabled && !nodeIsSynthesized(node) && hasCommentsAtPosition(node.pos)) { 36440 const isMultiline = currentSourceFile && !nodeIsSynthesized(node) && getLineAndCharacterOfPosition(currentSourceFile, node.pos).line !== getLineAndCharacterOfPosition(currentSourceFile, node.end).line; 36441 if (isMultiline) { 36442 writer.increaseIndent(); 36443 } 36444 const end = emitTokenWithComment(18 /* OpenBraceToken */, node.pos, writePunctuation, node); 36445 emit(node.dotDotDotToken); 36446 emitExpression(node.expression); 36447 emitTokenWithComment(19 /* CloseBraceToken */, ((_a2 = node.expression) == null ? void 0 : _a2.end) || end, writePunctuation, node); 36448 if (isMultiline) { 36449 writer.decreaseIndent(); 36450 } 36451 } 36452 } 36453 function emitJsxTagName(node) { 36454 if (node.kind === 79 /* Identifier */) { 36455 emitExpression(node); 36456 } else { 36457 emit(node); 36458 } 36459 } 36460 function emitCaseClause(node) { 36461 emitTokenWithComment(82 /* CaseKeyword */, node.pos, writeKeyword, node); 36462 writeSpace(); 36463 emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); 36464 emitCaseOrDefaultClauseRest(node, node.statements, node.expression.end); 36465 } 36466 function emitDefaultClause(node) { 36467 const pos = emitTokenWithComment(89 /* DefaultKeyword */, node.pos, writeKeyword, node); 36468 emitCaseOrDefaultClauseRest(node, node.statements, pos); 36469 } 36470 function emitCaseOrDefaultClauseRest(parentNode, statements, colonPos) { 36471 const emitAsSingleStatement = statements.length === 1 && (!currentSourceFile || nodeIsSynthesized(parentNode) || nodeIsSynthesized(statements[0]) || rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile)); 36472 let format = 163969 /* CaseOrDefaultClauseStatements */; 36473 if (emitAsSingleStatement) { 36474 writeToken(58 /* ColonToken */, colonPos, writePunctuation, parentNode); 36475 writeSpace(); 36476 format &= ~(1 /* MultiLine */ | 128 /* Indented */); 36477 } else { 36478 emitTokenWithComment(58 /* ColonToken */, colonPos, writePunctuation, parentNode); 36479 } 36480 emitList(parentNode, statements, format); 36481 } 36482 function emitHeritageClause(node) { 36483 writeSpace(); 36484 writeTokenText(node.token, writeKeyword); 36485 writeSpace(); 36486 emitList(node, node.types, 528 /* HeritageClauseTypes */); 36487 } 36488 function emitCatchClause(node) { 36489 const openParenPos = emitTokenWithComment(83 /* CatchKeyword */, node.pos, writeKeyword, node); 36490 writeSpace(); 36491 if (node.variableDeclaration) { 36492 emitTokenWithComment(20 /* OpenParenToken */, openParenPos, writePunctuation, node); 36493 emit(node.variableDeclaration); 36494 emitTokenWithComment(21 /* CloseParenToken */, node.variableDeclaration.end, writePunctuation, node); 36495 writeSpace(); 36496 } 36497 emit(node.block); 36498 } 36499 function emitPropertyAssignment(node) { 36500 emit(node.name); 36501 writePunctuation(":"); 36502 writeSpace(); 36503 const initializer = node.initializer; 36504 if ((getEmitFlags(initializer) & 512 /* NoLeadingComments */) === 0) { 36505 const commentRange = getCommentRange(initializer); 36506 emitTrailingCommentsOfPosition(commentRange.pos); 36507 } 36508 emitExpression(initializer, parenthesizer.parenthesizeExpressionForDisallowedComma); 36509 } 36510 function emitShorthandPropertyAssignment(node) { 36511 emit(node.name); 36512 if (node.objectAssignmentInitializer) { 36513 writeSpace(); 36514 writePunctuation("="); 36515 writeSpace(); 36516 emitExpression(node.objectAssignmentInitializer, parenthesizer.parenthesizeExpressionForDisallowedComma); 36517 } 36518 } 36519 function emitSpreadAssignment(node) { 36520 if (node.expression) { 36521 emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node); 36522 emitExpression(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma); 36523 } 36524 } 36525 function emitEnumMember(node) { 36526 emit(node.name); 36527 emitInitializer(node.initializer, node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma); 36528 } 36529 function emitJSDoc(node) { 36530 write("/**"); 36531 if (node.comment) { 36532 const text = getTextOfJSDocComment(node.comment); 36533 if (text) { 36534 const lines = text.split(/\r\n?|\n/g); 36535 for (const line of lines) { 36536 writeLine(); 36537 writeSpace(); 36538 writePunctuation("*"); 36539 writeSpace(); 36540 write(line); 36541 } 36542 } 36543 } 36544 if (node.tags) { 36545 if (node.tags.length === 1 && node.tags[0].kind === 352 /* JSDocTypeTag */ && !node.comment) { 36546 writeSpace(); 36547 emit(node.tags[0]); 36548 } else { 36549 emitList(node, node.tags, 33 /* JSDocComment */); 36550 } 36551 } 36552 writeSpace(); 36553 write("*/"); 36554 } 36555 function emitJSDocSimpleTypedTag(tag) { 36556 emitJSDocTagName(tag.tagName); 36557 emitJSDocTypeExpression(tag.typeExpression); 36558 emitJSDocComment(tag.comment); 36559 } 36560 function emitJSDocSeeTag(tag) { 36561 emitJSDocTagName(tag.tagName); 36562 emit(tag.name); 36563 emitJSDocComment(tag.comment); 36564 } 36565 function emitJSDocNameReference(node) { 36566 writeSpace(); 36567 writePunctuation("{"); 36568 emit(node.name); 36569 writePunctuation("}"); 36570 } 36571 function emitJSDocHeritageTag(tag) { 36572 emitJSDocTagName(tag.tagName); 36573 writeSpace(); 36574 writePunctuation("{"); 36575 emit(tag.class); 36576 writePunctuation("}"); 36577 emitJSDocComment(tag.comment); 36578 } 36579 function emitJSDocTemplateTag(tag) { 36580 emitJSDocTagName(tag.tagName); 36581 emitJSDocTypeExpression(tag.constraint); 36582 writeSpace(); 36583 emitList(tag, tag.typeParameters, 528 /* CommaListElements */); 36584 emitJSDocComment(tag.comment); 36585 } 36586 function emitJSDocTypedefTag(tag) { 36587 emitJSDocTagName(tag.tagName); 36588 if (tag.typeExpression) { 36589 if (tag.typeExpression.kind === 318 /* JSDocTypeExpression */) { 36590 emitJSDocTypeExpression(tag.typeExpression); 36591 } else { 36592 writeSpace(); 36593 writePunctuation("{"); 36594 write("Object"); 36595 if (tag.typeExpression.isArrayType) { 36596 writePunctuation("["); 36597 writePunctuation("]"); 36598 } 36599 writePunctuation("}"); 36600 } 36601 } 36602 if (tag.fullName) { 36603 writeSpace(); 36604 emit(tag.fullName); 36605 } 36606 emitJSDocComment(tag.comment); 36607 if (tag.typeExpression && tag.typeExpression.kind === 331 /* JSDocTypeLiteral */) { 36608 emitJSDocTypeLiteral(tag.typeExpression); 36609 } 36610 } 36611 function emitJSDocCallbackTag(tag) { 36612 emitJSDocTagName(tag.tagName); 36613 if (tag.name) { 36614 writeSpace(); 36615 emit(tag.name); 36616 } 36617 emitJSDocComment(tag.comment); 36618 emitJSDocSignature(tag.typeExpression); 36619 } 36620 function emitJSDocSimpleTag(tag) { 36621 emitJSDocTagName(tag.tagName); 36622 emitJSDocComment(tag.comment); 36623 } 36624 function emitJSDocTypeLiteral(lit) { 36625 emitList(lit, factory.createNodeArray(lit.jsDocPropertyTags), 33 /* JSDocComment */); 36626 } 36627 function emitJSDocSignature(sig) { 36628 if (sig.typeParameters) { 36629 emitList(sig, factory.createNodeArray(sig.typeParameters), 33 /* JSDocComment */); 36630 } 36631 if (sig.parameters) { 36632 emitList(sig, factory.createNodeArray(sig.parameters), 33 /* JSDocComment */); 36633 } 36634 if (sig.type) { 36635 writeLine(); 36636 writeSpace(); 36637 writePunctuation("*"); 36638 writeSpace(); 36639 emit(sig.type); 36640 } 36641 } 36642 function emitJSDocPropertyLikeTag(param) { 36643 emitJSDocTagName(param.tagName); 36644 emitJSDocTypeExpression(param.typeExpression); 36645 writeSpace(); 36646 if (param.isBracketed) { 36647 writePunctuation("["); 36648 } 36649 emit(param.name); 36650 if (param.isBracketed) { 36651 writePunctuation("]"); 36652 } 36653 emitJSDocComment(param.comment); 36654 } 36655 function emitJSDocTagName(tagName) { 36656 writePunctuation("@"); 36657 emit(tagName); 36658 } 36659 function emitJSDocComment(comment) { 36660 const text = getTextOfJSDocComment(comment); 36661 if (text) { 36662 writeSpace(); 36663 write(text); 36664 } 36665 } 36666 function emitJSDocTypeExpression(typeExpression) { 36667 if (typeExpression) { 36668 writeSpace(); 36669 writePunctuation("{"); 36670 emit(typeExpression.type); 36671 writePunctuation("}"); 36672 } 36673 } 36674 function emitSourceFile(node) { 36675 writeLine(); 36676 if (node.writeTsHarComments) { 36677 writeComment("// @keepTs\n// @ts-nocheck\n"); 36678 } 36679 const statements = node.statements; 36680 const shouldEmitDetachedComment = statements.length === 0 || !isPrologueDirective(statements[0]) || nodeIsSynthesized(statements[0]); 36681 if (shouldEmitDetachedComment) { 36682 emitBodyWithDetachedComments(node, statements, emitSourceFileWorker); 36683 return; 36684 } 36685 emitSourceFileWorker(node); 36686 } 36687 function emitSyntheticTripleSlashReferencesIfNeeded(node) { 36688 emitTripleSlashDirectives(!!node.hasNoDefaultLib, node.syntheticFileReferences || [], node.syntheticTypeReferences || [], node.syntheticLibReferences || []); 36689 for (const prepend of node.prepends) { 36690 if (isUnparsedSource(prepend) && prepend.syntheticReferences) { 36691 for (const ref of prepend.syntheticReferences) { 36692 emit(ref); 36693 writeLine(); 36694 } 36695 } 36696 } 36697 } 36698 function emitTripleSlashDirectivesIfNeeded(node) { 36699 if (node.isDeclarationFile) 36700 emitTripleSlashDirectives(node.hasNoDefaultLib, node.referencedFiles, node.typeReferenceDirectives, node.libReferenceDirectives); 36701 } 36702 function emitTripleSlashDirectives(hasNoDefaultLib, files, types, libs2) { 36703 if (hasNoDefaultLib) { 36704 const pos = writer.getTextPos(); 36705 writeComment(`/// <reference no-default-lib="true"/>`); 36706 if (bundleFileInfo) 36707 bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "no-default-lib" /* NoDefaultLib */ }); 36708 writeLine(); 36709 } 36710 if (currentSourceFile && currentSourceFile.moduleName) { 36711 writeComment(`/// <amd-module name="${currentSourceFile.moduleName}" />`); 36712 writeLine(); 36713 } 36714 if (currentSourceFile && currentSourceFile.amdDependencies) { 36715 for (const dep of currentSourceFile.amdDependencies) { 36716 if (dep.name) { 36717 writeComment(`/// <amd-dependency name="${dep.name}" path="${dep.path}" />`); 36718 } else { 36719 writeComment(`/// <amd-dependency path="${dep.path}" />`); 36720 } 36721 writeLine(); 36722 } 36723 } 36724 for (const directive of files) { 36725 const pos = writer.getTextPos(); 36726 writeComment(`/// <reference path="${directive.fileName}" />`); 36727 if (bundleFileInfo) 36728 bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName }); 36729 writeLine(); 36730 } 36731 for (const directive of types) { 36732 const pos = writer.getTextPos(); 36733 const resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile == null ? void 0 : currentSourceFile.impliedNodeFormat) ? `resolution-mode="${directive.resolutionMode === 99 /* ESNext */ ? "import" : "require"}"` : ""; 36734 writeComment(`/// <reference types="${directive.fileName}" ${resolutionMode}/>`); 36735 if (bundleFileInfo) 36736 bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: !directive.resolutionMode ? "type" /* Type */ : directive.resolutionMode === 99 /* ESNext */ ? "type-import" /* TypeResolutionModeImport */ : "type-require" /* TypeResolutionModeRequire */, data: directive.fileName }); 36737 writeLine(); 36738 } 36739 for (const directive of libs2) { 36740 const pos = writer.getTextPos(); 36741 writeComment(`/// <reference lib="${directive.fileName}" />`); 36742 if (bundleFileInfo) 36743 bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "lib" /* Lib */, data: directive.fileName }); 36744 writeLine(); 36745 } 36746 } 36747 function emitSourceFileWorker(node) { 36748 const statements = node.statements; 36749 pushNameGenerationScope(node); 36750 forEach(node.statements, generateNames); 36751 emitHelpers(node); 36752 const index = findIndex(statements, (statement) => !isPrologueDirective(statement)); 36753 emitTripleSlashDirectivesIfNeeded(node); 36754 emitList(node, statements, 1 /* MultiLine */, void 0, index === -1 ? statements.length : index); 36755 popNameGenerationScope(node); 36756 } 36757 function emitPartiallyEmittedExpression(node) { 36758 const emitFlags = getEmitFlags(node); 36759 if (!(emitFlags & 512 /* NoLeadingComments */) && node.pos !== node.expression.pos) { 36760 emitTrailingCommentsOfPosition(node.expression.pos); 36761 } 36762 emitExpression(node.expression); 36763 if (!(emitFlags & 1024 /* NoTrailingComments */) && node.end !== node.expression.end) { 36764 emitLeadingCommentsOfPosition(node.expression.end); 36765 } 36766 } 36767 function emitCommaList(node) { 36768 emitExpressionList(node, node.elements, 528 /* CommaListElements */, void 0); 36769 } 36770 function emitPrologueDirectives(statements, sourceFile, seenPrologueDirectives, recordBundleFileSection) { 36771 let needsToSetSourceFile = !!sourceFile; 36772 for (let i = 0; i < statements.length; i++) { 36773 const statement = statements[i]; 36774 if (isPrologueDirective(statement)) { 36775 const shouldEmitPrologueDirective = seenPrologueDirectives ? !seenPrologueDirectives.has(statement.expression.text) : true; 36776 if (shouldEmitPrologueDirective) { 36777 if (needsToSetSourceFile) { 36778 needsToSetSourceFile = false; 36779 setSourceFile(sourceFile); 36780 } 36781 writeLine(); 36782 const pos = writer.getTextPos(); 36783 emit(statement); 36784 if (recordBundleFileSection && bundleFileInfo) 36785 bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "prologue" /* Prologue */, data: statement.expression.text }); 36786 if (seenPrologueDirectives) { 36787 seenPrologueDirectives.add(statement.expression.text); 36788 } 36789 } 36790 } else { 36791 return i; 36792 } 36793 } 36794 return statements.length; 36795 } 36796 function emitUnparsedPrologues(prologues, seenPrologueDirectives) { 36797 for (const prologue of prologues) { 36798 if (!seenPrologueDirectives.has(prologue.data)) { 36799 writeLine(); 36800 const pos = writer.getTextPos(); 36801 emit(prologue); 36802 if (bundleFileInfo) 36803 bundleFileInfo.sections.push({ pos, end: writer.getTextPos(), kind: "prologue" /* Prologue */, data: prologue.data }); 36804 if (seenPrologueDirectives) { 36805 seenPrologueDirectives.add(prologue.data); 36806 } 36807 } 36808 } 36809 } 36810 function emitPrologueDirectivesIfNeeded(sourceFileOrBundle) { 36811 if (isSourceFile(sourceFileOrBundle)) { 36812 emitPrologueDirectives(sourceFileOrBundle.statements, sourceFileOrBundle); 36813 } else { 36814 const seenPrologueDirectives = new Set2(); 36815 for (const prepend of sourceFileOrBundle.prepends) { 36816 emitUnparsedPrologues(prepend.prologues, seenPrologueDirectives); 36817 } 36818 for (const sourceFile of sourceFileOrBundle.sourceFiles) { 36819 emitPrologueDirectives(sourceFile.statements, sourceFile, seenPrologueDirectives, true); 36820 } 36821 setSourceFile(void 0); 36822 } 36823 } 36824 function getPrologueDirectivesFromBundledSourceFiles(bundle) { 36825 const seenPrologueDirectives = new Set2(); 36826 let prologues; 36827 for (let index = 0; index < bundle.sourceFiles.length; index++) { 36828 const sourceFile = bundle.sourceFiles[index]; 36829 let directives; 36830 let end = 0; 36831 for (const statement of sourceFile.statements) { 36832 if (!isPrologueDirective(statement)) 36833 break; 36834 if (seenPrologueDirectives.has(statement.expression.text)) 36835 continue; 36836 seenPrologueDirectives.add(statement.expression.text); 36837 (directives || (directives = [])).push({ 36838 pos: statement.pos, 36839 end: statement.end, 36840 expression: { 36841 pos: statement.expression.pos, 36842 end: statement.expression.end, 36843 text: statement.expression.text 36844 } 36845 }); 36846 end = end < statement.end ? statement.end : end; 36847 } 36848 if (directives) 36849 (prologues || (prologues = [])).push({ file: index, text: sourceFile.text.substring(0, end), directives }); 36850 } 36851 return prologues; 36852 } 36853 function emitShebangIfNeeded(sourceFileOrBundle) { 36854 if (isSourceFile(sourceFileOrBundle) || isUnparsedSource(sourceFileOrBundle)) { 36855 const shebang = getShebang(sourceFileOrBundle.text); 36856 if (shebang) { 36857 writeComment(shebang); 36858 writeLine(); 36859 return true; 36860 } 36861 } else { 36862 for (const prepend of sourceFileOrBundle.prepends) { 36863 Debug.assertNode(prepend, isUnparsedSource); 36864 if (emitShebangIfNeeded(prepend)) { 36865 return true; 36866 } 36867 } 36868 for (const sourceFile of sourceFileOrBundle.sourceFiles) { 36869 if (emitShebangIfNeeded(sourceFile)) { 36870 return true; 36871 } 36872 } 36873 } 36874 } 36875 function emitNodeWithWriter(node, writer2) { 36876 if (!node) 36877 return; 36878 const savedWrite = write; 36879 write = writer2; 36880 emit(node); 36881 write = savedWrite; 36882 } 36883 function emitDecoratorsAndModifiers(node, modifiers) { 36884 if (modifiers == null ? void 0 : modifiers.length) { 36885 if (every(modifiers, isModifier)) { 36886 return emitModifiers(node, modifiers); 36887 } 36888 if (every(modifiers, isDecoratorOrAnnotation)) { 36889 return emitDecorators(node, modifiers); 36890 } 36891 onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(modifiers); 36892 let lastMode; 36893 let mode; 36894 let start = 0; 36895 let pos = 0; 36896 while (start < modifiers.length) { 36897 while (pos < modifiers.length) { 36898 const modifier = modifiers[pos]; 36899 mode = isDecoratorOrAnnotation(modifier) ? "decorators" : "modifiers"; 36900 if (lastMode === void 0) { 36901 lastMode = mode; 36902 } else if (mode !== lastMode) { 36903 break; 36904 } 36905 pos++; 36906 } 36907 const textRange = { pos: -1, end: -1 }; 36908 if (start === 0) 36909 textRange.pos = modifiers.pos; 36910 if (pos === modifiers.length - 1) 36911 textRange.end = modifiers.end; 36912 emitNodeListItems( 36913 emit, 36914 node, 36915 modifiers, 36916 lastMode === "modifiers" ? 2359808 /* Modifiers */ : 2146305 /* Decorators */, 36917 void 0, 36918 start, 36919 pos - start, 36920 false, 36921 textRange 36922 ); 36923 start = pos; 36924 lastMode = mode; 36925 pos++; 36926 } 36927 onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(modifiers); 36928 } 36929 } 36930 function emitModifiers(node, modifiers) { 36931 emitList(node, modifiers, 2359808 /* Modifiers */); 36932 } 36933 function emitTypeAnnotation(node) { 36934 if (node) { 36935 writePunctuation(":"); 36936 writeSpace(); 36937 emit(node); 36938 } 36939 } 36940 function emitInitializer(node, equalCommentStartPos, container, parenthesizerRule) { 36941 if (node) { 36942 writeSpace(); 36943 emitTokenWithComment(63 /* EqualsToken */, equalCommentStartPos, writeOperator, container); 36944 writeSpace(); 36945 emitExpression(node, parenthesizerRule); 36946 } 36947 } 36948 function emitNodeWithPrefix(prefix, prefixWriter, node, emit2) { 36949 if (node) { 36950 prefixWriter(prefix); 36951 emit2(node); 36952 } 36953 } 36954 function emitWithLeadingSpace(node) { 36955 if (node) { 36956 writeSpace(); 36957 emit(node); 36958 } 36959 } 36960 function emitExpressionWithLeadingSpace(node, parenthesizerRule) { 36961 if (node) { 36962 writeSpace(); 36963 emitExpression(node, parenthesizerRule); 36964 } 36965 } 36966 function emitWithTrailingSpace(node) { 36967 if (node) { 36968 emit(node); 36969 writeSpace(); 36970 } 36971 } 36972 function emitEmbeddedStatement(parent, node) { 36973 if (isBlock(node) || getEmitFlags(parent) & 1 /* SingleLine */) { 36974 writeSpace(); 36975 emit(node); 36976 } else { 36977 writeLine(); 36978 increaseIndent(); 36979 if (isEmptyStatement(node)) { 36980 pipelineEmit(5 /* EmbeddedStatement */, node); 36981 } else { 36982 emit(node); 36983 } 36984 decreaseIndent(); 36985 } 36986 } 36987 function emitDecorators(parentNode, decorators) { 36988 emitList(parentNode, decorators, 2146305 /* Decorators */); 36989 } 36990 function emitTypeArguments(parentNode, typeArguments) { 36991 emitList(parentNode, typeArguments, 53776 /* TypeArguments */, typeArgumentParenthesizerRuleSelector); 36992 } 36993 function emitTypeParameters(parentNode, typeParameters) { 36994 if (isFunctionLike(parentNode) && parentNode.typeArguments) { 36995 return emitTypeArguments(parentNode, parentNode.typeArguments); 36996 } 36997 emitList(parentNode, typeParameters, 53776 /* TypeParameters */); 36998 } 36999 function emitParameters(parentNode, parameters) { 37000 emitList(parentNode, parameters, 2576 /* Parameters */); 37001 } 37002 function canEmitSimpleArrowHead(parentNode, parameters) { 37003 const parameter = singleOrUndefined(parameters); 37004 return parameter && parameter.pos === parentNode.pos && isArrowFunction(parentNode) && !parentNode.type && !some(parentNode.modifiers) && !some(parentNode.typeParameters) && !some(parameter.modifiers) && !parameter.dotDotDotToken && !parameter.questionToken && !parameter.type && !parameter.initializer && isIdentifier(parameter.name); 37005 } 37006 function emitParametersForArrow(parentNode, parameters) { 37007 if (canEmitSimpleArrowHead(parentNode, parameters)) { 37008 emitList(parentNode, parameters, 2576 /* Parameters */ & ~2048 /* Parenthesis */); 37009 } else { 37010 emitParameters(parentNode, parameters); 37011 } 37012 } 37013 function emitParametersForIndexSignature(parentNode, parameters) { 37014 emitList(parentNode, parameters, 8848 /* IndexSignatureParameters */); 37015 } 37016 function writeDelimiter(format) { 37017 switch (format & 60 /* DelimitersMask */) { 37018 case 0 /* None */: 37019 break; 37020 case 16 /* CommaDelimited */: 37021 writePunctuation(","); 37022 break; 37023 case 4 /* BarDelimited */: 37024 writeSpace(); 37025 writePunctuation("|"); 37026 break; 37027 case 32 /* AsteriskDelimited */: 37028 writeSpace(); 37029 writePunctuation("*"); 37030 writeSpace(); 37031 break; 37032 case 8 /* AmpersandDelimited */: 37033 writeSpace(); 37034 writePunctuation("&"); 37035 break; 37036 } 37037 } 37038 function emitList(parentNode, children, format, parenthesizerRule, start, count) { 37039 emitNodeList(emit, parentNode, children, format, parenthesizerRule, start, count); 37040 } 37041 function emitExpressionList(parentNode, children, format, parenthesizerRule, start, count) { 37042 emitNodeList(emitExpression, parentNode, children, format, parenthesizerRule, start, count); 37043 } 37044 function emitNodeList(emit2, parentNode, children, format, parenthesizerRule, start = 0, count = children ? children.length - start : 0) { 37045 const isUndefined = children === void 0; 37046 if (isUndefined && format & 16384 /* OptionalIfUndefined */) { 37047 return; 37048 } 37049 const isEmpty = children === void 0 || start >= children.length || count === 0; 37050 if (isEmpty && format & 32768 /* OptionalIfEmpty */) { 37051 onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(children); 37052 onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(children); 37053 return; 37054 } 37055 if (format & 15360 /* BracketsMask */) { 37056 writePunctuation(getOpeningBracket(format)); 37057 if (isEmpty && children) { 37058 emitTrailingCommentsOfPosition(children.pos, true); 37059 } 37060 } 37061 onBeforeEmitNodeArray == null ? void 0 : onBeforeEmitNodeArray(children); 37062 if (isEmpty) { 37063 if (format & 1 /* MultiLine */ && !(preserveSourceNewlines && (!parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile)))) { 37064 writeLine(); 37065 } else if (format & 256 /* SpaceBetweenBraces */ && !(format & 524288 /* NoSpaceIfEmpty */)) { 37066 writeSpace(); 37067 } 37068 } else { 37069 emitNodeListItems(emit2, parentNode, children, format, parenthesizerRule, start, count, children.hasTrailingComma, children); 37070 } 37071 onAfterEmitNodeArray == null ? void 0 : onAfterEmitNodeArray(children); 37072 if (format & 15360 /* BracketsMask */) { 37073 if (isEmpty && children) { 37074 emitLeadingCommentsOfPosition(children.end); 37075 } 37076 writePunctuation(getClosingBracket(format)); 37077 } 37078 } 37079 function emitNodeListItems(emit2, parentNode, children, format, parenthesizerRule, start, count, hasTrailingComma, childrenTextRange) { 37080 const mayEmitInterveningComments = (format & 262144 /* NoInterveningComments */) === 0; 37081 let shouldEmitInterveningComments = mayEmitInterveningComments; 37082 const leadingLineTerminatorCount = getLeadingLineTerminatorCount(parentNode, children[start], format); 37083 if (leadingLineTerminatorCount) { 37084 writeLine(leadingLineTerminatorCount); 37085 shouldEmitInterveningComments = false; 37086 } else if (format & 256 /* SpaceBetweenBraces */) { 37087 writeSpace(); 37088 } 37089 if (format & 128 /* Indented */) { 37090 increaseIndent(); 37091 } 37092 const emitListItem = getEmitListItem(emit2, parenthesizerRule); 37093 let previousSibling; 37094 let previousSourceFileTextKind; 37095 let shouldDecreaseIndentAfterEmit = false; 37096 for (let i = 0; i < count; i++) { 37097 const child = children[start + i]; 37098 if (format & 32 /* AsteriskDelimited */) { 37099 writeLine(); 37100 writeDelimiter(format); 37101 } else if (previousSibling) { 37102 if (format & 60 /* DelimitersMask */ && previousSibling.end !== (parentNode ? parentNode.end : -1)) { 37103 emitLeadingCommentsOfPosition(previousSibling.end); 37104 } 37105 writeDelimiter(format); 37106 recordBundleFileInternalSectionEnd(previousSourceFileTextKind); 37107 const separatingLineTerminatorCount = getSeparatingLineTerminatorCount(previousSibling, child, format); 37108 if (separatingLineTerminatorCount > 0) { 37109 if ((format & (3 /* LinesMask */ | 128 /* Indented */)) === 0 /* SingleLine */) { 37110 increaseIndent(); 37111 shouldDecreaseIndentAfterEmit = true; 37112 } 37113 writeLine(separatingLineTerminatorCount); 37114 shouldEmitInterveningComments = false; 37115 } else if (previousSibling && format & 512 /* SpaceBetweenSiblings */) { 37116 writeSpace(); 37117 } 37118 } 37119 previousSourceFileTextKind = recordBundleFileInternalSectionStart(child); 37120 if (shouldEmitInterveningComments) { 37121 const commentRange = getCommentRange(child); 37122 emitTrailingCommentsOfPosition(commentRange.pos); 37123 } else { 37124 shouldEmitInterveningComments = mayEmitInterveningComments; 37125 } 37126 nextListElementPos = child.pos; 37127 emitListItem(child, emit2, parenthesizerRule, i); 37128 if (shouldDecreaseIndentAfterEmit) { 37129 decreaseIndent(); 37130 shouldDecreaseIndentAfterEmit = false; 37131 } 37132 previousSibling = child; 37133 } 37134 const emitFlags = previousSibling ? getEmitFlags(previousSibling) : 0; 37135 const skipTrailingComments = commentsDisabled || !!(emitFlags & 1024 /* NoTrailingComments */); 37136 const emitTrailingComma = hasTrailingComma && format & 64 /* AllowTrailingComma */ && format & 16 /* CommaDelimited */; 37137 if (emitTrailingComma) { 37138 if (previousSibling && !skipTrailingComments) { 37139 emitTokenWithComment(27 /* CommaToken */, previousSibling.end, writePunctuation, previousSibling); 37140 } else { 37141 writePunctuation(","); 37142 } 37143 } 37144 if (previousSibling && (parentNode ? parentNode.end : -1) !== previousSibling.end && format & 60 /* DelimitersMask */ && !skipTrailingComments) { 37145 emitLeadingCommentsOfPosition(emitTrailingComma && (childrenTextRange == null ? void 0 : childrenTextRange.end) ? childrenTextRange.end : previousSibling.end); 37146 } 37147 if (format & 128 /* Indented */) { 37148 decreaseIndent(); 37149 } 37150 recordBundleFileInternalSectionEnd(previousSourceFileTextKind); 37151 const closingLineTerminatorCount = getClosingLineTerminatorCount(parentNode, children[start + count - 1], format, childrenTextRange); 37152 if (closingLineTerminatorCount) { 37153 writeLine(closingLineTerminatorCount); 37154 } else if (format & (2097152 /* SpaceAfterList */ | 256 /* SpaceBetweenBraces */)) { 37155 writeSpace(); 37156 } 37157 } 37158 function writeLiteral(s) { 37159 writer.writeLiteral(s); 37160 } 37161 function writeStringLiteral(s) { 37162 writer.writeStringLiteral(s); 37163 } 37164 function writeBase(s) { 37165 writer.write(s); 37166 } 37167 function writeSymbol(s, sym) { 37168 writer.writeSymbol(s, sym); 37169 } 37170 function writePunctuation(s) { 37171 writer.writePunctuation(s); 37172 } 37173 function writeTrailingSemicolon() { 37174 writer.writeTrailingSemicolon(";"); 37175 } 37176 function writeKeyword(s) { 37177 writer.writeKeyword(s); 37178 } 37179 function writeOperator(s) { 37180 writer.writeOperator(s); 37181 } 37182 function writeParameter(s) { 37183 writer.writeParameter(s); 37184 } 37185 function writeComment(s) { 37186 writer.writeComment(s); 37187 } 37188 function writeSpace() { 37189 writer.writeSpace(" "); 37190 } 37191 function writeProperty(s) { 37192 writer.writeProperty(s); 37193 } 37194 function nonEscapingWrite(s) { 37195 if (writer.nonEscapingWrite) { 37196 writer.nonEscapingWrite(s); 37197 } else { 37198 writer.write(s); 37199 } 37200 } 37201 function writeLine(count = 1) { 37202 for (let i = 0; i < count; i++) { 37203 writer.writeLine(i > 0); 37204 } 37205 } 37206 function increaseIndent() { 37207 writer.increaseIndent(); 37208 } 37209 function decreaseIndent() { 37210 writer.decreaseIndent(); 37211 } 37212 function writeToken(token, pos, writer2, contextNode) { 37213 return !sourceMapsDisabled ? emitTokenWithSourceMap(contextNode, token, writer2, pos, writeTokenText) : writeTokenText(token, writer2, pos); 37214 } 37215 function writeTokenNode(node, writer2) { 37216 if (onBeforeEmitToken) { 37217 onBeforeEmitToken(node); 37218 } 37219 writer2(tokenToString(node.kind)); 37220 if (onAfterEmitToken) { 37221 onAfterEmitToken(node); 37222 } 37223 } 37224 function writeTokenText(token, writer2, pos) { 37225 const tokenString = tokenToString(token); 37226 writer2(tokenString); 37227 return pos < 0 ? pos : pos + tokenString.length; 37228 } 37229 function writeLineOrSpace(parentNode, prevChildNode, nextChildNode) { 37230 if (getEmitFlags(parentNode) & 1 /* SingleLine */) { 37231 writeSpace(); 37232 } else if (preserveSourceNewlines) { 37233 const lines = getLinesBetweenNodes(parentNode, prevChildNode, nextChildNode); 37234 if (lines) { 37235 writeLine(lines); 37236 } else { 37237 writeSpace(); 37238 } 37239 } else { 37240 writeLine(); 37241 } 37242 } 37243 function writeLines(text) { 37244 const lines = text.split(/\r\n?|\n/g); 37245 const indentation = guessIndentation(lines); 37246 for (const lineText of lines) { 37247 const line = indentation ? lineText.slice(indentation) : lineText; 37248 if (line.length) { 37249 writeLine(); 37250 write(line); 37251 } 37252 } 37253 } 37254 function writeLinesAndIndent(lineCount, writeSpaceIfNotIndenting) { 37255 if (lineCount) { 37256 increaseIndent(); 37257 writeLine(lineCount); 37258 } else if (writeSpaceIfNotIndenting) { 37259 writeSpace(); 37260 } 37261 } 37262 function decreaseIndentIf(value1, value2) { 37263 if (value1) { 37264 decreaseIndent(); 37265 } 37266 if (value2) { 37267 decreaseIndent(); 37268 } 37269 } 37270 function getLeadingLineTerminatorCount(parentNode, firstChild, format) { 37271 if (format & 2 /* PreserveLines */ || preserveSourceNewlines) { 37272 if (format & 65536 /* PreferNewLine */) { 37273 return 1; 37274 } 37275 if (firstChild === void 0) { 37276 return !parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1; 37277 } 37278 if (firstChild.pos === nextListElementPos) { 37279 return 0; 37280 } 37281 if (firstChild.kind === 11 /* JsxText */) { 37282 return 0; 37283 } 37284 if (currentSourceFile && parentNode && !positionIsSynthesized(parentNode.pos) && !nodeIsSynthesized(firstChild) && (!firstChild.parent || getOriginalNode(firstChild.parent) === getOriginalNode(parentNode))) { 37285 if (preserveSourceNewlines) { 37286 return getEffectiveLines( 37287 (includeComments) => getLinesBetweenPositionAndPrecedingNonWhitespaceCharacter( 37288 firstChild.pos, 37289 parentNode.pos, 37290 currentSourceFile, 37291 includeComments 37292 ) 37293 ); 37294 } 37295 return rangeStartPositionsAreOnSameLine(parentNode, firstChild, currentSourceFile) ? 0 : 1; 37296 } 37297 if (synthesizedNodeStartsOnNewLine(firstChild, format)) { 37298 return 1; 37299 } 37300 } 37301 return format & 1 /* MultiLine */ ? 1 : 0; 37302 } 37303 function getSeparatingLineTerminatorCount(previousNode, nextNode, format) { 37304 if (format & 2 /* PreserveLines */ || preserveSourceNewlines) { 37305 if (previousNode === void 0 || nextNode === void 0) { 37306 return 0; 37307 } 37308 if (nextNode.kind === 11 /* JsxText */) { 37309 return 0; 37310 } else if (currentSourceFile && !nodeIsSynthesized(previousNode) && !nodeIsSynthesized(nextNode)) { 37311 if (preserveSourceNewlines && siblingNodePositionsAreComparable(previousNode, nextNode)) { 37312 return getEffectiveLines( 37313 (includeComments) => getLinesBetweenRangeEndAndRangeStart( 37314 previousNode, 37315 nextNode, 37316 currentSourceFile, 37317 includeComments 37318 ) 37319 ); 37320 } else if (!preserveSourceNewlines && originalNodesHaveSameParent(previousNode, nextNode)) { 37321 return rangeEndIsOnSameLineAsRangeStart(previousNode, nextNode, currentSourceFile) ? 0 : 1; 37322 } 37323 return format & 65536 /* PreferNewLine */ ? 1 : 0; 37324 } else if (synthesizedNodeStartsOnNewLine(previousNode, format) || synthesizedNodeStartsOnNewLine(nextNode, format)) { 37325 return 1; 37326 } 37327 } else if (getStartsOnNewLine(nextNode)) { 37328 return 1; 37329 } 37330 return format & 1 /* MultiLine */ ? 1 : 0; 37331 } 37332 function getClosingLineTerminatorCount(parentNode, lastChild, format, childrenTextRange) { 37333 if (format & 2 /* PreserveLines */ || preserveSourceNewlines) { 37334 if (format & 65536 /* PreferNewLine */) { 37335 return 1; 37336 } 37337 if (lastChild === void 0) { 37338 return !parentNode || currentSourceFile && rangeIsOnSingleLine(parentNode, currentSourceFile) ? 0 : 1; 37339 } 37340 if (currentSourceFile && parentNode && !positionIsSynthesized(parentNode.pos) && !nodeIsSynthesized(lastChild) && (!lastChild.parent || lastChild.parent === parentNode)) { 37341 if (preserveSourceNewlines) { 37342 const end = childrenTextRange && !positionIsSynthesized(childrenTextRange.end) ? childrenTextRange.end : lastChild.end; 37343 return getEffectiveLines( 37344 (includeComments) => getLinesBetweenPositionAndNextNonWhitespaceCharacter( 37345 end, 37346 parentNode.end, 37347 currentSourceFile, 37348 includeComments 37349 ) 37350 ); 37351 } 37352 return rangeEndPositionsAreOnSameLine(parentNode, lastChild, currentSourceFile) ? 0 : 1; 37353 } 37354 if (synthesizedNodeStartsOnNewLine(lastChild, format)) { 37355 return 1; 37356 } 37357 } 37358 if (format & 1 /* MultiLine */ && !(format & 131072 /* NoTrailingNewLine */)) { 37359 return 1; 37360 } 37361 return 0; 37362 } 37363 function getEffectiveLines(getLineDifference) { 37364 Debug.assert(!!preserveSourceNewlines); 37365 const lines = getLineDifference(true); 37366 if (lines === 0) { 37367 return getLineDifference(false); 37368 } 37369 return lines; 37370 } 37371 function writeLineSeparatorsAndIndentBefore(node, parent) { 37372 const leadingNewlines = preserveSourceNewlines && getLeadingLineTerminatorCount(parent, node, 0 /* None */); 37373 if (leadingNewlines) { 37374 writeLinesAndIndent(leadingNewlines, false); 37375 } 37376 return !!leadingNewlines; 37377 } 37378 function writeLineSeparatorsAfter(node, parent) { 37379 const trailingNewlines = preserveSourceNewlines && getClosingLineTerminatorCount(parent, node, 0 /* None */, void 0); 37380 if (trailingNewlines) { 37381 writeLine(trailingNewlines); 37382 } 37383 } 37384 function synthesizedNodeStartsOnNewLine(node, format) { 37385 if (nodeIsSynthesized(node)) { 37386 const startsOnNewLine = getStartsOnNewLine(node); 37387 if (startsOnNewLine === void 0) { 37388 return (format & 65536 /* PreferNewLine */) !== 0; 37389 } 37390 return startsOnNewLine; 37391 } 37392 return (format & 65536 /* PreferNewLine */) !== 0; 37393 } 37394 function getLinesBetweenNodes(parent, node1, node2) { 37395 if (getEmitFlags(parent) & 131072 /* NoIndentation */) { 37396 return 0; 37397 } 37398 parent = skipSynthesizedParentheses(parent); 37399 node1 = skipSynthesizedParentheses(node1); 37400 node2 = skipSynthesizedParentheses(node2); 37401 if (getStartsOnNewLine(node2)) { 37402 return 1; 37403 } 37404 if (currentSourceFile && !nodeIsSynthesized(parent) && !nodeIsSynthesized(node1) && !nodeIsSynthesized(node2)) { 37405 if (preserveSourceNewlines) { 37406 return getEffectiveLines( 37407 (includeComments) => getLinesBetweenRangeEndAndRangeStart( 37408 node1, 37409 node2, 37410 currentSourceFile, 37411 includeComments 37412 ) 37413 ); 37414 } 37415 return rangeEndIsOnSameLineAsRangeStart(node1, node2, currentSourceFile) ? 0 : 1; 37416 } 37417 return 0; 37418 } 37419 function isEmptyBlock(block) { 37420 return block.statements.length === 0 && (!currentSourceFile || rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile)); 37421 } 37422 function skipSynthesizedParentheses(node) { 37423 while (node.kind === 217 /* ParenthesizedExpression */ && nodeIsSynthesized(node)) { 37424 node = node.expression; 37425 } 37426 return node; 37427 } 37428 function getTextOfNode2(node, includeTrivia) { 37429 if (isGeneratedIdentifier(node) || isGeneratedPrivateIdentifier(node)) { 37430 return generateName(node); 37431 } 37432 if (isStringLiteral(node) && node.textSourceNode) { 37433 return getTextOfNode2(node.textSourceNode, includeTrivia); 37434 } 37435 const sourceFile = currentSourceFile; 37436 const canUseSourceFile = !!sourceFile && !!node.parent && !nodeIsSynthesized(node) && !(node.flags & -2147483648 /* NoOriginalText */); 37437 if (isMemberName(node)) { 37438 if (!canUseSourceFile || getSourceFileOfNode(node) !== getOriginalNode(sourceFile)) { 37439 return idText(node); 37440 } 37441 } else { 37442 Debug.assertNode(node, isLiteralExpression); 37443 if (!canUseSourceFile) { 37444 return node.text; 37445 } 37446 } 37447 return getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia); 37448 } 37449 function getLiteralTextOfNode(node, neverAsciiEscape, jsxAttributeEscape) { 37450 if (node.kind === 10 /* StringLiteral */ && node.textSourceNode) { 37451 const textSourceNode = node.textSourceNode; 37452 if (isIdentifier(textSourceNode) || isPrivateIdentifier(textSourceNode) || isNumericLiteral(textSourceNode)) { 37453 const text = isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode2(textSourceNode); 37454 return jsxAttributeEscape ? `"${escapeJsxAttributeString(text)}"` : neverAsciiEscape || getEmitFlags(node) & 16777216 /* NoAsciiEscaping */ ? `"${escapeString(text)}"` : `"${escapeNonAsciiString(text)}"`; 37455 } else { 37456 return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape); 37457 } 37458 } 37459 const flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0) | (printerOptions.target && printerOptions.target === 99 /* ESNext */ ? 8 /* AllowNumericSeparator */ : 0); 37460 return getLiteralText(node, currentSourceFile, flags); 37461 } 37462 function pushNameGenerationScope(node) { 37463 if (node && getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { 37464 return; 37465 } 37466 tempFlagsStack.push(tempFlags); 37467 tempFlags = TempFlags.Auto; 37468 privateNameTempFlagsStack.push(privateNameTempFlags); 37469 privateNameTempFlags = TempFlags.Auto; 37470 formattedNameTempFlagsStack.push(formattedNameTempFlags); 37471 formattedNameTempFlags = void 0; 37472 reservedNamesStack.push(reservedNames); 37473 } 37474 function popNameGenerationScope(node) { 37475 if (node && getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { 37476 return; 37477 } 37478 tempFlags = tempFlagsStack.pop(); 37479 privateNameTempFlags = privateNameTempFlagsStack.pop(); 37480 formattedNameTempFlags = formattedNameTempFlagsStack.pop(); 37481 reservedNames = reservedNamesStack.pop(); 37482 } 37483 function reserveNameInNestedScopes(name) { 37484 if (!reservedNames || reservedNames === lastOrUndefined(reservedNamesStack)) { 37485 reservedNames = new Set2(); 37486 } 37487 reservedNames.add(name); 37488 } 37489 function generateNames(node) { 37490 if (!node) 37491 return; 37492 switch (node.kind) { 37493 case 242 /* Block */: 37494 forEach(node.statements, generateNames); 37495 break; 37496 case 257 /* LabeledStatement */: 37497 case 255 /* WithStatement */: 37498 case 247 /* DoStatement */: 37499 case 248 /* WhileStatement */: 37500 generateNames(node.statement); 37501 break; 37502 case 246 /* IfStatement */: 37503 generateNames(node.thenStatement); 37504 generateNames(node.elseStatement); 37505 break; 37506 case 249 /* ForStatement */: 37507 case 251 /* ForOfStatement */: 37508 case 250 /* ForInStatement */: 37509 generateNames(node.initializer); 37510 generateNames(node.statement); 37511 break; 37512 case 256 /* SwitchStatement */: 37513 generateNames(node.caseBlock); 37514 break; 37515 case 272 /* CaseBlock */: 37516 forEach(node.clauses, generateNames); 37517 break; 37518 case 298 /* CaseClause */: 37519 case 299 /* DefaultClause */: 37520 forEach(node.statements, generateNames); 37521 break; 37522 case 259 /* TryStatement */: 37523 generateNames(node.tryBlock); 37524 generateNames(node.catchClause); 37525 generateNames(node.finallyBlock); 37526 break; 37527 case 301 /* CatchClause */: 37528 generateNames(node.variableDeclaration); 37529 generateNames(node.block); 37530 break; 37531 case 244 /* VariableStatement */: 37532 generateNames(node.declarationList); 37533 break; 37534 case 262 /* VariableDeclarationList */: 37535 forEach(node.declarations, generateNames); 37536 break; 37537 case 261 /* VariableDeclaration */: 37538 case 168 /* Parameter */: 37539 case 208 /* BindingElement */: 37540 case 264 /* ClassDeclaration */: 37541 generateNameIfNeeded(node.name); 37542 break; 37543 case 263 /* FunctionDeclaration */: 37544 generateNameIfNeeded(node.name); 37545 if (getEmitFlags(node) & 524288 /* ReuseTempVariableScope */) { 37546 forEach(node.parameters, generateNames); 37547 generateNames(node.body); 37548 } 37549 break; 37550 case 206 /* ObjectBindingPattern */: 37551 case 207 /* ArrayBindingPattern */: 37552 forEach(node.elements, generateNames); 37553 break; 37554 case 275 /* ImportDeclaration */: 37555 generateNames(node.importClause); 37556 break; 37557 case 276 /* ImportClause */: 37558 generateNameIfNeeded(node.name); 37559 generateNames(node.namedBindings); 37560 break; 37561 case 277 /* NamespaceImport */: 37562 generateNameIfNeeded(node.name); 37563 break; 37564 case 283 /* NamespaceExport */: 37565 generateNameIfNeeded(node.name); 37566 break; 37567 case 278 /* NamedImports */: 37568 forEach(node.elements, generateNames); 37569 break; 37570 case 279 /* ImportSpecifier */: 37571 generateNameIfNeeded(node.propertyName || node.name); 37572 break; 37573 } 37574 } 37575 function generateMemberNames(node) { 37576 if (!node) 37577 return; 37578 switch (node.kind) { 37579 case 305 /* PropertyAssignment */: 37580 case 306 /* ShorthandPropertyAssignment */: 37581 case 171 /* PropertyDeclaration */: 37582 case 172 /* AnnotationPropertyDeclaration */: 37583 case 174 /* MethodDeclaration */: 37584 case 177 /* GetAccessor */: 37585 case 178 /* SetAccessor */: 37586 generateNameIfNeeded(node.name); 37587 break; 37588 } 37589 } 37590 function generateNameIfNeeded(name) { 37591 if (name) { 37592 if (isGeneratedIdentifier(name) || isGeneratedPrivateIdentifier(name)) { 37593 generateName(name); 37594 } else if (isBindingPattern(name)) { 37595 generateNames(name); 37596 } 37597 } 37598 } 37599 function generateName(name) { 37600 if ((name.autoGenerateFlags & 7 /* KindMask */) === 4 /* Node */) { 37601 return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), name.autoGenerateFlags, name.autoGeneratePrefix, name.autoGenerateSuffix); 37602 } else { 37603 const autoGenerateId = name.autoGenerateId; 37604 return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name)); 37605 } 37606 } 37607 function generateNameCached(node, privateName, flags, prefix, suffix) { 37608 const nodeId = getNodeId(node); 37609 return nodeIdToGeneratedName[nodeId] || (nodeIdToGeneratedName[nodeId] = generateNameForNode(node, privateName, flags != null ? flags : 0 /* None */, formatGeneratedNamePart(prefix, generateName), formatGeneratedNamePart(suffix))); 37610 } 37611 function isUniqueName(name) { 37612 return isFileLevelUniqueName2(name) && !generatedNames.has(name) && !(reservedNames && reservedNames.has(name)); 37613 } 37614 function isFileLevelUniqueName2(name) { 37615 return currentSourceFile ? isFileLevelUniqueName(currentSourceFile, name, hasGlobalName) : true; 37616 } 37617 function isUniqueLocalName(name, container) { 37618 for (let node = container; isNodeDescendantOf(node, container); node = node.nextContainer) { 37619 if (node.locals) { 37620 const local = node.locals.get(escapeLeadingUnderscores(name)); 37621 if (local && local.flags & (111551 /* Value */ | 1048576 /* ExportValue */ | 2097152 /* Alias */)) { 37622 return false; 37623 } 37624 } 37625 } 37626 return true; 37627 } 37628 function getTempFlags(formattedNameKey) { 37629 var _a2; 37630 switch (formattedNameKey) { 37631 case "": 37632 return tempFlags; 37633 case "#": 37634 return privateNameTempFlags; 37635 default: 37636 return (_a2 = formattedNameTempFlags == null ? void 0 : formattedNameTempFlags.get(formattedNameKey)) != null ? _a2 : TempFlags.Auto; 37637 } 37638 } 37639 function setTempFlags(formattedNameKey, flags) { 37640 switch (formattedNameKey) { 37641 case "": 37642 tempFlags = flags; 37643 break; 37644 case "#": 37645 privateNameTempFlags = flags; 37646 break; 37647 default: 37648 formattedNameTempFlags != null ? formattedNameTempFlags : formattedNameTempFlags = new Map2(); 37649 formattedNameTempFlags.set(formattedNameKey, flags); 37650 break; 37651 } 37652 } 37653 function makeTempVariableName(flags, reservedInNestedScopes, privateName, prefix, suffix) { 37654 if (prefix.length > 0 && prefix.charCodeAt(0) === 35 /* hash */) { 37655 prefix = prefix.slice(1); 37656 } 37657 const key = formatGeneratedName(privateName, prefix, "", suffix); 37658 let tempFlags2 = getTempFlags(key); 37659 if (flags && !(tempFlags2 & flags)) { 37660 const name = flags === TempFlags._i ? "_i" : "_n"; 37661 const fullName = formatGeneratedName(privateName, prefix, name, suffix); 37662 if (isUniqueName(fullName)) { 37663 tempFlags2 |= flags; 37664 if (reservedInNestedScopes) { 37665 reserveNameInNestedScopes(fullName); 37666 } 37667 setTempFlags(key, tempFlags2); 37668 return fullName; 37669 } 37670 } 37671 while (true) { 37672 const count = tempFlags2 & TempFlags.CountMask; 37673 tempFlags2++; 37674 if (count !== 8 && count !== 13) { 37675 const name = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); 37676 const fullName = formatGeneratedName(privateName, prefix, name, suffix); 37677 if (isUniqueName(fullName)) { 37678 if (reservedInNestedScopes) { 37679 reserveNameInNestedScopes(fullName); 37680 } 37681 setTempFlags(key, tempFlags2); 37682 return fullName; 37683 } 37684 } 37685 } 37686 } 37687 function makeUniqueName(baseName, checkFn = isUniqueName, optimistic, scoped, privateName, prefix, suffix) { 37688 if (baseName.length > 0 && baseName.charCodeAt(0) === 35 /* hash */) { 37689 baseName = baseName.slice(1); 37690 } 37691 if (prefix.length > 0 && prefix.charCodeAt(0) === 35 /* hash */) { 37692 prefix = prefix.slice(1); 37693 } 37694 if (optimistic) { 37695 const fullName = formatGeneratedName(privateName, prefix, baseName, suffix); 37696 if (checkFn(fullName)) { 37697 if (scoped) { 37698 reserveNameInNestedScopes(fullName); 37699 } else { 37700 generatedNames.add(fullName); 37701 } 37702 return fullName; 37703 } 37704 } 37705 if (baseName.charCodeAt(baseName.length - 1) !== 95 /* _ */) { 37706 baseName += "_"; 37707 } 37708 let i = 1; 37709 while (true) { 37710 const fullName = formatGeneratedName(privateName, prefix, baseName + i, suffix); 37711 if (checkFn(fullName)) { 37712 if (scoped) { 37713 reserveNameInNestedScopes(fullName); 37714 } else { 37715 generatedNames.add(fullName); 37716 } 37717 return fullName; 37718 } 37719 i++; 37720 } 37721 } 37722 function makeFileLevelOptimisticUniqueName(name) { 37723 return makeUniqueName(name, isFileLevelUniqueName2, true, false, false, "", ""); 37724 } 37725 function generateNameForModuleOrEnum(node) { 37726 const name = getTextOfNode2(node.name); 37727 return isUniqueLocalName(name, node) ? name : makeUniqueName(name, isUniqueName, false, false, false, "", ""); 37728 } 37729 function generateNameForImportOrExportDeclaration(node) { 37730 const expr = getExternalModuleName(node); 37731 const baseName = isStringLiteral(expr) ? makeIdentifierFromModuleName(expr.text) : "module"; 37732 return makeUniqueName(baseName, isUniqueName, false, false, false, "", ""); 37733 } 37734 function generateNameForExportDefault() { 37735 return makeUniqueName("default", isUniqueName, false, false, false, "", ""); 37736 } 37737 function generateNameForClassExpression() { 37738 return makeUniqueName("class", isUniqueName, false, false, false, "", ""); 37739 } 37740 function generateNameForMethodOrAccessor(node, privateName, prefix, suffix) { 37741 if (isIdentifier(node.name)) { 37742 return generateNameCached(node.name, privateName); 37743 } 37744 return makeTempVariableName(TempFlags.Auto, false, privateName, prefix, suffix); 37745 } 37746 function generateNameForNode(node, privateName, flags, prefix, suffix) { 37747 switch (node.kind) { 37748 case 79 /* Identifier */: 37749 case 80 /* PrivateIdentifier */: 37750 return makeUniqueName( 37751 getTextOfNode2(node), 37752 isUniqueName, 37753 !!(flags & 16 /* Optimistic */), 37754 !!(flags & 8 /* ReservedInNestedScopes */), 37755 privateName, 37756 prefix, 37757 suffix 37758 ); 37759 case 270 /* ModuleDeclaration */: 37760 case 269 /* EnumDeclaration */: 37761 Debug.assert(!prefix && !suffix && !privateName); 37762 return generateNameForModuleOrEnum(node); 37763 case 275 /* ImportDeclaration */: 37764 case 281 /* ExportDeclaration */: 37765 Debug.assert(!prefix && !suffix && !privateName); 37766 return generateNameForImportOrExportDeclaration(node); 37767 case 263 /* FunctionDeclaration */: 37768 case 264 /* ClassDeclaration */: 37769 case 280 /* ExportAssignment */: 37770 Debug.assert(!prefix && !suffix && !privateName); 37771 return generateNameForExportDefault(); 37772 case 232 /* ClassExpression */: 37773 Debug.assert(!prefix && !suffix && !privateName); 37774 return generateNameForClassExpression(); 37775 case 174 /* MethodDeclaration */: 37776 case 177 /* GetAccessor */: 37777 case 178 /* SetAccessor */: 37778 return generateNameForMethodOrAccessor(node, privateName, prefix, suffix); 37779 case 166 /* ComputedPropertyName */: 37780 return makeTempVariableName(TempFlags.Auto, true, privateName, prefix, suffix); 37781 default: 37782 return makeTempVariableName(TempFlags.Auto, false, privateName, prefix, suffix); 37783 } 37784 } 37785 function makeName(name) { 37786 const prefix = formatGeneratedNamePart(name.autoGeneratePrefix, generateName); 37787 const suffix = formatGeneratedNamePart(name.autoGenerateSuffix); 37788 switch (name.autoGenerateFlags & 7 /* KindMask */) { 37789 case 1 /* Auto */: 37790 return makeTempVariableName(TempFlags.Auto, !!(name.autoGenerateFlags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix); 37791 case 2 /* Loop */: 37792 Debug.assertNode(name, isIdentifier); 37793 return makeTempVariableName(TempFlags._i, !!(name.autoGenerateFlags & 8 /* ReservedInNestedScopes */), false, prefix, suffix); 37794 case 3 /* Unique */: 37795 return makeUniqueName( 37796 idText(name), 37797 name.autoGenerateFlags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName, 37798 !!(name.autoGenerateFlags & 16 /* Optimistic */), 37799 !!(name.autoGenerateFlags & 8 /* ReservedInNestedScopes */), 37800 isPrivateIdentifier(name), 37801 prefix, 37802 suffix 37803 ); 37804 } 37805 return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum(name.autoGenerateFlags & 7 /* KindMask */, GeneratedIdentifierFlags, true)}.`); 37806 } 37807 function pipelineEmitWithComments(hint, node) { 37808 const pipelinePhase = getNextPipelinePhase(2 /* Comments */, hint, node); 37809 const savedContainerPos = containerPos; 37810 const savedContainerEnd = containerEnd; 37811 const savedDeclarationListContainerEnd = declarationListContainerEnd; 37812 if (needToKeepComments(node)) { 37813 emitCommentsBeforeNode(node); 37814 } 37815 pipelinePhase(hint, node); 37816 emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); 37817 } 37818 function needToKeepComments(node) { 37819 var _a2; 37820 if (removeCommentsCollection === void 0 && universalRemoveCommentsCollection === void 0) { 37821 return true; 37822 } 37823 let escapedText = (_a2 = node == null ? void 0 : node.name) == null ? void 0 : _a2.escapedText; 37824 if (!escapedText) { 37825 return false; 37826 } 37827 if (removeCommentsCollection == null ? void 0 : removeCommentsCollection.includes(escapedText)) { 37828 return true; 37829 } 37830 if (universalRemoveCommentsCollection) { 37831 return isMatchWildcard(universalRemoveCommentsCollection, escapedText); 37832 } 37833 return false; 37834 } 37835 function isMatchWildcard(wildcardArray, item) { 37836 for (const wildcard of wildcardArray) { 37837 if (wildcard.test(item)) { 37838 return true; 37839 } 37840 } 37841 return false; 37842 } 37843 function emitCommentsBeforeNode(node) { 37844 const emitFlags = getEmitFlags(node); 37845 const commentRange = getCommentRange(node); 37846 emitLeadingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end); 37847 if (emitFlags & 2048 /* NoNestedComments */) { 37848 commentsDisabled = true; 37849 } 37850 } 37851 function emitCommentsAfterNode(node, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) { 37852 const emitFlags = getEmitFlags(node); 37853 const commentRange = getCommentRange(node); 37854 if (emitFlags & 2048 /* NoNestedComments */) { 37855 commentsDisabled = false; 37856 } 37857 emitTrailingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); 37858 const typeNode = getTypeNode(node); 37859 if (typeNode) { 37860 emitTrailingCommentsOfNode(node, emitFlags, typeNode.pos, typeNode.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd); 37861 } 37862 } 37863 function emitLeadingCommentsOfNode(node, emitFlags, pos, end) { 37864 enterComment(); 37865 hasWrittenComment = false; 37866 const skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 11 /* JsxText */; 37867 const skipTrailingComments = end < 0 || (emitFlags & 1024 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */; 37868 if ((pos > 0 || end > 0) && pos !== end) { 37869 if (!skipLeadingComments) { 37870 emitLeadingComments(pos, node.kind !== 358 /* NotEmittedStatement */); 37871 } 37872 if (!skipLeadingComments || pos >= 0 && (emitFlags & 512 /* NoLeadingComments */) !== 0) { 37873 containerPos = pos; 37874 } 37875 if (!skipTrailingComments || end >= 0 && (emitFlags & 1024 /* NoTrailingComments */) !== 0) { 37876 containerEnd = end; 37877 if (node.kind === 262 /* VariableDeclarationList */) { 37878 declarationListContainerEnd = end; 37879 } 37880 } 37881 } 37882 forEach(getSyntheticLeadingComments(node), emitLeadingSynthesizedComment); 37883 exitComment(); 37884 } 37885 function emitTrailingCommentsOfNode(node, emitFlags, pos, end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd) { 37886 enterComment(); 37887 const skipTrailingComments = end < 0 || (emitFlags & 1024 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */; 37888 forEach(getSyntheticTrailingComments(node), emitTrailingSynthesizedComment); 37889 if ((pos > 0 || end > 0) && pos !== end) { 37890 containerPos = savedContainerPos; 37891 containerEnd = savedContainerEnd; 37892 declarationListContainerEnd = savedDeclarationListContainerEnd; 37893 if (!skipTrailingComments && node.kind !== 358 /* NotEmittedStatement */) { 37894 emitTrailingComments(end); 37895 } 37896 } 37897 exitComment(); 37898 } 37899 function emitLeadingSynthesizedComment(comment) { 37900 if (comment.hasLeadingNewline || comment.kind === 2 /* SingleLineCommentTrivia */) { 37901 writer.writeLine(); 37902 } 37903 writeSynthesizedComment(comment); 37904 if (comment.hasTrailingNewLine || comment.kind === 2 /* SingleLineCommentTrivia */) { 37905 writer.writeLine(); 37906 } else { 37907 writer.writeSpace(" "); 37908 } 37909 } 37910 function emitTrailingSynthesizedComment(comment) { 37911 if (!writer.isAtStartOfLine()) { 37912 writer.writeSpace(" "); 37913 } 37914 writeSynthesizedComment(comment); 37915 if (comment.hasTrailingNewLine) { 37916 writer.writeLine(); 37917 } 37918 } 37919 function writeSynthesizedComment(comment) { 37920 const text = formatSynthesizedComment(comment); 37921 const lineMap = comment.kind === 3 /* MultiLineCommentTrivia */ ? computeLineStarts(text) : void 0; 37922 writeCommentRange(text, lineMap, writer, 0, text.length, newLine); 37923 } 37924 function formatSynthesizedComment(comment) { 37925 return comment.kind === 3 /* MultiLineCommentTrivia */ ? `/*${comment.text}*/` : `//${comment.text}`; 37926 } 37927 function emitBodyWithDetachedComments(node, detachedRange, emitCallback) { 37928 enterComment(); 37929 const { pos, end } = detachedRange; 37930 const emitFlags = getEmitFlags(node); 37931 const skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0; 37932 const skipTrailingComments = commentsDisabled || end < 0 || (emitFlags & 1024 /* NoTrailingComments */) !== 0; 37933 if (!skipLeadingComments) { 37934 emitDetachedCommentsAndUpdateCommentsInfo(detachedRange); 37935 } 37936 exitComment(); 37937 if (emitFlags & 2048 /* NoNestedComments */ && !commentsDisabled) { 37938 commentsDisabled = true; 37939 emitCallback(node); 37940 commentsDisabled = false; 37941 } else { 37942 emitCallback(node); 37943 } 37944 enterComment(); 37945 if (!skipTrailingComments) { 37946 emitLeadingComments(detachedRange.end, true); 37947 if (hasWrittenComment && !writer.isAtStartOfLine()) { 37948 writer.writeLine(); 37949 } 37950 } 37951 exitComment(); 37952 } 37953 function originalNodesHaveSameParent(nodeA, nodeB) { 37954 nodeA = getOriginalNode(nodeA); 37955 return nodeA.parent && nodeA.parent === getOriginalNode(nodeB).parent; 37956 } 37957 function siblingNodePositionsAreComparable(previousNode, nextNode) { 37958 if (nextNode.pos < previousNode.end) { 37959 return false; 37960 } 37961 previousNode = getOriginalNode(previousNode); 37962 nextNode = getOriginalNode(nextNode); 37963 const parent = previousNode.parent; 37964 if (!parent || parent !== nextNode.parent) { 37965 return false; 37966 } 37967 const parentNodeArray = getContainingNodeArray(previousNode); 37968 const prevNodeIndex = parentNodeArray == null ? void 0 : parentNodeArray.indexOf(previousNode); 37969 return prevNodeIndex !== void 0 && prevNodeIndex > -1 && parentNodeArray.indexOf(nextNode) === prevNodeIndex + 1; 37970 } 37971 function emitLeadingComments(pos, isEmittedNode) { 37972 hasWrittenComment = false; 37973 if (isEmittedNode) { 37974 if (pos === 0 && (currentSourceFile == null ? void 0 : currentSourceFile.isDeclarationFile)) { 37975 forEachLeadingCommentToEmit(pos, emitNonTripleSlashLeadingComment); 37976 } else { 37977 forEachLeadingCommentToEmit(pos, emitLeadingComment); 37978 } 37979 } else if (pos === 0) { 37980 forEachLeadingCommentToEmit(pos, emitTripleSlashLeadingComment); 37981 } 37982 } 37983 function emitTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { 37984 if (isTripleSlashComment(commentPos, commentEnd)) { 37985 emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); 37986 } 37987 } 37988 function emitNonTripleSlashLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { 37989 if (!isTripleSlashComment(commentPos, commentEnd)) { 37990 emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos); 37991 } 37992 } 37993 function shouldWriteComment(text, pos) { 37994 if (printerOptions.onlyPrintJsDocStyle) { 37995 return isJSDocLikeText(text, pos) || isPinnedComment(text, pos); 37996 } 37997 return true; 37998 } 37999 function emitLeadingComment(commentPos, commentEnd, kind, hasTrailingNewLine, rangePos) { 38000 if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) 38001 return; 38002 if (!hasWrittenComment) { 38003 emitNewLineBeforeLeadingCommentOfPosition(getCurrentLineMap(), writer, rangePos, commentPos); 38004 hasWrittenComment = true; 38005 } 38006 emitPos(commentPos); 38007 writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); 38008 emitPos(commentEnd); 38009 if (hasTrailingNewLine) { 38010 writer.writeLine(); 38011 } else if (kind === 3 /* MultiLineCommentTrivia */) { 38012 writer.writeSpace(" "); 38013 } 38014 } 38015 function emitLeadingCommentsOfPosition(pos) { 38016 if (commentsDisabled || pos === -1) { 38017 return; 38018 } 38019 emitLeadingComments(pos, true); 38020 } 38021 function emitTrailingComments(pos) { 38022 forEachTrailingCommentToEmit(pos, emitTrailingComment); 38023 } 38024 function emitTrailingComment(commentPos, commentEnd, _kind, hasTrailingNewLine) { 38025 if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) 38026 return; 38027 if (!writer.isAtStartOfLine()) { 38028 writer.writeSpace(" "); 38029 } 38030 emitPos(commentPos); 38031 writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); 38032 emitPos(commentEnd); 38033 if (hasTrailingNewLine) { 38034 writer.writeLine(); 38035 } 38036 } 38037 function emitTrailingCommentsOfPosition(pos, prefixSpace, forceNoNewline) { 38038 if (commentsDisabled) { 38039 return; 38040 } 38041 enterComment(); 38042 forEachTrailingCommentToEmit(pos, prefixSpace ? emitTrailingComment : forceNoNewline ? emitTrailingCommentOfPositionNoNewline : emitTrailingCommentOfPosition); 38043 exitComment(); 38044 } 38045 function emitTrailingCommentOfPositionNoNewline(commentPos, commentEnd, kind) { 38046 if (!currentSourceFile) 38047 return; 38048 emitPos(commentPos); 38049 writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); 38050 emitPos(commentEnd); 38051 if (kind === 2 /* SingleLineCommentTrivia */) { 38052 writer.writeLine(); 38053 } 38054 } 38055 function emitTrailingCommentOfPosition(commentPos, commentEnd, _kind, hasTrailingNewLine) { 38056 if (!currentSourceFile) 38057 return; 38058 emitPos(commentPos); 38059 writeCommentRange(currentSourceFile.text, getCurrentLineMap(), writer, commentPos, commentEnd, newLine); 38060 emitPos(commentEnd); 38061 if (hasTrailingNewLine) { 38062 writer.writeLine(); 38063 } else { 38064 writer.writeSpace(" "); 38065 } 38066 } 38067 function forEachLeadingCommentToEmit(pos, cb) { 38068 if (currentSourceFile && (containerPos === -1 || pos !== containerPos)) { 38069 if (hasDetachedComments(pos)) { 38070 forEachLeadingCommentWithoutDetachedComments(cb); 38071 } else { 38072 forEachLeadingCommentRange(currentSourceFile.text, pos, cb, pos); 38073 } 38074 } 38075 } 38076 function forEachTrailingCommentToEmit(end, cb) { 38077 if (currentSourceFile && (containerEnd === -1 || end !== containerEnd && end !== declarationListContainerEnd)) { 38078 forEachTrailingCommentRange(currentSourceFile.text, end, cb); 38079 } 38080 } 38081 function hasDetachedComments(pos) { 38082 return detachedCommentsInfo !== void 0 && last(detachedCommentsInfo).nodePos === pos; 38083 } 38084 function forEachLeadingCommentWithoutDetachedComments(cb) { 38085 if (!currentSourceFile) 38086 return; 38087 const pos = last(detachedCommentsInfo).detachedCommentEndPos; 38088 if (detachedCommentsInfo.length - 1) { 38089 detachedCommentsInfo.pop(); 38090 } else { 38091 detachedCommentsInfo = void 0; 38092 } 38093 forEachLeadingCommentRange(currentSourceFile.text, pos, cb, pos); 38094 } 38095 function emitDetachedCommentsAndUpdateCommentsInfo(range) { 38096 const currentDetachedCommentInfo = currentSourceFile && emitDetachedComments(currentSourceFile.text, getCurrentLineMap(), writer, emitComment, range, newLine, commentsDisabled); 38097 if (currentDetachedCommentInfo) { 38098 if (detachedCommentsInfo) { 38099 detachedCommentsInfo.push(currentDetachedCommentInfo); 38100 } else { 38101 detachedCommentsInfo = [currentDetachedCommentInfo]; 38102 } 38103 } 38104 } 38105 function emitComment(text, lineMap, writer2, commentPos, commentEnd, newLine2) { 38106 if (!currentSourceFile || !shouldWriteComment(currentSourceFile.text, commentPos)) 38107 return; 38108 emitPos(commentPos); 38109 writeCommentRange(text, lineMap, writer2, commentPos, commentEnd, newLine2); 38110 emitPos(commentEnd); 38111 } 38112 function isTripleSlashComment(commentPos, commentEnd) { 38113 return !!currentSourceFile && isRecognizedTripleSlashComment(currentSourceFile.text, commentPos, commentEnd); 38114 } 38115 function getParsedSourceMap(node) { 38116 if (node.parsedSourceMap === void 0 && node.sourceMapText !== void 0) { 38117 node.parsedSourceMap = tryParseRawSourceMap(node.sourceMapText) || false; 38118 } 38119 return node.parsedSourceMap || void 0; 38120 } 38121 function pipelineEmitWithSourceMaps(hint, node) { 38122 const pipelinePhase = getNextPipelinePhase(3 /* SourceMaps */, hint, node); 38123 emitSourceMapsBeforeNode(node); 38124 pipelinePhase(hint, node); 38125 emitSourceMapsAfterNode(node); 38126 } 38127 function emitSourceMapsBeforeNode(node) { 38128 const emitFlags = getEmitFlags(node); 38129 const sourceMapRange = getSourceMapRange(node); 38130 if (isUnparsedNode(node)) { 38131 Debug.assertIsDefined(node.parent, "UnparsedNodes must have parent pointers"); 38132 const parsed = getParsedSourceMap(node.parent); 38133 if (parsed && sourceMapGenerator) { 38134 sourceMapGenerator.appendSourceMap( 38135 writer.getLine(), 38136 writer.getColumn(), 38137 parsed, 38138 node.parent.sourceMapPath, 38139 node.parent.getLineAndCharacterOfPosition(node.pos), 38140 node.parent.getLineAndCharacterOfPosition(node.end) 38141 ); 38142 } 38143 } else { 38144 const source = sourceMapRange.source || sourceMapSource; 38145 if (node.kind !== 358 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) { 38146 emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos)); 38147 } 38148 if (emitFlags & 64 /* NoNestedSourceMaps */) { 38149 sourceMapsDisabled = true; 38150 } 38151 } 38152 } 38153 function emitSourceMapsAfterNode(node) { 38154 const emitFlags = getEmitFlags(node); 38155 const sourceMapRange = getSourceMapRange(node); 38156 if (!isUnparsedNode(node)) { 38157 if (emitFlags & 64 /* NoNestedSourceMaps */) { 38158 sourceMapsDisabled = false; 38159 } 38160 if (node.kind !== 358 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) { 38161 emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end); 38162 } 38163 } 38164 } 38165 function skipSourceTrivia(source, pos) { 38166 return source.skipTrivia ? source.skipTrivia(pos) : skipTrivia(source.text, pos); 38167 } 38168 function emitPos(pos) { 38169 if (sourceMapsDisabled || positionIsSynthesized(pos) || isJsonSourceMapSource(sourceMapSource)) { 38170 return; 38171 } 38172 const { line: sourceLine, character: sourceCharacter } = getLineAndCharacterOfPosition(sourceMapSource, pos); 38173 sourceMapGenerator.addMapping( 38174 writer.getLine(), 38175 writer.getColumn(), 38176 sourceMapSourceIndex, 38177 sourceLine, 38178 sourceCharacter, 38179 void 0 38180 ); 38181 } 38182 function emitSourcePos(source, pos) { 38183 if (source !== sourceMapSource) { 38184 const savedSourceMapSource = sourceMapSource; 38185 const savedSourceMapSourceIndex = sourceMapSourceIndex; 38186 setSourceMapSource(source); 38187 emitPos(pos); 38188 resetSourceMapSource(savedSourceMapSource, savedSourceMapSourceIndex); 38189 } else { 38190 emitPos(pos); 38191 } 38192 } 38193 function emitTokenWithSourceMap(node, token, writer2, tokenPos, emitCallback) { 38194 if (sourceMapsDisabled || node && isInJsonFile(node)) { 38195 return emitCallback(token, writer2, tokenPos); 38196 } 38197 const emitNode = node && node.emitNode; 38198 const emitFlags = emitNode && emitNode.flags || 0 /* None */; 38199 const range = emitNode && emitNode.tokenSourceMapRanges && emitNode.tokenSourceMapRanges[token]; 38200 const source = range && range.source || sourceMapSource; 38201 tokenPos = skipSourceTrivia(source, range ? range.pos : tokenPos); 38202 if ((emitFlags & 128 /* NoTokenLeadingSourceMaps */) === 0 && tokenPos >= 0) { 38203 emitSourcePos(source, tokenPos); 38204 } 38205 tokenPos = emitCallback(token, writer2, tokenPos); 38206 if (range) 38207 tokenPos = range.end; 38208 if ((emitFlags & 256 /* NoTokenTrailingSourceMaps */) === 0 && tokenPos >= 0) { 38209 emitSourcePos(source, tokenPos); 38210 } 38211 return tokenPos; 38212 } 38213 function setSourceMapSource(source) { 38214 if (sourceMapsDisabled) { 38215 return; 38216 } 38217 sourceMapSource = source; 38218 if (source === mostRecentlyAddedSourceMapSource) { 38219 sourceMapSourceIndex = mostRecentlyAddedSourceMapSourceIndex; 38220 return; 38221 } 38222 if (isJsonSourceMapSource(source)) { 38223 return; 38224 } 38225 sourceMapSourceIndex = sourceMapGenerator.addSource(source.fileName); 38226 if (printerOptions.inlineSources) { 38227 sourceMapGenerator.setSourceContent(sourceMapSourceIndex, source.text); 38228 } 38229 mostRecentlyAddedSourceMapSource = source; 38230 mostRecentlyAddedSourceMapSourceIndex = sourceMapSourceIndex; 38231 } 38232 function resetSourceMapSource(source, sourceIndex) { 38233 sourceMapSource = source; 38234 sourceMapSourceIndex = sourceIndex; 38235 } 38236 function isJsonSourceMapSource(sourceFile) { 38237 return fileExtensionIs(sourceFile.fileName, ".json" /* Json */); 38238 } 38239} 38240function createBracketsMap() { 38241 const brackets2 = []; 38242 brackets2[1024 /* Braces */] = ["{", "}"]; 38243 brackets2[2048 /* Parenthesis */] = ["(", ")"]; 38244 brackets2[4096 /* AngleBrackets */] = ["<", ">"]; 38245 brackets2[8192 /* SquareBrackets */] = ["[", "]"]; 38246 return brackets2; 38247} 38248function getOpeningBracket(format) { 38249 return brackets[format & 15360 /* BracketsMask */][0]; 38250} 38251function getClosingBracket(format) { 38252 return brackets[format & 15360 /* BracketsMask */][1]; 38253} 38254var TempFlags = /* @__PURE__ */ ((TempFlags2) => { 38255 TempFlags2[TempFlags2["Auto"] = 0] = "Auto"; 38256 TempFlags2[TempFlags2["CountMask"] = 268435455] = "CountMask"; 38257 TempFlags2[TempFlags2["_i"] = 268435456] = "_i"; 38258 return TempFlags2; 38259})(TempFlags || {}); 38260function emitListItemNoParenthesizer(node, emit, _parenthesizerRule, _index) { 38261 emit(node); 38262} 38263function emitListItemWithParenthesizerRuleSelector(node, emit, parenthesizerRuleSelector, index) { 38264 emit(node, parenthesizerRuleSelector.select(index)); 38265} 38266function emitListItemWithParenthesizerRule(node, emit, parenthesizerRule, _index) { 38267 emit(node, parenthesizerRule); 38268} 38269function getEmitListItem(emit, parenthesizerRule) { 38270 return emit.length === 1 ? emitListItemNoParenthesizer : typeof parenthesizerRule === "object" ? emitListItemWithParenthesizerRuleSelector : emitListItemWithParenthesizerRule; 38271} 38272 38273// src/compiler/watchUtilities.ts 38274function getWatchFactory(host, watchLogLevel, log2, getDetailWatchInfo2) { 38275 setSysLog(watchLogLevel === 2 /* Verbose */ ? log2 : noop); 38276 const plainInvokeFactory = { 38277 watchFile: (file, callback, pollingInterval, options) => host.watchFile(file, callback, pollingInterval, options), 38278 watchDirectory: (directory, callback, flags, options) => host.watchDirectory(directory, callback, (flags & 1 /* Recursive */) !== 0, options) 38279 }; 38280 const triggerInvokingFactory = watchLogLevel !== 0 /* None */ ? { 38281 watchFile: createTriggerLoggingAddWatch("watchFile"), 38282 watchDirectory: createTriggerLoggingAddWatch("watchDirectory") 38283 } : void 0; 38284 const factory2 = watchLogLevel === 2 /* Verbose */ ? { 38285 watchFile: createFileWatcherWithLogging, 38286 watchDirectory: createDirectoryWatcherWithLogging 38287 } : triggerInvokingFactory || plainInvokeFactory; 38288 const excludeWatcherFactory = watchLogLevel === 2 /* Verbose */ ? createExcludeWatcherWithLogging : returnNoopFileWatcher; 38289 return { 38290 watchFile: createExcludeHandlingAddWatch("watchFile"), 38291 watchDirectory: createExcludeHandlingAddWatch("watchDirectory") 38292 }; 38293 function createExcludeHandlingAddWatch(key) { 38294 return (file, cb, flags, options, detailInfo1, detailInfo2) => { 38295 var _a2; 38296 return !matchesExclude(file, key === "watchFile" ? options == null ? void 0 : options.excludeFiles : options == null ? void 0 : options.excludeDirectories, useCaseSensitiveFileNames(), ((_a2 = host.getCurrentDirectory) == null ? void 0 : _a2.call(host)) || "") ? factory2[key].call(void 0, file, cb, flags, options, detailInfo1, detailInfo2) : excludeWatcherFactory(file, flags, options, detailInfo1, detailInfo2); 38297 }; 38298 } 38299 function useCaseSensitiveFileNames() { 38300 return typeof host.useCaseSensitiveFileNames === "boolean" ? host.useCaseSensitiveFileNames : host.useCaseSensitiveFileNames(); 38301 } 38302 function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) { 38303 log2(`ExcludeWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`); 38304 return { 38305 close: () => log2(`ExcludeWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`) 38306 }; 38307 } 38308 function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) { 38309 log2(`FileWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`); 38310 const watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2); 38311 return { 38312 close: () => { 38313 log2(`FileWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`); 38314 watcher.close(); 38315 } 38316 }; 38317 } 38318 function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) { 38319 const watchInfo = `DirectoryWatcher:: Added:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`; 38320 log2(watchInfo); 38321 const start = timestamp(); 38322 const watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2); 38323 const elapsed = timestamp() - start; 38324 log2(`Elapsed:: ${elapsed}ms ${watchInfo}`); 38325 return { 38326 close: () => { 38327 const watchInfo2 = `DirectoryWatcher:: Close:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`; 38328 log2(watchInfo2); 38329 const start2 = timestamp(); 38330 watcher.close(); 38331 const elapsed2 = timestamp() - start2; 38332 log2(`Elapsed:: ${elapsed2}ms ${watchInfo2}`); 38333 } 38334 }; 38335 } 38336 function createTriggerLoggingAddWatch(key) { 38337 return (file, cb, flags, options, detailInfo1, detailInfo2) => plainInvokeFactory[key].call(void 0, file, (...args) => { 38338 const triggerredInfo = `${key === "watchFile" ? "FileWatcher" : "DirectoryWatcher"}:: Triggered with ${args[0]} ${args[1] !== void 0 ? args[1] : ""}:: ${getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo2)}`; 38339 log2(triggerredInfo); 38340 const start = timestamp(); 38341 cb.call(void 0, ...args); 38342 const elapsed = timestamp() - start; 38343 log2(`Elapsed:: ${elapsed}ms ${triggerredInfo}`); 38344 }, flags, options, detailInfo1, detailInfo2); 38345 } 38346 function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo3) { 38347 return `WatchInfo: ${file} ${flags} ${JSON.stringify(options)} ${getDetailWatchInfo3 ? getDetailWatchInfo3(detailInfo1, detailInfo2) : detailInfo2 === void 0 ? detailInfo1 : `${detailInfo1} ${detailInfo2}`}`; 38348 } 38349} 38350function getFallbackOptions(options) { 38351 const fallbackPolling = options == null ? void 0 : options.fallbackPolling; 38352 return { 38353 watchFile: fallbackPolling !== void 0 ? fallbackPolling : 1 /* PriorityPollingInterval */ 38354 }; 38355} 38356function closeFileWatcherOf(objWithWatcher) { 38357 objWithWatcher.watcher.close(); 38358} 38359 38360// src/compiler/program.ts 38361function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, getCanonicalFileName) { 38362 let commonPathComponents; 38363 const failed = forEach(fileNames, (sourceFile) => { 38364 const sourcePathComponents = getNormalizedPathComponents(sourceFile, currentDirectory); 38365 sourcePathComponents.pop(); 38366 if (!commonPathComponents) { 38367 commonPathComponents = sourcePathComponents; 38368 return; 38369 } 38370 const n = Math.min(commonPathComponents.length, sourcePathComponents.length); 38371 for (let i = 0; i < n; i++) { 38372 if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) { 38373 if (i === 0) { 38374 return true; 38375 } 38376 commonPathComponents.length = i; 38377 break; 38378 } 38379 } 38380 if (sourcePathComponents.length < commonPathComponents.length) { 38381 commonPathComponents.length = sourcePathComponents.length; 38382 } 38383 }); 38384 if (failed) { 38385 return ""; 38386 } 38387 if (!commonPathComponents) { 38388 return currentDirectory; 38389 } 38390 return getPathFromPathComponents(commonPathComponents); 38391} 38392var plainJSErrors = new Set2([ 38393 Diagnostics.Cannot_redeclare_block_scoped_variable_0.code, 38394 Diagnostics.A_module_cannot_have_multiple_default_exports.code, 38395 Diagnostics.Another_export_default_is_here.code, 38396 Diagnostics.The_first_export_default_is_here.code, 38397 Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code, 38398 Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code, 38399 Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code, 38400 Diagnostics.constructor_is_a_reserved_word.code, 38401 Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode.code, 38402 Diagnostics.Code_contained_in_a_class_is_evaluated_in_JavaScript_s_strict_mode_which_does_not_allow_this_use_of_0_For_more_information_see_https_Colon_Slash_Slashdeveloper_mozilla_org_Slashen_US_Slashdocs_SlashWeb_SlashJavaScript_SlashReference_SlashStrict_mode.code, 38403 Diagnostics.Invalid_use_of_0_Modules_are_automatically_in_strict_mode.code, 38404 Diagnostics.Invalid_use_of_0_in_strict_mode.code, 38405 Diagnostics.A_label_is_not_allowed_here.code, 38406 Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code, 38407 Diagnostics.with_statements_are_not_allowed_in_strict_mode.code, 38408 Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code, 38409 Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code, 38410 Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code, 38411 Diagnostics.A_class_member_cannot_have_the_0_keyword.code, 38412 Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code, 38413 Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code, 38414 Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code, 38415 Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code, 38416 Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code, 38417 Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code, 38418 Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code, 38419 Diagnostics.A_destructuring_declaration_must_have_an_initializer.code, 38420 Diagnostics.A_get_accessor_cannot_have_parameters.code, 38421 Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code, 38422 Diagnostics.A_rest_element_cannot_have_a_property_name.code, 38423 Diagnostics.A_rest_element_cannot_have_an_initializer.code, 38424 Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code, 38425 Diagnostics.A_rest_parameter_cannot_have_an_initializer.code, 38426 Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code, 38427 Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code, 38428 Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code, 38429 Diagnostics.A_set_accessor_cannot_have_rest_parameter.code, 38430 Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code, 38431 Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module.code, 38432 Diagnostics.An_export_declaration_cannot_have_modifiers.code, 38433 Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module.code, 38434 Diagnostics.An_import_declaration_cannot_have_modifiers.code, 38435 Diagnostics.An_object_member_cannot_be_declared_optional.code, 38436 Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code, 38437 Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code, 38438 Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code, 38439 Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code, 38440 Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code, 38441 Diagnostics.Classes_can_only_extend_a_single_class.code, 38442 Diagnostics.Classes_may_not_have_a_field_named_constructor.code, 38443 Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code, 38444 Diagnostics.Duplicate_label_0.code, 38445 Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code, 38446 Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code, 38447 Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code, 38448 Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code, 38449 Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code, 38450 Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code, 38451 Diagnostics.Jump_target_cannot_cross_function_boundary.code, 38452 Diagnostics.Line_terminator_not_permitted_before_arrow.code, 38453 Diagnostics.Modifiers_cannot_appear_here.code, 38454 Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code, 38455 Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code, 38456 Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code, 38457 Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code, 38458 Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code, 38459 Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code, 38460 Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code, 38461 Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code, 38462 Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code, 38463 Diagnostics.Trailing_comma_not_allowed.code, 38464 Diagnostics.Variable_declaration_list_cannot_be_empty.code, 38465 Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code, 38466 Diagnostics._0_expected.code, 38467 Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code, 38468 Diagnostics._0_list_cannot_be_empty.code, 38469 Diagnostics._0_modifier_already_seen.code, 38470 Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code, 38471 Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code, 38472 Diagnostics._0_modifier_cannot_appear_on_a_parameter.code, 38473 Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code, 38474 Diagnostics._0_modifier_cannot_be_used_here.code, 38475 Diagnostics._0_modifier_must_precede_1_modifier.code, 38476 Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code, 38477 Diagnostics.const_declarations_must_be_initialized.code, 38478 Diagnostics.extends_clause_already_seen.code, 38479 Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code, 38480 Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code, 38481 Diagnostics.Class_constructor_may_not_be_a_generator.code, 38482 Diagnostics.Class_constructor_may_not_be_an_accessor.code, 38483 Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code 38484]); 38485 38486// src/compiler/builderState.ts 38487var BuilderState; 38488((BuilderState2) => { 38489 function createManyToManyPathMap() { 38490 function create2(forward, reverse, deleted) { 38491 const map2 = { 38492 getKeys: (v) => reverse.get(v), 38493 getValues: (k) => forward.get(k), 38494 keys: () => forward.keys(), 38495 deleteKey: (k) => { 38496 (deleted || (deleted = new Set2())).add(k); 38497 const set = forward.get(k); 38498 if (!set) { 38499 return false; 38500 } 38501 set.forEach((v) => deleteFromMultimap(reverse, v, k)); 38502 forward.delete(k); 38503 return true; 38504 }, 38505 set: (k, vSet) => { 38506 deleted == null ? void 0 : deleted.delete(k); 38507 const existingVSet = forward.get(k); 38508 forward.set(k, vSet); 38509 existingVSet == null ? void 0 : existingVSet.forEach((v) => { 38510 if (!vSet.has(v)) { 38511 deleteFromMultimap(reverse, v, k); 38512 } 38513 }); 38514 vSet.forEach((v) => { 38515 if (!(existingVSet == null ? void 0 : existingVSet.has(v))) { 38516 addToMultimap(reverse, v, k); 38517 } 38518 }); 38519 return map2; 38520 } 38521 }; 38522 return map2; 38523 } 38524 return create2(new Map2(), new Map2(), void 0); 38525 } 38526 BuilderState2.createManyToManyPathMap = createManyToManyPathMap; 38527 function addToMultimap(map2, k, v) { 38528 let set = map2.get(k); 38529 if (!set) { 38530 set = new Set2(); 38531 map2.set(k, set); 38532 } 38533 set.add(v); 38534 } 38535 function deleteFromMultimap(map2, k, v) { 38536 const set = map2.get(k); 38537 if (set == null ? void 0 : set.delete(v)) { 38538 if (!set.size) { 38539 map2.delete(k); 38540 } 38541 return true; 38542 } 38543 return false; 38544 } 38545 function getReferencedFilesFromImportedModuleSymbol(symbol) { 38546 return mapDefined(symbol.declarations, (declaration) => { 38547 var _a2; 38548 return (_a2 = getSourceFileOfNode(declaration)) == null ? void 0 : _a2.resolvedPath; 38549 }); 38550 } 38551 function getReferencedFilesFromImportLiteral(checker, importName) { 38552 const symbol = checker.getSymbolAtLocation(importName); 38553 return symbol && getReferencedFilesFromImportedModuleSymbol(symbol); 38554 } 38555 function getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName) { 38556 return toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName); 38557 } 38558 function getReferencedFiles(program, sourceFile, getCanonicalFileName) { 38559 let referencedFiles; 38560 if (sourceFile.imports && sourceFile.imports.length > 0) { 38561 const checker = program.getTypeChecker(); 38562 for (const importName of sourceFile.imports) { 38563 const declarationSourceFilePaths = getReferencedFilesFromImportLiteral(checker, importName); 38564 declarationSourceFilePaths == null ? void 0 : declarationSourceFilePaths.forEach(addReferencedFile); 38565 } 38566 } 38567 const sourceFileDirectory = getDirectoryPath(sourceFile.resolvedPath); 38568 if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { 38569 for (const referencedFile of sourceFile.referencedFiles) { 38570 const referencedPath = getReferencedFileFromFileName(program, referencedFile.fileName, sourceFileDirectory, getCanonicalFileName); 38571 addReferencedFile(referencedPath); 38572 } 38573 } 38574 if (sourceFile.resolvedTypeReferenceDirectiveNames) { 38575 sourceFile.resolvedTypeReferenceDirectiveNames.forEach((resolvedTypeReferenceDirective) => { 38576 if (!resolvedTypeReferenceDirective) { 38577 return; 38578 } 38579 const fileName = resolvedTypeReferenceDirective.resolvedFileName; 38580 const typeFilePath = getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName); 38581 addReferencedFile(typeFilePath); 38582 }); 38583 } 38584 if (sourceFile.moduleAugmentations.length) { 38585 const checker = program.getTypeChecker(); 38586 for (const moduleName of sourceFile.moduleAugmentations) { 38587 if (!isStringLiteral(moduleName)) 38588 continue; 38589 const symbol = checker.getSymbolAtLocation(moduleName); 38590 if (!symbol) 38591 continue; 38592 addReferenceFromAmbientModule(symbol); 38593 } 38594 } 38595 for (const ambientModule of program.getTypeChecker().getAmbientModules()) { 38596 if (ambientModule.declarations && ambientModule.declarations.length > 1) { 38597 addReferenceFromAmbientModule(ambientModule); 38598 } 38599 } 38600 return referencedFiles; 38601 function addReferenceFromAmbientModule(symbol) { 38602 if (!symbol.declarations) { 38603 return; 38604 } 38605 for (const declaration of symbol.declarations) { 38606 const declarationSourceFile = getSourceFileOfNode(declaration); 38607 if (declarationSourceFile && declarationSourceFile !== sourceFile) { 38608 addReferencedFile(declarationSourceFile.resolvedPath); 38609 } 38610 } 38611 } 38612 function addReferencedFile(referencedPath) { 38613 (referencedFiles || (referencedFiles = new Set2())).add(referencedPath); 38614 } 38615 } 38616 function canReuseOldState(newReferencedMap, oldState) { 38617 return oldState && !oldState.referencedMap === !newReferencedMap; 38618 } 38619 BuilderState2.canReuseOldState = canReuseOldState; 38620 function create(newProgram, getCanonicalFileName, oldState, disableUseFileVersionAsSignature) { 38621 var _a2, _b, _c; 38622 const fileInfos = new Map2(); 38623 const referencedMap = newProgram.getCompilerOptions().module !== 0 /* None */ ? createManyToManyPathMap() : void 0; 38624 const exportedModulesMap = referencedMap ? createManyToManyPathMap() : void 0; 38625 const useOldState = canReuseOldState(referencedMap, oldState); 38626 newProgram.getTypeChecker(); 38627 for (const sourceFile of newProgram.getSourceFiles()) { 38628 const version2 = Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set"); 38629 const oldUncommittedSignature = useOldState ? (_a2 = oldState.oldSignatures) == null ? void 0 : _a2.get(sourceFile.resolvedPath) : void 0; 38630 const signature = oldUncommittedSignature === void 0 ? useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) == null ? void 0 : _b.signature : void 0 : oldUncommittedSignature || void 0; 38631 if (referencedMap) { 38632 const newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName); 38633 if (newReferences) { 38634 referencedMap.set(sourceFile.resolvedPath, newReferences); 38635 } 38636 if (useOldState) { 38637 const oldUncommittedExportedModules = (_c = oldState.oldExportedModulesMap) == null ? void 0 : _c.get(sourceFile.resolvedPath); 38638 const exportedModules = oldUncommittedExportedModules === void 0 ? oldState.exportedModulesMap.getValues(sourceFile.resolvedPath) : oldUncommittedExportedModules || void 0; 38639 if (exportedModules) { 38640 exportedModulesMap.set(sourceFile.resolvedPath, exportedModules); 38641 } 38642 } 38643 } 38644 fileInfos.set(sourceFile.resolvedPath, { 38645 version: version2, 38646 signature, 38647 affectsGlobalScope: isFileAffectingGlobalScope(sourceFile) || void 0, 38648 impliedFormat: sourceFile.impliedNodeFormat 38649 }); 38650 } 38651 return { 38652 fileInfos, 38653 referencedMap, 38654 exportedModulesMap, 38655 useFileVersionAsSignature: !disableUseFileVersionAsSignature && !useOldState 38656 }; 38657 } 38658 BuilderState2.create = create; 38659 function releaseCache(state) { 38660 state.allFilesExcludingDefaultLibraryFile = void 0; 38661 state.allFileNames = void 0; 38662 } 38663 BuilderState2.releaseCache = releaseCache; 38664 function getFilesAffectedBy(state, programOfThisState, path2, cancellationToken, computeHash, getCanonicalFileName) { 38665 var _a2, _b; 38666 const result = getFilesAffectedByWithOldState( 38667 state, 38668 programOfThisState, 38669 path2, 38670 cancellationToken, 38671 computeHash, 38672 getCanonicalFileName 38673 ); 38674 (_a2 = state.oldSignatures) == null ? void 0 : _a2.clear(); 38675 (_b = state.oldExportedModulesMap) == null ? void 0 : _b.clear(); 38676 return result; 38677 } 38678 BuilderState2.getFilesAffectedBy = getFilesAffectedBy; 38679 function getFilesAffectedByWithOldState(state, programOfThisState, path2, cancellationToken, computeHash, getCanonicalFileName) { 38680 const sourceFile = programOfThisState.getSourceFileByPath(path2); 38681 if (!sourceFile) { 38682 return emptyArray; 38683 } 38684 if (!updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash, getCanonicalFileName)) { 38685 return [sourceFile]; 38686 } 38687 return (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, cancellationToken, computeHash, getCanonicalFileName); 38688 } 38689 BuilderState2.getFilesAffectedByWithOldState = getFilesAffectedByWithOldState; 38690 function updateSignatureOfFile(state, signature, path2) { 38691 state.fileInfos.get(path2).signature = signature; 38692 (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new Set2())).add(path2); 38693 } 38694 BuilderState2.updateSignatureOfFile = updateSignatureOfFile; 38695 function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, computeHash, getCanonicalFileName, useFileVersionAsSignature = state.useFileVersionAsSignature) { 38696 var _a2; 38697 if ((_a2 = state.hasCalledUpdateShapeSignature) == null ? void 0 : _a2.has(sourceFile.resolvedPath)) 38698 return false; 38699 const info = state.fileInfos.get(sourceFile.resolvedPath); 38700 const prevSignature = info.signature; 38701 let latestSignature; 38702 if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) { 38703 programOfThisState.emit( 38704 sourceFile, 38705 (fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) => { 38706 Debug.assert(isDeclarationFileName(fileName), `File extension for signature expected to be dts: Got:: ${fileName}`); 38707 latestSignature = computeSignatureWithDiagnostics( 38708 sourceFile, 38709 text, 38710 computeHash, 38711 getCanonicalFileName, 38712 data 38713 ); 38714 if (latestSignature !== prevSignature) { 38715 updateExportedModules(state, sourceFile, sourceFiles[0].exportedModulesFromDeclarationEmit); 38716 } 38717 }, 38718 cancellationToken, 38719 true, 38720 void 0, 38721 true 38722 ); 38723 } 38724 if (latestSignature === void 0) { 38725 latestSignature = sourceFile.version; 38726 if (state.exportedModulesMap && latestSignature !== prevSignature) { 38727 (state.oldExportedModulesMap || (state.oldExportedModulesMap = new Map2())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false); 38728 const references = state.referencedMap ? state.referencedMap.getValues(sourceFile.resolvedPath) : void 0; 38729 if (references) { 38730 state.exportedModulesMap.set(sourceFile.resolvedPath, references); 38731 } else { 38732 state.exportedModulesMap.deleteKey(sourceFile.resolvedPath); 38733 } 38734 } 38735 } 38736 (state.oldSignatures || (state.oldSignatures = new Map2())).set(sourceFile.resolvedPath, prevSignature || false); 38737 (state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = new Set2())).add(sourceFile.resolvedPath); 38738 info.signature = latestSignature; 38739 return latestSignature !== prevSignature; 38740 } 38741 BuilderState2.updateShapeSignature = updateShapeSignature; 38742 function updateExportedModules(state, sourceFile, exportedModulesFromDeclarationEmit) { 38743 if (!state.exportedModulesMap) 38744 return; 38745 (state.oldExportedModulesMap || (state.oldExportedModulesMap = new Map2())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false); 38746 if (!exportedModulesFromDeclarationEmit) { 38747 state.exportedModulesMap.deleteKey(sourceFile.resolvedPath); 38748 return; 38749 } 38750 let exportedModules; 38751 exportedModulesFromDeclarationEmit.forEach((symbol) => addExportedModule(getReferencedFilesFromImportedModuleSymbol(symbol))); 38752 if (exportedModules) { 38753 state.exportedModulesMap.set(sourceFile.resolvedPath, exportedModules); 38754 } else { 38755 state.exportedModulesMap.deleteKey(sourceFile.resolvedPath); 38756 } 38757 function addExportedModule(exportedModulePaths) { 38758 if (exportedModulePaths == null ? void 0 : exportedModulePaths.length) { 38759 if (!exportedModules) { 38760 exportedModules = new Set2(); 38761 } 38762 exportedModulePaths.forEach((path2) => exportedModules.add(path2)); 38763 } 38764 } 38765 } 38766 BuilderState2.updateExportedModules = updateExportedModules; 38767 function getAllDependencies(state, programOfThisState, sourceFile) { 38768 const compilerOptions = programOfThisState.getCompilerOptions(); 38769 if (outFile(compilerOptions)) { 38770 return getAllFileNames(state, programOfThisState); 38771 } 38772 if (!state.referencedMap || isFileAffectingGlobalScope(sourceFile)) { 38773 return getAllFileNames(state, programOfThisState); 38774 } 38775 const seenMap = new Set2(); 38776 const queue = [sourceFile.resolvedPath]; 38777 while (queue.length) { 38778 const path2 = queue.pop(); 38779 if (!seenMap.has(path2)) { 38780 seenMap.add(path2); 38781 const references = state.referencedMap.getValues(path2); 38782 if (references) { 38783 const iterator = references.keys(); 38784 for (let iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) { 38785 queue.push(iterResult.value); 38786 } 38787 } 38788 } 38789 } 38790 return arrayFrom(mapDefinedIterator(seenMap.keys(), (path2) => { 38791 var _a2, _b; 38792 return (_b = (_a2 = programOfThisState.getSourceFileByPath(path2)) == null ? void 0 : _a2.fileName) != null ? _b : path2; 38793 })); 38794 } 38795 BuilderState2.getAllDependencies = getAllDependencies; 38796 function getAllFileNames(state, programOfThisState) { 38797 if (!state.allFileNames) { 38798 const sourceFiles = programOfThisState.getSourceFiles(); 38799 state.allFileNames = sourceFiles === emptyArray ? emptyArray : sourceFiles.map((file) => file.fileName); 38800 } 38801 return state.allFileNames; 38802 } 38803 function getReferencedByPaths(state, referencedFilePath) { 38804 const keys = state.referencedMap.getKeys(referencedFilePath); 38805 return keys ? arrayFrom(keys.keys()) : []; 38806 } 38807 BuilderState2.getReferencedByPaths = getReferencedByPaths; 38808 function containsOnlyAmbientModules(sourceFile) { 38809 for (const statement of sourceFile.statements) { 38810 if (!isModuleWithStringLiteralName(statement)) { 38811 return false; 38812 } 38813 } 38814 return true; 38815 } 38816 function containsGlobalScopeAugmentation(sourceFile) { 38817 return some(sourceFile.moduleAugmentations, (augmentation) => isGlobalScopeAugmentation(augmentation.parent)); 38818 } 38819 function isFileAffectingGlobalScope(sourceFile) { 38820 return containsGlobalScopeAugmentation(sourceFile) || !isExternalOrCommonJsModule(sourceFile) && !isJsonSourceFile(sourceFile) && !containsOnlyAmbientModules(sourceFile); 38821 } 38822 function getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, firstSourceFile) { 38823 if (state.allFilesExcludingDefaultLibraryFile) { 38824 return state.allFilesExcludingDefaultLibraryFile; 38825 } 38826 let result; 38827 if (firstSourceFile) 38828 addSourceFile(firstSourceFile); 38829 for (const sourceFile of programOfThisState.getSourceFiles()) { 38830 if (sourceFile !== firstSourceFile) { 38831 addSourceFile(sourceFile); 38832 } 38833 } 38834 state.allFilesExcludingDefaultLibraryFile = result || emptyArray; 38835 return state.allFilesExcludingDefaultLibraryFile; 38836 function addSourceFile(sourceFile) { 38837 if (!programOfThisState.isSourceFileDefaultLibrary(sourceFile)) { 38838 (result || (result = [])).push(sourceFile); 38839 } 38840 } 38841 } 38842 BuilderState2.getAllFilesExcludingDefaultLibraryFile = getAllFilesExcludingDefaultLibraryFile; 38843 function getFilesAffectedByUpdatedShapeWhenNonModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape) { 38844 const compilerOptions = programOfThisState.getCompilerOptions(); 38845 if (compilerOptions && outFile(compilerOptions)) { 38846 return [sourceFileWithUpdatedShape]; 38847 } 38848 return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); 38849 } 38850 function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cancellationToken, computeHash, getCanonicalFileName) { 38851 if (isFileAffectingGlobalScope(sourceFileWithUpdatedShape)) { 38852 return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); 38853 } 38854 const compilerOptions = programOfThisState.getCompilerOptions(); 38855 if (compilerOptions && (compilerOptions.isolatedModules || outFile(compilerOptions))) { 38856 return [sourceFileWithUpdatedShape]; 38857 } 38858 const seenFileNamesMap = new Map2(); 38859 seenFileNamesMap.set(sourceFileWithUpdatedShape.resolvedPath, sourceFileWithUpdatedShape); 38860 const queue = getReferencedByPaths(state, sourceFileWithUpdatedShape.resolvedPath); 38861 while (queue.length > 0) { 38862 const currentPath = queue.pop(); 38863 if (!seenFileNamesMap.has(currentPath)) { 38864 const currentSourceFile = programOfThisState.getSourceFileByPath(currentPath); 38865 seenFileNamesMap.set(currentPath, currentSourceFile); 38866 if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cancellationToken, computeHash, getCanonicalFileName)) { 38867 queue.push(...getReferencedByPaths(state, currentSourceFile.resolvedPath)); 38868 } 38869 } 38870 } 38871 return arrayFrom(mapDefinedIterator(seenFileNamesMap.values(), (value) => value)); 38872 } 38873})(BuilderState || (BuilderState = {})); 38874 38875// src/compiler/builder.ts 38876function getTextHandlingSourceMapForSignature(text, data) { 38877 return (data == null ? void 0 : data.sourceMapUrlPos) !== void 0 ? text.substring(0, data.sourceMapUrlPos) : text; 38878} 38879function computeSignatureWithDiagnostics(sourceFile, text, computeHash, getCanonicalFileName, data) { 38880 var _a2; 38881 text = getTextHandlingSourceMapForSignature(text, data); 38882 let sourceFileDirectory; 38883 if ((_a2 = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a2.length) { 38884 text += data.diagnostics.map( 38885 (diagnostic) => `${locationInfo(diagnostic)}${DiagnosticCategory[diagnostic.category]}${diagnostic.code}: ${flattenDiagnosticMessageText2(diagnostic.messageText)}` 38886 ).join("\n"); 38887 } 38888 return (computeHash != null ? computeHash : generateDjb2Hash)(text); 38889 function flattenDiagnosticMessageText2(diagnostic) { 38890 return isString(diagnostic) ? diagnostic : diagnostic === void 0 ? "" : !diagnostic.next ? diagnostic.messageText : diagnostic.messageText + diagnostic.next.map(flattenDiagnosticMessageText2).join("\n"); 38891 } 38892 function locationInfo(diagnostic) { 38893 if (diagnostic.file.resolvedPath === sourceFile.resolvedPath) 38894 return `(${diagnostic.start},${diagnostic.length})`; 38895 if (sourceFileDirectory === void 0) 38896 sourceFileDirectory = getDirectoryPath(sourceFile.resolvedPath); 38897 return `${ensurePathIsNonModuleName(getRelativePathFromDirectory(sourceFileDirectory, diagnostic.file.resolvedPath, getCanonicalFileName))}(${diagnostic.start},${diagnostic.length})`; 38898 } 38899} 38900 38901// src/compiler/watch.ts 38902var sysFormatDiagnosticsHost = sys ? { 38903 getCurrentDirectory: () => sys.getCurrentDirectory(), 38904 getNewLine: () => sys.newLine, 38905 getCanonicalFileName: createGetCanonicalFileName(sys.useCaseSensitiveFileNames) 38906} : void 0; 38907var screenStartingMessageCodes = [ 38908 Diagnostics.Starting_compilation_in_watch_mode.code, 38909 Diagnostics.File_change_detected_Starting_incremental_compilation.code 38910]; 38911var noopFileWatcher = { close: noop }; 38912var returnNoopFileWatcher = () => noopFileWatcher; 38913 38914// src/compiler/tsbuildPublic.ts 38915var minimumDate = new Date(-864e13); 38916var maximumDate = new Date(864e13); 38917 38918// src/jsTyping/_namespaces/ts.JsTyping.ts 38919var ts_JsTyping_exports = {}; 38920__export(ts_JsTyping_exports, { 38921 NameValidationResult: () => NameValidationResult, 38922 discoverTypings: () => discoverTypings, 38923 isTypingUpToDate: () => isTypingUpToDate, 38924 loadSafeList: () => loadSafeList, 38925 loadTypesMap: () => loadTypesMap, 38926 nodeCoreModuleList: () => nodeCoreModuleList, 38927 nodeCoreModules: () => nodeCoreModules, 38928 nonRelativeModuleNameForTypingCache: () => nonRelativeModuleNameForTypingCache, 38929 prefixedNodeCoreModuleList: () => prefixedNodeCoreModuleList, 38930 renderPackageNameValidationFailure: () => renderPackageNameValidationFailure, 38931 validatePackageName: () => validatePackageName 38932}); 38933 38934// src/jsTyping/jsTyping.ts 38935function isTypingUpToDate(cachedTyping, availableTypingVersions) { 38936 const availableVersion = new Version(getProperty(availableTypingVersions, `ts${versionMajorMinor}`) || getProperty(availableTypingVersions, "latest")); 38937 return availableVersion.compareTo(cachedTyping.version) <= 0; 38938} 38939var unprefixedNodeCoreModuleList = [ 38940 "assert", 38941 "assert/strict", 38942 "async_hooks", 38943 "buffer", 38944 "child_process", 38945 "cluster", 38946 "console", 38947 "constants", 38948 "crypto", 38949 "dgram", 38950 "diagnostics_channel", 38951 "dns", 38952 "dns/promises", 38953 "domain", 38954 "events", 38955 "fs", 38956 "fs/promises", 38957 "http", 38958 "https", 38959 "http2", 38960 "inspector", 38961 "module", 38962 "net", 38963 "os", 38964 "path", 38965 "perf_hooks", 38966 "process", 38967 "punycode", 38968 "querystring", 38969 "readline", 38970 "repl", 38971 "stream", 38972 "stream/promises", 38973 "string_decoder", 38974 "timers", 38975 "timers/promises", 38976 "tls", 38977 "trace_events", 38978 "tty", 38979 "url", 38980 "util", 38981 "util/types", 38982 "v8", 38983 "vm", 38984 "wasi", 38985 "worker_threads", 38986 "zlib" 38987]; 38988var prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map((name) => `node:${name}`); 38989var nodeCoreModuleList = [...unprefixedNodeCoreModuleList, ...prefixedNodeCoreModuleList]; 38990var nodeCoreModules = new Set2(nodeCoreModuleList); 38991function nonRelativeModuleNameForTypingCache(moduleName) { 38992 return nodeCoreModules.has(moduleName) ? "node" : moduleName; 38993} 38994function loadSafeList(host, safeListPath) { 38995 const result = readConfigFile(safeListPath, (path2) => host.readFile(path2)); 38996 return new Map2(getEntries(result.config)); 38997} 38998function loadTypesMap(host, typesMapPath) { 38999 const result = readConfigFile(typesMapPath, (path2) => host.readFile(path2)); 39000 if (result.config) { 39001 return new Map2(getEntries(result.config.simpleMap)); 39002 } 39003 return void 0; 39004} 39005function discoverTypings(host, log2, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports, typesRegistry, compilerOptions) { 39006 if (!typeAcquisition || !typeAcquisition.enable) { 39007 return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; 39008 } 39009 const inferredTypings = new Map2(); 39010 fileNames = mapDefined(fileNames, (fileName) => { 39011 const path2 = normalizePath(fileName); 39012 if (hasJSFileExtension(path2)) { 39013 return path2; 39014 } 39015 }); 39016 const filesToWatch = []; 39017 if (typeAcquisition.include) 39018 addInferredTypings(typeAcquisition.include, "Explicitly included types"); 39019 const exclude = typeAcquisition.exclude || []; 39020 if (!compilerOptions.types) { 39021 const possibleSearchDirs = new Set2(fileNames.map(getDirectoryPath)); 39022 possibleSearchDirs.add(projectRootPath); 39023 possibleSearchDirs.forEach((searchDir) => { 39024 getTypingNames(searchDir, "bower.json", "bower_components", filesToWatch); 39025 getTypingNames(searchDir, "package.json", "node_modules", filesToWatch); 39026 getTypingNames(searchDir, "oh-package.json5", "oh_modules", filesToWatch); 39027 }); 39028 } 39029 if (!typeAcquisition.disableFilenameBasedTypeAcquisition) { 39030 getTypingNamesFromSourceFileNames(fileNames); 39031 } 39032 if (unresolvedImports) { 39033 const module2 = deduplicate( 39034 unresolvedImports.map(nonRelativeModuleNameForTypingCache), 39035 equateStringsCaseSensitive, 39036 compareStringsCaseSensitive 39037 ); 39038 addInferredTypings(module2, "Inferred typings from unresolved imports"); 39039 } 39040 packageNameToTypingLocation.forEach((typing, name) => { 39041 const registryEntry = typesRegistry.get(name); 39042 if (inferredTypings.has(name) && inferredTypings.get(name) === void 0 && registryEntry !== void 0 && isTypingUpToDate(typing, registryEntry)) { 39043 inferredTypings.set(name, typing.typingLocation); 39044 } 39045 }); 39046 for (const excludeTypingName of exclude) { 39047 const didDelete = inferredTypings.delete(excludeTypingName); 39048 if (didDelete && log2) 39049 log2(`Typing for ${excludeTypingName} is in exclude list, will be ignored.`); 39050 } 39051 const newTypingNames = []; 39052 const cachedTypingPaths = []; 39053 inferredTypings.forEach((inferred, typing) => { 39054 if (inferred !== void 0) { 39055 cachedTypingPaths.push(inferred); 39056 } else { 39057 newTypingNames.push(typing); 39058 } 39059 }); 39060 const result = { cachedTypingPaths, newTypingNames, filesToWatch }; 39061 if (log2) 39062 log2(`Result: ${JSON.stringify(result)}`); 39063 return result; 39064 function addInferredTyping(typingName) { 39065 if (!inferredTypings.has(typingName)) { 39066 inferredTypings.set(typingName, void 0); 39067 } 39068 } 39069 function addInferredTypings(typingNames, message) { 39070 if (log2) 39071 log2(`${message}: ${JSON.stringify(typingNames)}`); 39072 forEach(typingNames, addInferredTyping); 39073 } 39074 function getTypingNames(projectRootPath2, manifestName, modulesDirName, filesToWatch2) { 39075 const manifestPath = combinePaths(projectRootPath2, manifestName); 39076 let manifest; 39077 let manifestTypingNames; 39078 if (host.fileExists(manifestPath)) { 39079 filesToWatch2.push(manifestPath); 39080 manifest = readConfigFile(manifestPath, (path2) => host.readFile(path2)).config; 39081 manifestTypingNames = flatMap([manifest.dependencies, manifest.devDependencies, manifest.optionalDependencies, manifest.peerDependencies], getOwnKeys); 39082 addInferredTypings(manifestTypingNames, `Typing names in '${manifestPath}' dependencies`); 39083 } 39084 const packagesFolderPath = combinePaths(projectRootPath2, modulesDirName); 39085 filesToWatch2.push(packagesFolderPath); 39086 if (!host.directoryExists(packagesFolderPath)) { 39087 return; 39088 } 39089 const packageNames = []; 39090 const dependencyManifestNames = manifestTypingNames ? manifestTypingNames.map((typingName) => combinePaths(packagesFolderPath, typingName, manifestName)) : host.readDirectory(packagesFolderPath, [".json" /* Json */], void 0, void 0, 3).filter((manifestPath2) => { 39091 if (getBaseFileName(manifestPath2) !== manifestName) { 39092 return false; 39093 } 39094 const pathComponents2 = getPathComponents(normalizePath(manifestPath2)); 39095 const isScoped = pathComponents2[pathComponents2.length - 3][0] === "@"; 39096 return isScoped && pathComponents2[pathComponents2.length - 4].toLowerCase() === modulesDirName || !isScoped && pathComponents2[pathComponents2.length - 3].toLowerCase() === modulesDirName; 39097 }); 39098 if (log2) 39099 log2(`Searching for typing names in ${packagesFolderPath}; all files: ${JSON.stringify(dependencyManifestNames)}`); 39100 for (const manifestPath2 of dependencyManifestNames) { 39101 const normalizedFileName = normalizePath(manifestPath2); 39102 const result2 = readConfigFile(normalizedFileName, (path2) => host.readFile(path2)); 39103 const manifest2 = result2.config; 39104 if (!manifest2.name) { 39105 continue; 39106 } 39107 const ownTypes = manifest2.types || manifest2.typings; 39108 if (ownTypes) { 39109 const absolutePath = getNormalizedAbsolutePath(ownTypes, getDirectoryPath(normalizedFileName)); 39110 if (host.fileExists(absolutePath)) { 39111 if (log2) 39112 log2(` Package '${manifest2.name}' provides its own types.`); 39113 inferredTypings.set(manifest2.name, absolutePath); 39114 } else { 39115 if (log2) 39116 log2(` Package '${manifest2.name}' provides its own types but they are missing.`); 39117 } 39118 } else { 39119 packageNames.push(manifest2.name); 39120 } 39121 } 39122 addInferredTypings(packageNames, " Found package names"); 39123 } 39124 function getTypingNamesFromSourceFileNames(fileNames2) { 39125 const fromFileNames = mapDefined(fileNames2, (j) => { 39126 if (!hasJSFileExtension(j)) 39127 return void 0; 39128 const inferredTypingName = removeFileExtension(getBaseFileName(j.toLowerCase())); 39129 const cleanedTypingName = removeMinAndVersionNumbers(inferredTypingName); 39130 return safeList.get(cleanedTypingName); 39131 }); 39132 if (fromFileNames.length) { 39133 addInferredTypings(fromFileNames, "Inferred typings from file names"); 39134 } 39135 const hasJsxFile = some(fileNames2, (f) => fileExtensionIs(f, ".jsx" /* Jsx */)); 39136 if (hasJsxFile) { 39137 if (log2) 39138 log2(`Inferred 'react' typings due to presence of '.jsx' extension`); 39139 addInferredTyping("react"); 39140 } 39141 } 39142} 39143var NameValidationResult = /* @__PURE__ */ ((NameValidationResult2) => { 39144 NameValidationResult2[NameValidationResult2["Ok"] = 0] = "Ok"; 39145 NameValidationResult2[NameValidationResult2["EmptyName"] = 1] = "EmptyName"; 39146 NameValidationResult2[NameValidationResult2["NameTooLong"] = 2] = "NameTooLong"; 39147 NameValidationResult2[NameValidationResult2["NameStartsWithDot"] = 3] = "NameStartsWithDot"; 39148 NameValidationResult2[NameValidationResult2["NameStartsWithUnderscore"] = 4] = "NameStartsWithUnderscore"; 39149 NameValidationResult2[NameValidationResult2["NameContainsNonURISafeCharacters"] = 5] = "NameContainsNonURISafeCharacters"; 39150 return NameValidationResult2; 39151})(NameValidationResult || {}); 39152var maxPackageNameLength = 214; 39153function validatePackageName(packageName) { 39154 return validatePackageNameWorker(packageName, true); 39155} 39156function validatePackageNameWorker(packageName, supportScopedPackage) { 39157 if (!packageName) { 39158 return 1 /* EmptyName */; 39159 } 39160 if (packageName.length > maxPackageNameLength) { 39161 return 2 /* NameTooLong */; 39162 } 39163 if (packageName.charCodeAt(0) === 46 /* dot */) { 39164 return 3 /* NameStartsWithDot */; 39165 } 39166 if (packageName.charCodeAt(0) === 95 /* _ */) { 39167 return 4 /* NameStartsWithUnderscore */; 39168 } 39169 if (supportScopedPackage) { 39170 const matches = /^@([^/]+)\/([^/]+)$/.exec(packageName); 39171 if (matches) { 39172 const scopeResult = validatePackageNameWorker(matches[1], false); 39173 if (scopeResult !== 0 /* Ok */) { 39174 return { name: matches[1], isScopeName: true, result: scopeResult }; 39175 } 39176 const packageResult = validatePackageNameWorker(matches[2], false); 39177 if (packageResult !== 0 /* Ok */) { 39178 return { name: matches[2], isScopeName: false, result: packageResult }; 39179 } 39180 return 0 /* Ok */; 39181 } 39182 } 39183 if (encodeURIComponent(packageName) !== packageName) { 39184 return 5 /* NameContainsNonURISafeCharacters */; 39185 } 39186 return 0 /* Ok */; 39187} 39188function renderPackageNameValidationFailure(result, typing) { 39189 return typeof result === "object" ? renderPackageNameValidationFailureWorker(typing, result.result, result.name, result.isScopeName) : renderPackageNameValidationFailureWorker(typing, result, typing, false); 39190} 39191function renderPackageNameValidationFailureWorker(typing, result, name, isScopeName) { 39192 const kind = isScopeName ? "Scope" : "Package"; 39193 switch (result) { 39194 case 1 /* EmptyName */: 39195 return `'${typing}':: ${kind} name '${name}' cannot be empty`; 39196 case 2 /* NameTooLong */: 39197 return `'${typing}':: ${kind} name '${name}' should be less than ${maxPackageNameLength} characters`; 39198 case 3 /* NameStartsWithDot */: 39199 return `'${typing}':: ${kind} name '${name}' cannot start with '.'`; 39200 case 4 /* NameStartsWithUnderscore */: 39201 return `'${typing}':: ${kind} name '${name}' cannot start with '_'`; 39202 case 5 /* NameContainsNonURISafeCharacters */: 39203 return `'${typing}':: ${kind} name '${name}' contains non URI safe characters`; 39204 case 0 /* Ok */: 39205 return Debug.fail(); 39206 default: 39207 throw Debug.assertNever(result); 39208 } 39209} 39210 39211// src/jsTyping/shared.ts 39212var ActionSet = "action::set"; 39213var ActionInvalidate = "action::invalidate"; 39214var ActionPackageInstalled = "action::packageInstalled"; 39215var EventTypesRegistry = "event::typesRegistry"; 39216var EventBeginInstallTypes = "event::beginInstallTypes"; 39217var EventEndInstallTypes = "event::endInstallTypes"; 39218var Arguments; 39219((Arguments2) => { 39220 Arguments2.GlobalCacheLocation = "--globalTypingsCacheLocation"; 39221 Arguments2.LogFile = "--logFile"; 39222 Arguments2.EnableTelemetry = "--enableTelemetry"; 39223 Arguments2.TypingSafeListLocation = "--typingSafeListLocation"; 39224 Arguments2.TypesMapLocation = "--typesMapLocation"; 39225 Arguments2.NpmLocation = "--npmLocation"; 39226 Arguments2.ValidateDefaultNpmLocation = "--validateDefaultNpmLocation"; 39227})(Arguments || (Arguments = {})); 39228function hasArgument(argumentName) { 39229 return sys.args.indexOf(argumentName) >= 0; 39230} 39231function findArgument(argumentName) { 39232 const index = sys.args.indexOf(argumentName); 39233 return index >= 0 && index < sys.args.length - 1 ? sys.args[index + 1] : void 0; 39234} 39235function nowString() { 39236 const d = new Date(); 39237 return `${padLeft(d.getHours().toString(), 2, "0")}:${padLeft(d.getMinutes().toString(), 2, "0")}:${padLeft(d.getSeconds().toString(), 2, "0")}.${padLeft(d.getMilliseconds().toString(), 3, "0")}`; 39238} 39239 39240// src/typingsInstallerCore/typingsInstaller.ts 39241var nullLog = { 39242 isEnabled: () => false, 39243 writeLine: noop 39244}; 39245function typingToFileName(cachePath, packageName, installTypingHost, log2) { 39246 try { 39247 const result = resolveModuleName(packageName, combinePaths(cachePath, "index.d.ts"), { moduleResolution: 2 /* NodeJs */ }, installTypingHost); 39248 return result.resolvedModule && result.resolvedModule.resolvedFileName; 39249 } catch (e) { 39250 if (log2.isEnabled()) { 39251 log2.writeLine(`Failed to resolve ${packageName} in folder '${cachePath}': ${e.message}`); 39252 } 39253 return void 0; 39254 } 39255} 39256function installNpmPackages(npmPath, tsVersion, packageNames, install) { 39257 let hasError = false; 39258 for (let remaining = packageNames.length; remaining > 0; ) { 39259 const result = getNpmCommandForInstallation(npmPath, tsVersion, packageNames, remaining); 39260 remaining = result.remaining; 39261 hasError = install(result.command) || hasError; 39262 } 39263 return hasError; 39264} 39265function getNpmCommandForInstallation(npmPath, tsVersion, packageNames, remaining) { 39266 const sliceStart = packageNames.length - remaining; 39267 let command, toSlice = remaining; 39268 while (true) { 39269 command = `${npmPath} install --ignore-scripts ${(toSlice === packageNames.length ? packageNames : packageNames.slice(sliceStart, sliceStart + toSlice)).join(" ")} --save-dev --user-agent="typesInstaller/${tsVersion}"`; 39270 if (command.length < 8e3) { 39271 break; 39272 } 39273 toSlice = toSlice - Math.floor(toSlice / 2); 39274 } 39275 return { command, remaining: remaining - toSlice }; 39276} 39277function endsWith2(str, suffix, caseSensitive) { 39278 const expectedPos = str.length - suffix.length; 39279 return expectedPos >= 0 && (str.indexOf(suffix, expectedPos) === expectedPos || !caseSensitive && compareStringsCaseInsensitive(str.substr(expectedPos), suffix) === 0 /* EqualTo */); 39280} 39281function isPackageOrBowerJson(fileName, caseSensitive) { 39282 return endsWith2(fileName, "/package.json", caseSensitive) || endsWith2(fileName, "/bower.json", caseSensitive); 39283} 39284function sameFiles(a, b, caseSensitive) { 39285 return a === b || !caseSensitive && compareStringsCaseInsensitive(a, b) === 0 /* EqualTo */; 39286} 39287function getDetailWatchInfo(projectName, watchers) { 39288 return `Project: ${projectName} watcher already invoked: ${watchers.isInvoked}`; 39289} 39290var TypingsInstaller = class { 39291 constructor(installTypingHost, globalCachePath, safeListPath, typesMapLocation2, throttleLimit, log2 = nullLog) { 39292 this.installTypingHost = installTypingHost; 39293 this.globalCachePath = globalCachePath; 39294 this.safeListPath = safeListPath; 39295 this.typesMapLocation = typesMapLocation2; 39296 this.throttleLimit = throttleLimit; 39297 this.log = log2; 39298 this.packageNameToTypingLocation = new Map2(); 39299 this.missingTypingsSet = new Set2(); 39300 this.knownCachesSet = new Set2(); 39301 this.projectWatchers = new Map2(); 39302 this.pendingRunRequests = []; 39303 this.installRunCount = 1; 39304 this.inFlightRequestCount = 0; 39305 this.latestDistTag = "latest"; 39306 this.toCanonicalFileName = createGetCanonicalFileName(installTypingHost.useCaseSensitiveFileNames); 39307 this.globalCachePackageJsonPath = combinePaths(globalCachePath, "package.json"); 39308 const isLoggingEnabled = this.log.isEnabled(); 39309 if (isLoggingEnabled) { 39310 this.log.writeLine(`Global cache location '${globalCachePath}', safe file path '${safeListPath}', types map path ${typesMapLocation2}`); 39311 } 39312 this.watchFactory = getWatchFactory(this.installTypingHost, isLoggingEnabled ? 2 /* Verbose */ : 0 /* None */, (s) => this.log.writeLine(s), getDetailWatchInfo); 39313 this.processCacheLocation(this.globalCachePath); 39314 } 39315 closeProject(req) { 39316 this.closeWatchers(req.projectName); 39317 } 39318 closeWatchers(projectName) { 39319 if (this.log.isEnabled()) { 39320 this.log.writeLine(`Closing file watchers for project '${projectName}'`); 39321 } 39322 const watchers = this.projectWatchers.get(projectName); 39323 if (!watchers) { 39324 if (this.log.isEnabled()) { 39325 this.log.writeLine(`No watchers are registered for project '${projectName}'`); 39326 } 39327 return; 39328 } 39329 clearMap(watchers, closeFileWatcher); 39330 this.projectWatchers.delete(projectName); 39331 if (this.log.isEnabled()) { 39332 this.log.writeLine(`Closing file watchers for project '${projectName}' - done.`); 39333 } 39334 } 39335 install(req) { 39336 if (this.log.isEnabled()) { 39337 this.log.writeLine(`Got install request ${JSON.stringify(req)}`); 39338 } 39339 if (req.cachePath) { 39340 if (this.log.isEnabled()) { 39341 this.log.writeLine(`Request specifies cache path '${req.cachePath}', loading cached information...`); 39342 } 39343 this.processCacheLocation(req.cachePath); 39344 } 39345 if (this.safeList === void 0) { 39346 this.initializeSafeList(); 39347 } 39348 const discoverTypingsResult = ts_JsTyping_exports.discoverTypings( 39349 this.installTypingHost, 39350 this.log.isEnabled() ? (s) => this.log.writeLine(s) : void 0, 39351 req.fileNames, 39352 req.projectRootPath, 39353 this.safeList, 39354 this.packageNameToTypingLocation, 39355 req.typeAcquisition, 39356 req.unresolvedImports, 39357 this.typesRegistry, 39358 req.compilerOptions 39359 ); 39360 if (this.log.isEnabled()) { 39361 this.log.writeLine(`Finished typings discovery: ${JSON.stringify(discoverTypingsResult)}`); 39362 } 39363 this.watchFiles(req.projectName, discoverTypingsResult.filesToWatch, req.projectRootPath, req.watchOptions); 39364 if (discoverTypingsResult.newTypingNames.length) { 39365 this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames); 39366 } else { 39367 this.sendResponse(this.createSetTypings(req, discoverTypingsResult.cachedTypingPaths)); 39368 if (this.log.isEnabled()) { 39369 this.log.writeLine(`No new typings were requested as a result of typings discovery`); 39370 } 39371 } 39372 } 39373 initializeSafeList() { 39374 if (this.typesMapLocation) { 39375 const safeListFromMap = ts_JsTyping_exports.loadTypesMap(this.installTypingHost, this.typesMapLocation); 39376 if (safeListFromMap) { 39377 this.log.writeLine(`Loaded safelist from types map file '${this.typesMapLocation}'`); 39378 this.safeList = safeListFromMap; 39379 return; 39380 } 39381 this.log.writeLine(`Failed to load safelist from types map file '${this.typesMapLocation}'`); 39382 } 39383 this.safeList = ts_JsTyping_exports.loadSafeList(this.installTypingHost, this.safeListPath); 39384 } 39385 processCacheLocation(cacheLocation) { 39386 if (this.log.isEnabled()) { 39387 this.log.writeLine(`Processing cache location '${cacheLocation}'`); 39388 } 39389 if (this.knownCachesSet.has(cacheLocation)) { 39390 if (this.log.isEnabled()) { 39391 this.log.writeLine(`Cache location was already processed...`); 39392 } 39393 return; 39394 } 39395 const packageJson = combinePaths(cacheLocation, "package.json"); 39396 const packageLockJson = combinePaths(cacheLocation, "package-lock.json"); 39397 if (this.log.isEnabled()) { 39398 this.log.writeLine(`Trying to find '${packageJson}'...`); 39399 } 39400 if (this.installTypingHost.fileExists(packageJson) && this.installTypingHost.fileExists(packageLockJson)) { 39401 const npmConfig = JSON.parse(this.installTypingHost.readFile(packageJson)); 39402 const npmLock = JSON.parse(this.installTypingHost.readFile(packageLockJson)); 39403 if (this.log.isEnabled()) { 39404 this.log.writeLine(`Loaded content of '${packageJson}': ${JSON.stringify(npmConfig)}`); 39405 this.log.writeLine(`Loaded content of '${packageLockJson}'`); 39406 } 39407 if (npmConfig.devDependencies && npmLock.dependencies) { 39408 for (const key in npmConfig.devDependencies) { 39409 if (!hasProperty(npmLock.dependencies, key)) { 39410 continue; 39411 } 39412 const packageName = getBaseFileName(key); 39413 if (!packageName) { 39414 continue; 39415 } 39416 const typingFile = typingToFileName(cacheLocation, packageName, this.installTypingHost, this.log); 39417 if (!typingFile) { 39418 this.missingTypingsSet.add(packageName); 39419 continue; 39420 } 39421 const existingTypingFile = this.packageNameToTypingLocation.get(packageName); 39422 if (existingTypingFile) { 39423 if (existingTypingFile.typingLocation === typingFile) { 39424 continue; 39425 } 39426 if (this.log.isEnabled()) { 39427 this.log.writeLine(`New typing for package ${packageName} from '${typingFile}' conflicts with existing typing file '${existingTypingFile}'`); 39428 } 39429 } 39430 if (this.log.isEnabled()) { 39431 this.log.writeLine(`Adding entry into typings cache: '${packageName}' => '${typingFile}'`); 39432 } 39433 const info = getProperty(npmLock.dependencies, key); 39434 const version2 = info && info.version; 39435 if (!version2) { 39436 continue; 39437 } 39438 const newTyping = { typingLocation: typingFile, version: new Version(version2) }; 39439 this.packageNameToTypingLocation.set(packageName, newTyping); 39440 } 39441 } 39442 } 39443 if (this.log.isEnabled()) { 39444 this.log.writeLine(`Finished processing cache location '${cacheLocation}'`); 39445 } 39446 this.knownCachesSet.add(cacheLocation); 39447 } 39448 filterTypings(typingsToInstall) { 39449 return mapDefined(typingsToInstall, (typing) => { 39450 const typingKey = mangleScopedPackageName(typing); 39451 if (this.missingTypingsSet.has(typingKey)) { 39452 if (this.log.isEnabled()) 39453 this.log.writeLine(`'${typing}':: '${typingKey}' is in missingTypingsSet - skipping...`); 39454 return void 0; 39455 } 39456 const validationResult = ts_JsTyping_exports.validatePackageName(typing); 39457 if (validationResult !== ts_JsTyping_exports.NameValidationResult.Ok) { 39458 this.missingTypingsSet.add(typingKey); 39459 if (this.log.isEnabled()) 39460 this.log.writeLine(ts_JsTyping_exports.renderPackageNameValidationFailure(validationResult, typing)); 39461 return void 0; 39462 } 39463 if (!this.typesRegistry.has(typingKey)) { 39464 if (this.log.isEnabled()) 39465 this.log.writeLine(`'${typing}':: Entry for package '${typingKey}' does not exist in local types registry - skipping...`); 39466 return void 0; 39467 } 39468 if (this.packageNameToTypingLocation.get(typingKey) && ts_JsTyping_exports.isTypingUpToDate(this.packageNameToTypingLocation.get(typingKey), this.typesRegistry.get(typingKey))) { 39469 if (this.log.isEnabled()) 39470 this.log.writeLine(`'${typing}':: '${typingKey}' already has an up-to-date typing - skipping...`); 39471 return void 0; 39472 } 39473 return typingKey; 39474 }); 39475 } 39476 ensurePackageDirectoryExists(directory) { 39477 const npmConfigPath = combinePaths(directory, "package.json"); 39478 if (this.log.isEnabled()) { 39479 this.log.writeLine(`Npm config file: ${npmConfigPath}`); 39480 } 39481 if (!this.installTypingHost.fileExists(npmConfigPath)) { 39482 if (this.log.isEnabled()) { 39483 this.log.writeLine(`Npm config file: '${npmConfigPath}' is missing, creating new one...`); 39484 } 39485 this.ensureDirectoryExists(directory, this.installTypingHost); 39486 this.installTypingHost.writeFile(npmConfigPath, '{ "private": true }'); 39487 } 39488 } 39489 installTypings(req, cachePath, currentlyCachedTypings, typingsToInstall) { 39490 if (this.log.isEnabled()) { 39491 this.log.writeLine(`Installing typings ${JSON.stringify(typingsToInstall)}`); 39492 } 39493 const filteredTypings = this.filterTypings(typingsToInstall); 39494 if (filteredTypings.length === 0) { 39495 if (this.log.isEnabled()) { 39496 this.log.writeLine(`All typings are known to be missing or invalid - no need to install more typings`); 39497 } 39498 this.sendResponse(this.createSetTypings(req, currentlyCachedTypings)); 39499 return; 39500 } 39501 this.ensurePackageDirectoryExists(cachePath); 39502 const requestId = this.installRunCount; 39503 this.installRunCount++; 39504 this.sendResponse({ 39505 kind: EventBeginInstallTypes, 39506 eventId: requestId, 39507 typingsInstallerVersion: version, 39508 projectName: req.projectName 39509 }); 39510 const scopedTypings = filteredTypings.map(typingsName); 39511 this.installTypingsAsync(requestId, scopedTypings, cachePath, (ok) => { 39512 try { 39513 if (!ok) { 39514 if (this.log.isEnabled()) { 39515 this.log.writeLine(`install request failed, marking packages as missing to prevent repeated requests: ${JSON.stringify(filteredTypings)}`); 39516 } 39517 for (const typing of filteredTypings) { 39518 this.missingTypingsSet.add(typing); 39519 } 39520 return; 39521 } 39522 if (this.log.isEnabled()) { 39523 this.log.writeLine(`Installed typings ${JSON.stringify(scopedTypings)}`); 39524 } 39525 const installedTypingFiles = []; 39526 for (const packageName of filteredTypings) { 39527 const typingFile = typingToFileName(cachePath, packageName, this.installTypingHost, this.log); 39528 if (!typingFile) { 39529 this.missingTypingsSet.add(packageName); 39530 continue; 39531 } 39532 const distTags = this.typesRegistry.get(packageName); 39533 const newVersion = new Version(distTags[`ts${versionMajorMinor}`] || distTags[this.latestDistTag]); 39534 const newTyping = { typingLocation: typingFile, version: newVersion }; 39535 this.packageNameToTypingLocation.set(packageName, newTyping); 39536 installedTypingFiles.push(typingFile); 39537 } 39538 if (this.log.isEnabled()) { 39539 this.log.writeLine(`Installed typing files ${JSON.stringify(installedTypingFiles)}`); 39540 } 39541 this.sendResponse(this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles))); 39542 } finally { 39543 const response = { 39544 kind: EventEndInstallTypes, 39545 eventId: requestId, 39546 projectName: req.projectName, 39547 packagesToInstall: scopedTypings, 39548 installSuccess: ok, 39549 typingsInstallerVersion: version 39550 }; 39551 this.sendResponse(response); 39552 } 39553 }); 39554 } 39555 ensureDirectoryExists(directory, host) { 39556 const directoryName = getDirectoryPath(directory); 39557 if (!host.directoryExists(directoryName)) { 39558 this.ensureDirectoryExists(directoryName, host); 39559 } 39560 if (!host.directoryExists(directory)) { 39561 host.createDirectory(directory); 39562 } 39563 } 39564 watchFiles(projectName, files, projectRootPath, options) { 39565 if (!files.length) { 39566 this.closeWatchers(projectName); 39567 return; 39568 } 39569 let watchers = this.projectWatchers.get(projectName); 39570 const toRemove = new Map2(); 39571 if (!watchers) { 39572 watchers = new Map2(); 39573 this.projectWatchers.set(projectName, watchers); 39574 } else { 39575 copyEntries(watchers, toRemove); 39576 } 39577 watchers.isInvoked = false; 39578 const isLoggingEnabled = this.log.isEnabled(); 39579 const createProjectWatcher = (path2, projectWatcherType) => { 39580 const canonicalPath = this.toCanonicalFileName(path2); 39581 toRemove.delete(canonicalPath); 39582 if (watchers.has(canonicalPath)) { 39583 return; 39584 } 39585 if (isLoggingEnabled) { 39586 this.log.writeLine(`${projectWatcherType}:: Added:: WatchInfo: ${path2}`); 39587 } 39588 const watcher = projectWatcherType === "FileWatcher" /* FileWatcher */ ? this.watchFactory.watchFile(path2, () => { 39589 if (!watchers.isInvoked) { 39590 watchers.isInvoked = true; 39591 this.sendResponse({ projectName, kind: ActionInvalidate }); 39592 } 39593 }, 2e3 /* High */, options, projectName, watchers) : this.watchFactory.watchDirectory(path2, (f) => { 39594 if (watchers.isInvoked || !fileExtensionIs(f, ".json" /* Json */)) { 39595 return; 39596 } 39597 if (isPackageOrBowerJson(f, this.installTypingHost.useCaseSensitiveFileNames) && !sameFiles(f, this.globalCachePackageJsonPath, this.installTypingHost.useCaseSensitiveFileNames)) { 39598 watchers.isInvoked = true; 39599 this.sendResponse({ projectName, kind: ActionInvalidate }); 39600 } 39601 }, 1 /* Recursive */, options, projectName, watchers); 39602 watchers.set(canonicalPath, isLoggingEnabled ? { 39603 close: () => { 39604 this.log.writeLine(`${projectWatcherType}:: Closed:: WatchInfo: ${path2}`); 39605 watcher.close(); 39606 } 39607 } : watcher); 39608 }; 39609 for (const file of files) { 39610 if (file.endsWith("/package.json") || file.endsWith("/bower.json")) { 39611 createProjectWatcher(file, "FileWatcher" /* FileWatcher */); 39612 continue; 39613 } 39614 if (containsPath(projectRootPath, file, projectRootPath, !this.installTypingHost.useCaseSensitiveFileNames)) { 39615 const subDirectory = file.indexOf(directorySeparator, projectRootPath.length + 1); 39616 if (subDirectory !== -1) { 39617 createProjectWatcher(file.substr(0, subDirectory), "DirectoryWatcher" /* DirectoryWatcher */); 39618 } else { 39619 createProjectWatcher(file, "DirectoryWatcher" /* DirectoryWatcher */); 39620 } 39621 continue; 39622 } 39623 if (containsPath(this.globalCachePath, file, projectRootPath, !this.installTypingHost.useCaseSensitiveFileNames)) { 39624 createProjectWatcher(this.globalCachePath, "DirectoryWatcher" /* DirectoryWatcher */); 39625 continue; 39626 } 39627 createProjectWatcher(file, "DirectoryWatcher" /* DirectoryWatcher */); 39628 } 39629 toRemove.forEach((watch, path2) => { 39630 watch.close(); 39631 watchers.delete(path2); 39632 }); 39633 } 39634 createSetTypings(request, typings) { 39635 return { 39636 projectName: request.projectName, 39637 typeAcquisition: request.typeAcquisition, 39638 compilerOptions: request.compilerOptions, 39639 typings, 39640 unresolvedImports: request.unresolvedImports, 39641 kind: ActionSet 39642 }; 39643 } 39644 installTypingsAsync(requestId, packageNames, cwd, onRequestCompleted) { 39645 this.pendingRunRequests.unshift({ requestId, packageNames, cwd, onRequestCompleted }); 39646 this.executeWithThrottling(); 39647 } 39648 executeWithThrottling() { 39649 while (this.inFlightRequestCount < this.throttleLimit && this.pendingRunRequests.length) { 39650 this.inFlightRequestCount++; 39651 const request = this.pendingRunRequests.pop(); 39652 this.installWorker(request.requestId, request.packageNames, request.cwd, (ok) => { 39653 this.inFlightRequestCount--; 39654 request.onRequestCompleted(ok); 39655 this.executeWithThrottling(); 39656 }); 39657 } 39658 } 39659}; 39660function typingsName(packageName) { 39661 return `@types/${packageName}@ts${versionMajorMinor}`; 39662} 39663 39664// src/typingsInstaller/nodeTypingsInstaller.ts 39665var FileLog = class { 39666 constructor(logFile) { 39667 this.logFile = logFile; 39668 this.isEnabled = () => { 39669 return typeof this.logFile === "string"; 39670 }; 39671 this.writeLine = (text) => { 39672 if (typeof this.logFile !== "string") 39673 return; 39674 try { 39675 fs.appendFileSync(this.logFile, `[${nowString()}] ${text}${sys.newLine}`); 39676 } catch (e) { 39677 this.logFile = void 0; 39678 } 39679 }; 39680 } 39681}; 39682function getDefaultNPMLocation(processName, validateDefaultNpmLocation2, host) { 39683 if (path.basename(processName).indexOf("node") === 0) { 39684 const npmPath = path.join(path.dirname(process.argv[0]), "npm"); 39685 if (!validateDefaultNpmLocation2) { 39686 return npmPath; 39687 } 39688 if (host.fileExists(npmPath)) { 39689 return `"${npmPath}"`; 39690 } 39691 } 39692 return "npm"; 39693} 39694function loadTypesRegistryFile(typesRegistryFilePath, host, log2) { 39695 if (!host.fileExists(typesRegistryFilePath)) { 39696 if (log2.isEnabled()) { 39697 log2.writeLine(`Types registry file '${typesRegistryFilePath}' does not exist`); 39698 } 39699 return new Map2(); 39700 } 39701 try { 39702 const content = JSON.parse(host.readFile(typesRegistryFilePath)); 39703 return new Map2(getEntries(content.entries)); 39704 } catch (e) { 39705 if (log2.isEnabled()) { 39706 log2.writeLine(`Error when loading types registry file '${typesRegistryFilePath}': ${e.message}, ${e.stack}`); 39707 } 39708 return new Map2(); 39709 } 39710} 39711var typesRegistryPackageName = "types-registry"; 39712function getTypesRegistryFileLocation(globalTypingsCacheLocation2) { 39713 return combinePaths(normalizeSlashes(globalTypingsCacheLocation2), `node_modules/${typesRegistryPackageName}/index.json`); 39714} 39715var NodeTypingsInstaller = class extends TypingsInstaller { 39716 constructor(globalTypingsCacheLocation2, typingSafeListLocation2, typesMapLocation2, npmLocation2, validateDefaultNpmLocation2, throttleLimit, log2) { 39717 const libDirectory = getDirectoryPath(normalizePath(sys.getExecutingFilePath())); 39718 super( 39719 sys, 39720 globalTypingsCacheLocation2, 39721 typingSafeListLocation2 ? toPath(typingSafeListLocation2, "", createGetCanonicalFileName(sys.useCaseSensitiveFileNames)) : toPath("typingSafeList.json", libDirectory, createGetCanonicalFileName(sys.useCaseSensitiveFileNames)), 39722 typesMapLocation2 ? toPath(typesMapLocation2, "", createGetCanonicalFileName(sys.useCaseSensitiveFileNames)) : toPath("typesMap.json", libDirectory, createGetCanonicalFileName(sys.useCaseSensitiveFileNames)), 39723 throttleLimit, 39724 log2 39725 ); 39726 this.npmPath = npmLocation2 !== void 0 ? npmLocation2 : getDefaultNPMLocation(process.argv[0], validateDefaultNpmLocation2, this.installTypingHost); 39727 if (stringContains(this.npmPath, " ") && this.npmPath[0] !== `"`) { 39728 this.npmPath = `"${this.npmPath}"`; 39729 } 39730 if (this.log.isEnabled()) { 39731 this.log.writeLine(`Process id: ${process.pid}`); 39732 this.log.writeLine(`NPM location: ${this.npmPath} (explicit '${Arguments.NpmLocation}' ${npmLocation2 === void 0 ? "not " : ""} provided)`); 39733 this.log.writeLine(`validateDefaultNpmLocation: ${validateDefaultNpmLocation2}`); 39734 } 39735 ({ execSync: this.nodeExecSync } = require("child_process")); 39736 this.ensurePackageDirectoryExists(globalTypingsCacheLocation2); 39737 try { 39738 if (this.log.isEnabled()) { 39739 this.log.writeLine(`Updating ${typesRegistryPackageName} npm package...`); 39740 } 39741 this.execSyncAndLog(`${this.npmPath} install --ignore-scripts ${typesRegistryPackageName}@${this.latestDistTag}`, { cwd: globalTypingsCacheLocation2 }); 39742 if (this.log.isEnabled()) { 39743 this.log.writeLine(`Updated ${typesRegistryPackageName} npm package`); 39744 } 39745 } catch (e) { 39746 if (this.log.isEnabled()) { 39747 this.log.writeLine(`Error updating ${typesRegistryPackageName} package: ${e.message}`); 39748 } 39749 this.delayedInitializationError = { 39750 kind: "event::initializationFailed", 39751 message: e.message, 39752 stack: e.stack 39753 }; 39754 } 39755 this.typesRegistry = loadTypesRegistryFile(getTypesRegistryFileLocation(globalTypingsCacheLocation2), this.installTypingHost, this.log); 39756 } 39757 listen() { 39758 process.on("message", (req) => { 39759 if (this.delayedInitializationError) { 39760 this.sendResponse(this.delayedInitializationError); 39761 this.delayedInitializationError = void 0; 39762 } 39763 switch (req.kind) { 39764 case "discover": 39765 this.install(req); 39766 break; 39767 case "closeProject": 39768 this.closeProject(req); 39769 break; 39770 case "typesRegistry": { 39771 const typesRegistry = {}; 39772 this.typesRegistry.forEach((value, key) => { 39773 typesRegistry[key] = value; 39774 }); 39775 const response = { kind: EventTypesRegistry, typesRegistry }; 39776 this.sendResponse(response); 39777 break; 39778 } 39779 case "installPackage": { 39780 const { fileName, packageName, projectName, projectRootPath } = req; 39781 const cwd = getDirectoryOfPackageJson(fileName, this.installTypingHost) || projectRootPath; 39782 if (cwd) { 39783 this.installWorker(-1, [packageName], cwd, (success) => { 39784 const message = success ? `Package ${packageName} installed.` : `There was an error installing ${packageName}.`; 39785 const response = { kind: ActionPackageInstalled, projectName, success, message }; 39786 this.sendResponse(response); 39787 }); 39788 } else { 39789 const response = { kind: ActionPackageInstalled, projectName, success: false, message: "Could not determine a project root path." }; 39790 this.sendResponse(response); 39791 } 39792 break; 39793 } 39794 default: 39795 Debug.assertNever(req); 39796 } 39797 }); 39798 } 39799 sendResponse(response) { 39800 if (this.log.isEnabled()) { 39801 this.log.writeLine(`Sending response: 39802 ${JSON.stringify(response)}`); 39803 } 39804 process.send(response); 39805 if (this.log.isEnabled()) { 39806 this.log.writeLine(`Response has been sent.`); 39807 } 39808 } 39809 installWorker(requestId, packageNames, cwd, onRequestCompleted) { 39810 if (this.log.isEnabled()) { 39811 this.log.writeLine(`#${requestId} with arguments'${JSON.stringify(packageNames)}'.`); 39812 } 39813 const start = Date.now(); 39814 const hasError = installNpmPackages(this.npmPath, version, packageNames, (command) => this.execSyncAndLog(command, { cwd })); 39815 if (this.log.isEnabled()) { 39816 this.log.writeLine(`npm install #${requestId} took: ${Date.now() - start} ms`); 39817 } 39818 onRequestCompleted(!hasError); 39819 } 39820 execSyncAndLog(command, options) { 39821 if (this.log.isEnabled()) { 39822 this.log.writeLine(`Exec: ${command}`); 39823 } 39824 try { 39825 const stdout = this.nodeExecSync(command, { ...options, encoding: "utf-8" }); 39826 if (this.log.isEnabled()) { 39827 this.log.writeLine(` Succeeded. stdout:${indent(sys.newLine, stdout)}`); 39828 } 39829 return false; 39830 } catch (error) { 39831 const { stdout, stderr } = error; 39832 this.log.writeLine(` Failed. stdout:${indent(sys.newLine, stdout)}${sys.newLine} stderr:${indent(sys.newLine, stderr)}`); 39833 return true; 39834 } 39835 } 39836}; 39837function getDirectoryOfPackageJson(fileName, host) { 39838 return forEachAncestorDirectory(getDirectoryPath(fileName), (directory) => { 39839 if (host.fileExists(combinePaths(directory, "package.json"))) { 39840 return directory; 39841 } 39842 }); 39843} 39844var logFilePath = findArgument(Arguments.LogFile); 39845var globalTypingsCacheLocation = findArgument(Arguments.GlobalCacheLocation); 39846var typingSafeListLocation = findArgument(Arguments.TypingSafeListLocation); 39847var typesMapLocation = findArgument(Arguments.TypesMapLocation); 39848var npmLocation = findArgument(Arguments.NpmLocation); 39849var validateDefaultNpmLocation = hasArgument(Arguments.ValidateDefaultNpmLocation); 39850var log = new FileLog(logFilePath); 39851if (log.isEnabled()) { 39852 process.on("uncaughtException", (e) => { 39853 log.writeLine(`Unhandled exception: ${e} at ${e.stack}`); 39854 }); 39855} 39856process.on("disconnect", () => { 39857 if (log.isEnabled()) { 39858 log.writeLine(`Parent process has exited, shutting down...`); 39859 } 39860 process.exit(0); 39861}); 39862var installer = new NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, validateDefaultNpmLocation, 5, log); 39863installer.listen(); 39864function indent(newline, str) { 39865 return str && str.length ? `${newline} ` + str.replace(/\r?\n/, `${newline} `) : ""; 39866} 39867// Annotate the CommonJS export names for ESM import in node: 398680 && (module.exports = { 39869 NodeTypingsInstaller 39870}); 39871//# sourceMappingURL=typingsInstaller.js.map 39872