typescript 4.2.0-insiders.20210210 → 4.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -74,239 +74,6 @@ declare namespace Intl {
74
74
  */
75
75
  type RelativeTimeFormatStyle = "long" | "short" | "narrow";
76
76
 
77
- /**
78
- * Unicode Calendar Identifier
79
- *
80
- * [Reference](http://unicode.org/reports/tr35/#UnicodeCalendarIdentifier)
81
- *
82
- * [Source](https://github.com/unicode-org/cldr/blob/b805d0b/common/bcp47/calendar.xml)
83
- */
84
- type Calendar =
85
- // Thai Buddhist calendar
86
- | "buddhist"
87
- // Traditional Chinese calendar
88
- | "chinese"
89
- // Coptic calendar
90
- | "coptic"
91
- // Traditional Korean calendar
92
- | "dangi"
93
- // Ethiopic calendar, Amete Alem (epoch approx. 5493 B.C.E)
94
- | "ethiopic-amete-alem" | "ethioaa"
95
- // Ethiopic calendar, Amete Mihret (epoch approx, 8 C.E.)
96
- | "ethiopic"
97
- // Gregorian calendar
98
- | "gregorian"
99
- // Gregorian calendar (alias)
100
- | "gregory"
101
- // Traditional Hebrew calendar
102
- | "hebrew"
103
- // Indian calendar
104
- | "indian"
105
- // Islamic calendar
106
- | "islamic"
107
- // Islamic calendar, Umm al-Qura
108
- | "islamic-umalqura"
109
- // Islamic calendar, tabular (intercalary years [2,5,7,10,13,16,18,21,24,26,29] - astronomical epoch)
110
- | "islamic-tbla"
111
- // Islamic calendar, tabular (intercalary years [2,5,7,10,13,16,18,21,24,26,29] - civil epoch)
112
- | "islamic-civil"
113
- | "islamicc" // Deprecated alias
114
- // Islamic calendar, Saudi Arabia sighting
115
- | "islamic-rgsa"
116
- // ISO calendar (Gregorian calendar using the ISO 8601 calendar week rules)
117
- | "iso8601"
118
- // Japanese Imperial calendar
119
- | "japanese"
120
- // Persian calendar
121
- | "persian"
122
- // Republic of China calendar
123
- | "roc"
124
- ;
125
-
126
- /**
127
- * Unicode Number System Identifier
128
- *
129
- * [Reference](http://unicode.org/reports/tr35/#UnicodeNumberSystemIdentifier)
130
- *
131
- * [Source](https://github.com/unicode-org/cldr/blob/be7a953/common/bcp47/number.xml)
132
- */
133
- type NumberingSystem =
134
- // Adlam digits
135
- | "adlm"
136
- // Ahom digits
137
- | "ahom"
138
- // Arabic-Indic digits
139
- | "arab"
140
- // Extended Arabic-Indic digits
141
- | "arabext"
142
- // Armenian upper case numerals — algorithmic
143
- | "armn"
144
- // Armenian lower case numerals — algorithmic
145
- | "armnlow"
146
- // Balinese digits
147
- | "bali"
148
- // Bengali digits
149
- | "beng"
150
- // Bhaiksuki digits
151
- | "bhks"
152
- // Brahmi digits
153
- | "brah"
154
- // Chakma digits
155
- | "cakm"
156
- // Cham digits
157
- | "cham"
158
- // Cyrillic numerals — algorithmic
159
- | "cyrl"
160
- // Devanagari digits
161
- | "deva"
162
- // Dives Akuru digits
163
- | "diak"
164
- // Ethiopic numerals — algorithmic
165
- | "ethi"
166
- // Financial numerals — may be algorithmic
167
- | "finance"
168
- // Full width digits
169
- | "fullwide"
170
- // Georgian numerals — algorithmic
171
- | "geor"
172
- // Gunjala Gondi digits
173
- | "gong"
174
- // Masaram Gondi digits
175
- | "gonm"
176
- // Greek upper case numerals — algorithmic
177
- | "grek"
178
- // Greek lower case numerals — algorithmic
179
- | "greklow"
180
- // Gujarati digits
181
- | "gujr"
182
- // Gurmukhi digits
183
- | "guru"
184
- // Han-character day-of-month numbering for lunar/other traditional calendars"
185
- | "hanidays"
186
- // Positional decimal system using Chinese number ideographs as digits
187
- | "hanidec"
188
- // Simplified Chinese numerals — algorithmic
189
- | "hans"
190
- // Simplified Chinese financial numerals — algorithmic
191
- | "hansfin"
192
- // Traditional Chinese numerals — algorithmic
193
- | "hant"
194
- // Traditional Chinese financial numerals — algorithmic
195
- | "hantfin"
196
- // Hebrew numerals — algorithmic
197
- | "hebr"
198
- // Pahawh Hmong digits
199
- | "hmng"
200
- // Nyiakeng Puachue Hmong digits
201
- | "hmnp"
202
- // Javanese digits
203
- | "java"
204
- // Japanese numerals — algorithmic
205
- | "jpan"
206
- // Japanese financial numerals — algorithmic
207
- | "jpanfin"
208
- // Japanese first-year Gannen numbering for Japanese calendar
209
- | "jpanyear"
210
- // Kayah Li digits
211
- | "kali"
212
- // Khmer digits
213
- | "khmr"
214
- // Kannada digits
215
- | "knda"
216
- // Tai Tham Hora (secular) digits
217
- | "lana"
218
- // Tai Tham Tham (ecclesiastical) digits
219
- | "lanatham"
220
- // Lao digits
221
- | "laoo"
222
- // Latin digits
223
- | "latn"
224
- // Lepcha digits
225
- | "lepc"
226
- // Limbu digits
227
- | "limb"
228
- // Mathematical bold digits
229
- | "mathbold"
230
- // Mathematical double-struck digits
231
- | "mathdbl"
232
- // Mathematical monospace digits
233
- | "mathmono"
234
- // Mathematical sans-serif bold digits
235
- | "mathsanb"
236
- // Mathematical sans-serif digits
237
- | "mathsans"
238
- // Malayalam digits
239
- | "mlym"
240
- // Modi digits
241
- | "modi"
242
- // Mongolian digits
243
- | "mong"
244
- // Mro digits
245
- | "mroo"
246
- // Meetei Mayek digits
247
- | "mtei"
248
- // Myanmar digits
249
- | "mymr"
250
- // Myanmar Shan digits
251
- | "mymrshan"
252
- // Myanmar Tai Laing digits
253
- | "mymrtlng"
254
- // Native digits
255
- | "native"
256
- // Newa digits
257
- | "newa"
258
- // N'Ko digits
259
- | "nkoo"
260
- // Ol Chiki digits
261
- | "olck"
262
- // Oriya digits
263
- | "orya"
264
- // Osmanya digits
265
- | "osma"
266
- // Hanifi Rohingya digits
267
- | "rohg"
268
- // Roman upper case numerals — algorithmic
269
- | "roman"
270
- // Roman lowercase numerals — algorithmic
271
- | "romanlow"
272
- // Saurashtra digits
273
- | "saur"
274
- // Sharada digits
275
- | "shrd"
276
- // Khudawadi digits
277
- | "sind"
278
- // Sinhala Lith digits
279
- | "sinh"
280
- // Sora_Sompeng digits
281
- | "sora"
282
- // Sundanese digits
283
- | "sund"
284
- // Takri digits
285
- | "takr"
286
- // New Tai Lue digits
287
- | "talu"
288
- // Tamil numerals — algorithmic
289
- | "taml"
290
- // Modern Tamil decimal digits
291
- | "tamldec"
292
- // Telugu digits
293
- | "telu"
294
- // Thai digits
295
- | "thai"
296
- // Tirhuta digits
297
- | "tirh"
298
- // Tibetan digits
299
- | "tibt"
300
- // Traditional numerals — may be algorithmic
301
- | "traditional" | "traditio"
302
- // Vai digits
303
- | "vaii"
304
- // Warang Citi digits
305
- | "wara"
306
- // Wancho digits
307
- | "wcho"
308
- ;
309
-
310
77
  /**
311
78
  * An object with some or all of properties of `options` parameter
312
79
  * of `Intl.RelativeTimeFormat` constructor.
@@ -534,9 +301,9 @@ declare namespace Intl {
534
301
  interface DateTimeFormatOptions {
535
302
  dateStyle?: "full" | "long" | "medium" | "short";
536
303
  timeStyle?: "full" | "long" | "medium" | "short";
537
- calendar?: Calendar;
304
+ calendar?: string;
538
305
  dayPeriod?: "narrow" | "short" | "long";
539
- numberingSystem?: NumberingSystem;
306
+ numberingSystem?: string;
540
307
  hourCycle?: "h11" | "h12" | "h23" | "h24";
541
308
  fractionalSecondDigits?: 0 | 1 | 2 | 3;
542
309
  }
package/lib/protocol.d.ts CHANGED
@@ -603,6 +603,41 @@ declare namespace ts.server.protocol {
603
603
  */
604
604
  body?: string[];
605
605
  }
606
+ /**
607
+ * A request to get encoded semantic classifications for a span in the file
608
+ */
609
+ interface EncodedSemanticClassificationsRequest extends FileRequest {
610
+ arguments: EncodedSemanticClassificationsRequestArgs;
611
+ }
612
+ /**
613
+ * Arguments for EncodedSemanticClassificationsRequest request.
614
+ */
615
+ interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs {
616
+ /**
617
+ * Start position of the span.
618
+ */
619
+ start: number;
620
+ /**
621
+ * Length of the span.
622
+ */
623
+ length: number;
624
+ /**
625
+ * Optional parameter for the semantic highlighting response, if absent it
626
+ * defaults to "original".
627
+ */
628
+ format?: "original" | "2020";
629
+ }
630
+ /** The response for a EncodedSemanticClassificationsRequest */
631
+ interface EncodedSemanticClassificationsResponse extends Response {
632
+ body?: EncodedSemanticClassificationsResponseBody;
633
+ }
634
+ /**
635
+ * Implementation response message. Gives series of text spans depending on the format ar.
636
+ */
637
+ interface EncodedSemanticClassificationsResponseBody {
638
+ endOfLineState: EndOfLineState;
639
+ spans: number[];
640
+ }
606
641
  /**
607
642
  * Arguments in document highlight request; include: filesToSearch, file,
608
643
  * line, offset.
@@ -2626,6 +2661,33 @@ declare namespace ts.server.protocol {
2626
2661
  ES2020 = "ES2020",
2627
2662
  ESNext = "ESNext"
2628
2663
  }
2664
+ const enum ClassificationType {
2665
+ comment = 1,
2666
+ identifier = 2,
2667
+ keyword = 3,
2668
+ numericLiteral = 4,
2669
+ operator = 5,
2670
+ stringLiteral = 6,
2671
+ regularExpressionLiteral = 7,
2672
+ whiteSpace = 8,
2673
+ text = 9,
2674
+ punctuation = 10,
2675
+ className = 11,
2676
+ enumName = 12,
2677
+ interfaceName = 13,
2678
+ moduleName = 14,
2679
+ typeParameterName = 15,
2680
+ typeAliasName = 16,
2681
+ parameterName = 17,
2682
+ docCommentTagName = 18,
2683
+ jsxOpenTagName = 19,
2684
+ jsxCloseTagName = 20,
2685
+ jsxSelfClosingTagName = 21,
2686
+ jsxAttribute = 22,
2687
+ jsxText = 23,
2688
+ jsxAttributeStringLiteralValue = 24,
2689
+ bigintLiteral = 25
2690
+ }
2629
2691
  }
2630
2692
  declare namespace ts.server.protocol {
2631
2693
 
@@ -2786,6 +2848,7 @@ declare namespace ts.server.protocol {
2786
2848
  }
2787
2849
  declare namespace ts {
2788
2850
  // these types are empty stubs for types from services and should not be used directly
2851
+ export type EndOfLineState = never;
2789
2852
  export type ScriptKind = never;
2790
2853
  export type WatchFileKind = never;
2791
2854
  export type WatchDirectoryKind = never;
package/lib/tsc.js CHANGED
@@ -65,7 +65,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
65
65
  var ts;
66
66
  (function (ts) {
67
67
  ts.versionMajorMinor = "4.2";
68
- ts.version = ts.versionMajorMinor + ".0-insiders.20210210";
68
+ ts.version = "4.2.4";
69
69
  var NativeCollections;
70
70
  (function (NativeCollections) {
71
71
  function tryGetNativeMap() {
@@ -4399,13 +4399,13 @@ var ts;
4399
4399
  }
4400
4400
  var activeSession;
4401
4401
  var profilePath = "./profile.cpuprofile";
4402
- var realpathSync = (_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync;
4403
4402
  var Buffer = require("buffer").Buffer;
4404
4403
  var nodeVersion = getNodeMajorVersion();
4405
4404
  var isNode4OrLater = nodeVersion >= 4;
4406
4405
  var isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
4407
4406
  var platform = _os.platform();
4408
4407
  var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
4408
+ var realpathSync = useCaseSensitiveFileNames ? ((_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync) : _fs.realpathSync;
4409
4409
  var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
4410
4410
  var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
4411
4411
  var _c = createSystemWatchFunctions({
@@ -38474,7 +38474,9 @@ var ts;
38474
38474
  var result = new Type(checker, flags);
38475
38475
  typeCount++;
38476
38476
  result.id = typeCount;
38477
- typeCatalog.push(result);
38477
+ if (ts.tracing) {
38478
+ typeCatalog.push(result);
38479
+ }
38478
38480
  return result;
38479
38481
  }
38480
38482
  function createOriginType(flags) {
@@ -38531,13 +38533,16 @@ var ts;
38531
38533
  return result || ts.emptyArray;
38532
38534
  }
38533
38535
  function setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
38534
- type.members = members;
38535
- type.properties = members === emptySymbols ? ts.emptyArray : getNamedMembers(members);
38536
- type.callSignatures = callSignatures;
38537
- type.constructSignatures = constructSignatures;
38538
- type.stringIndexInfo = stringIndexInfo;
38539
- type.numberIndexInfo = numberIndexInfo;
38540
- return type;
38536
+ var resolved = type;
38537
+ resolved.members = members;
38538
+ resolved.properties = ts.emptyArray;
38539
+ resolved.callSignatures = callSignatures;
38540
+ resolved.constructSignatures = constructSignatures;
38541
+ resolved.stringIndexInfo = stringIndexInfo;
38542
+ resolved.numberIndexInfo = numberIndexInfo;
38543
+ if (members !== emptySymbols)
38544
+ resolved.properties = getNamedMembers(members);
38545
+ return resolved;
38541
38546
  }
38542
38547
  function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo) {
38543
38548
  return setStructuredTypeMembers(createObjectType(16, symbol), members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo);
@@ -46050,7 +46055,7 @@ var ts;
46050
46055
  }
46051
46056
  return true;
46052
46057
  }
46053
- function removeRedundantLiteralTypes(types, includes) {
46058
+ function removeRedundantLiteralTypes(types, includes, reduceVoidUndefined) {
46054
46059
  var i = types.length;
46055
46060
  while (i > 0) {
46056
46061
  i--;
@@ -46060,7 +46065,7 @@ var ts;
46060
46065
  flags & 256 && includes & 8 ||
46061
46066
  flags & 2048 && includes & 64 ||
46062
46067
  flags & 8192 && includes & 4096 ||
46063
- flags & 32768 && includes & 16384 ||
46068
+ reduceVoidUndefined && flags & 32768 && includes & 16384 ||
46064
46069
  isFreshLiteralType(t) && containsType(types, t.regularType);
46065
46070
  if (remove) {
46066
46071
  ts.orderedRemoveItemAt(types, i);
@@ -46092,7 +46097,7 @@ var ts;
46092
46097
  if (t.flags & 1048576) {
46093
46098
  var origin = t.origin;
46094
46099
  if (t.aliasSymbol || origin && !(origin.flags & 1048576)) {
46095
- namedUnions.push(t);
46100
+ ts.pushIfUnique(namedUnions, t);
46096
46101
  }
46097
46102
  else if (origin && origin.flags & 1048576) {
46098
46103
  addNamedUnions(namedUnions, origin.types);
@@ -46121,7 +46126,7 @@ var ts;
46121
46126
  }
46122
46127
  if (unionReduction & (1 | 2)) {
46123
46128
  if (includes & (2944 | 8192) || includes & 16384 && includes & 32768) {
46124
- removeRedundantLiteralTypes(typeSet, includes);
46129
+ removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2));
46125
46130
  }
46126
46131
  if (includes & 128 && includes & 134217728) {
46127
46132
  removeStringLiteralsMatchedByTemplateLiterals(typeSet);
@@ -53172,7 +53177,16 @@ var ts;
53172
53177
  var type = getTypeOfDottedName(node.expression, diagnostic);
53173
53178
  if (type) {
53174
53179
  var name = node.name;
53175
- var prop = getPropertyOfType(type, ts.isPrivateIdentifier(name) ? ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText) : name.escapedText);
53180
+ var prop = void 0;
53181
+ if (ts.isPrivateIdentifier(name)) {
53182
+ if (!type.symbol) {
53183
+ return undefined;
53184
+ }
53185
+ prop = getPropertyOfType(type, ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText));
53186
+ }
53187
+ else {
53188
+ prop = getPropertyOfType(type, name.escapedText);
53189
+ }
53176
53190
  return prop && getExplicitTypeOfSymbol(prop, diagnostic);
53177
53191
  }
53178
53192
  return undefined;
@@ -62908,7 +62922,9 @@ var ts;
62908
62922
  : ts.isPropertyAccessExpression(location) ? location.name
62909
62923
  : ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right
62910
62924
  : undefined;
62911
- if (!testedNode) {
62925
+ var isPropertyExpressionCast = ts.isPropertyAccessExpression(location)
62926
+ && ts.isAssertionExpression(ts.skipParentheses(location.expression));
62927
+ if (!testedNode || isPropertyExpressionCast) {
62912
62928
  return;
62913
62929
  }
62914
62930
  var possiblyFalsy = getFalsyFlags(type);
@@ -64681,6 +64697,7 @@ var ts;
64681
64697
  return true;
64682
64698
  }
64683
64699
  function checkAliasSymbol(node) {
64700
+ var _a;
64684
64701
  var symbol = getSymbolOfNode(node);
64685
64702
  var target = resolveAlias(symbol);
64686
64703
  if (target !== unknownSymbol) {
@@ -64701,7 +64718,7 @@ var ts;
64701
64718
  && !(node.flags & 8388608)) {
64702
64719
  error(node, ts.Diagnostics.Re_exporting_a_type_when_the_isolatedModules_flag_is_provided_requires_using_export_type);
64703
64720
  }
64704
- if (ts.isImportSpecifier(node) && ts.every(target.declarations, function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728); })) {
64721
+ if (ts.isImportSpecifier(node) && ((_a = target.declarations) === null || _a === void 0 ? void 0 : _a.every(function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728); }))) {
64705
64722
  addDeprecatedSuggestion(node.name, target.declarations, symbol.escapedName);
64706
64723
  }
64707
64724
  }
@@ -91658,8 +91675,9 @@ var ts;
91658
91675
  var redirects = host.redirectTargetsMap.get(importedPath) || ts.emptyArray;
91659
91676
  var importedFileNames = __spreadArray(__spreadArray(__spreadArray([], (referenceRedirect ? [referenceRedirect] : ts.emptyArray)), [importedFileName]), redirects);
91660
91677
  var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
91678
+ var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);
91661
91679
  if (!preferSymlinks) {
91662
- var result_15 = ts.forEach(targets, function (p) { return !ts.containsIgnoredPath(p) && cb(p, referenceRedirect === p); });
91680
+ var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
91663
91681
  if (result_15)
91664
91682
  return result_15;
91665
91683
  }
@@ -91684,13 +91702,14 @@ var ts;
91684
91702
  var symlinkDirectory = symlinkDirectories_1[_i];
91685
91703
  var option = ts.resolvePath(symlinkDirectory, relative);
91686
91704
  var result_16 = cb(option, target === referenceRedirect);
91705
+ shouldFilterIgnoredPaths = true;
91687
91706
  if (result_16)
91688
91707
  return result_16;
91689
91708
  }
91690
91709
  });
91691
91710
  });
91692
91711
  return result || (preferSymlinks
91693
- ? ts.forEach(targets, function (p) { return ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
91712
+ ? ts.forEach(targets, function (p) { return shouldFilterIgnoredPaths && ts.containsIgnoredPath(p) ? undefined : cb(p, p === referenceRedirect); })
91694
91713
  : undefined);
91695
91714
  }
91696
91715
  moduleSpecifiers.forEachFileNameOfModule = forEachFileNameOfModule;