@typescript-deploys/pr-build 5.4.0-pr-56967-3 → 5.4.0-pr-56034-9
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.
- package/lib/tsc.js +55 -1
- package/lib/tsserver.js +70 -2
- package/lib/typescript.d.ts +3 -11
- package/lib/typescript.js +69 -2
- package/lib/typingsInstaller.js +1 -1
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.4";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240108`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -17672,6 +17672,9 @@ var stringReplace = String.prototype.replace;
|
|
|
17672
17672
|
function replaceFirstStar(s, replacement) {
|
|
17673
17673
|
return stringReplace.call(s, "*", replacement);
|
|
17674
17674
|
}
|
|
17675
|
+
function getNameFromImportAttribute(node) {
|
|
17676
|
+
return isIdentifier(node.name) ? node.name.escapedText : escapeLeadingUnderscores(node.name.text);
|
|
17677
|
+
}
|
|
17675
17678
|
|
|
17676
17679
|
// src/compiler/factory/baseNodeFactory.ts
|
|
17677
17680
|
function createBaseNodeFactory() {
|
|
@@ -44439,6 +44442,7 @@ function createTypeChecker(host) {
|
|
|
44439
44442
|
var deferredGlobalImportMetaType;
|
|
44440
44443
|
var deferredGlobalImportMetaExpressionType;
|
|
44441
44444
|
var deferredGlobalImportCallOptionsType;
|
|
44445
|
+
var deferredGlobalImportAttributesType;
|
|
44442
44446
|
var deferredGlobalDisposableType;
|
|
44443
44447
|
var deferredGlobalAsyncDisposableType;
|
|
44444
44448
|
var deferredGlobalExtractSymbol;
|
|
@@ -52739,6 +52743,24 @@ function createTypeChecker(host) {
|
|
|
52739
52743
|
0 /* Normal */
|
|
52740
52744
|
), declaration, reportErrors2);
|
|
52741
52745
|
}
|
|
52746
|
+
function getTypeFromImportAttributes(node) {
|
|
52747
|
+
const links = getNodeLinks(node);
|
|
52748
|
+
if (!links.resolvedType) {
|
|
52749
|
+
const symbol = createSymbol(4096 /* ObjectLiteral */, "__importAttributes" /* ImportAttributes */);
|
|
52750
|
+
const members = createSymbolTable();
|
|
52751
|
+
forEach(node.elements, (attr) => {
|
|
52752
|
+
const member = createSymbol(4 /* Property */, getNameFromImportAttribute(attr));
|
|
52753
|
+
member.parent = symbol;
|
|
52754
|
+
member.links.type = checkImportAttribute(attr);
|
|
52755
|
+
member.links.target = member;
|
|
52756
|
+
members.set(member.escapedName, member);
|
|
52757
|
+
});
|
|
52758
|
+
const type = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
52759
|
+
type.objectFlags |= 128 /* ObjectLiteral */ | 262144 /* NonInferrableType */;
|
|
52760
|
+
links.resolvedType = type;
|
|
52761
|
+
}
|
|
52762
|
+
return links.resolvedType;
|
|
52763
|
+
}
|
|
52742
52764
|
function isGlobalSymbolConstructor(node) {
|
|
52743
52765
|
const symbol = getSymbolOfNode(node);
|
|
52744
52766
|
const globalSymbol = getGlobalESSymbolConstructorTypeSymbol(
|
|
@@ -56720,6 +56742,14 @@ function createTypeChecker(host) {
|
|
|
56720
56742
|
reportErrors2
|
|
56721
56743
|
)) || emptyObjectType;
|
|
56722
56744
|
}
|
|
56745
|
+
function getGlobalImportAttributesType(reportErrors2) {
|
|
56746
|
+
return deferredGlobalImportAttributesType || (deferredGlobalImportAttributesType = getGlobalType(
|
|
56747
|
+
"ImportAttributes",
|
|
56748
|
+
/*arity*/
|
|
56749
|
+
0,
|
|
56750
|
+
reportErrors2
|
|
56751
|
+
)) || emptyObjectType;
|
|
56752
|
+
}
|
|
56723
56753
|
function getGlobalESSymbolConstructorSymbol(reportErrors2) {
|
|
56724
56754
|
return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol", reportErrors2));
|
|
56725
56755
|
}
|
|
@@ -68828,6 +68858,8 @@ function createTypeChecker(host) {
|
|
|
68828
68858
|
case 286 /* JsxOpeningElement */:
|
|
68829
68859
|
case 285 /* JsxSelfClosingElement */:
|
|
68830
68860
|
return getContextualJsxElementAttributesType(parent, contextFlags);
|
|
68861
|
+
case 301 /* ImportAttribute */:
|
|
68862
|
+
return getContextualImportAttributeType(parent);
|
|
68831
68863
|
}
|
|
68832
68864
|
return void 0;
|
|
68833
68865
|
}
|
|
@@ -68875,6 +68907,12 @@ function createTypeChecker(host) {
|
|
|
68875
68907
|
}
|
|
68876
68908
|
}
|
|
68877
68909
|
}
|
|
68910
|
+
function getContextualImportAttributeType(node) {
|
|
68911
|
+
return getTypeOfPropertyOfContextualType(getGlobalImportAttributesType(
|
|
68912
|
+
/*reportErrors*/
|
|
68913
|
+
false
|
|
68914
|
+
), getNameFromImportAttribute(node));
|
|
68915
|
+
}
|
|
68878
68916
|
function getContextualJsxElementAttributesType(node, contextFlags) {
|
|
68879
68917
|
if (isJsxOpeningElement(node) && contextFlags !== 4 /* Completions */) {
|
|
68880
68918
|
const index = findContextualNode(
|
|
@@ -80960,6 +80998,13 @@ function createTypeChecker(host) {
|
|
|
80960
80998
|
var _a;
|
|
80961
80999
|
const node = declaration.attributes;
|
|
80962
81000
|
if (node) {
|
|
81001
|
+
const importAttributesType = getGlobalImportAttributesType(
|
|
81002
|
+
/*reportErrors*/
|
|
81003
|
+
true
|
|
81004
|
+
);
|
|
81005
|
+
if (importAttributesType !== emptyObjectType) {
|
|
81006
|
+
checkTypeAssignableTo(getTypeFromImportAttributes(node), getNullableType(importAttributesType, 32768 /* Undefined */), node);
|
|
81007
|
+
}
|
|
80963
81008
|
const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
80964
81009
|
const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : void 0);
|
|
80965
81010
|
const isImportAttributes2 = declaration.attributes.token === 118 /* WithKeyword */;
|
|
@@ -80979,6 +81024,9 @@ function createTypeChecker(host) {
|
|
|
80979
81024
|
}
|
|
80980
81025
|
}
|
|
80981
81026
|
}
|
|
81027
|
+
function checkImportAttribute(node) {
|
|
81028
|
+
return getRegularTypeOfLiteralType(checkExpressionCached(node.value));
|
|
81029
|
+
}
|
|
80982
81030
|
function checkImportDeclaration(node) {
|
|
80983
81031
|
if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
|
|
80984
81032
|
return;
|
|
@@ -82394,6 +82442,12 @@ function createTypeChecker(host) {
|
|
|
82394
82442
|
if (isMetaProperty(node.parent) && node.parent.keywordToken === node.kind) {
|
|
82395
82443
|
return checkMetaPropertyKeyword(node.parent);
|
|
82396
82444
|
}
|
|
82445
|
+
if (isImportAttributes(node)) {
|
|
82446
|
+
return getGlobalImportAttributesType(
|
|
82447
|
+
/*reportErrors*/
|
|
82448
|
+
false
|
|
82449
|
+
);
|
|
82450
|
+
}
|
|
82397
82451
|
return errorType;
|
|
82398
82452
|
}
|
|
82399
82453
|
function getTypeOfAssignmentPattern(expr) {
|
package/lib/tsserver.js
CHANGED
|
@@ -898,6 +898,7 @@ __export(server_exports, {
|
|
|
898
898
|
getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference,
|
|
899
899
|
getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost,
|
|
900
900
|
getNameForExportedSymbol: () => getNameForExportedSymbol,
|
|
901
|
+
getNameFromImportAttribute: () => getNameFromImportAttribute,
|
|
901
902
|
getNameFromIndexInfo: () => getNameFromIndexInfo,
|
|
902
903
|
getNameFromPropertyName: () => getNameFromPropertyName,
|
|
903
904
|
getNameOfAccessExpression: () => getNameOfAccessExpression,
|
|
@@ -2341,7 +2342,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2341
2342
|
|
|
2342
2343
|
// src/compiler/corePublic.ts
|
|
2343
2344
|
var versionMajorMinor = "5.4";
|
|
2344
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2345
|
+
var version = `${versionMajorMinor}.0-insiders.20240108`;
|
|
2345
2346
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2346
2347
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2347
2348
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6600,6 +6601,7 @@ var InternalSymbolName = /* @__PURE__ */ ((InternalSymbolName2) => {
|
|
|
6600
6601
|
InternalSymbolName2["Default"] = "default";
|
|
6601
6602
|
InternalSymbolName2["This"] = "this";
|
|
6602
6603
|
InternalSymbolName2["InstantiationExpression"] = "__instantiationExpression";
|
|
6604
|
+
InternalSymbolName2["ImportAttributes"] = "__importAttributes";
|
|
6603
6605
|
return InternalSymbolName2;
|
|
6604
6606
|
})(InternalSymbolName || {});
|
|
6605
6607
|
var NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags2) => {
|
|
@@ -21904,6 +21906,9 @@ var stringReplace = String.prototype.replace;
|
|
|
21904
21906
|
function replaceFirstStar(s, replacement) {
|
|
21905
21907
|
return stringReplace.call(s, "*", replacement);
|
|
21906
21908
|
}
|
|
21909
|
+
function getNameFromImportAttribute(node) {
|
|
21910
|
+
return isIdentifier(node.name) ? node.name.escapedText : escapeLeadingUnderscores(node.name.text);
|
|
21911
|
+
}
|
|
21907
21912
|
|
|
21908
21913
|
// src/compiler/factory/baseNodeFactory.ts
|
|
21909
21914
|
function createBaseNodeFactory() {
|
|
@@ -49178,6 +49183,7 @@ function createTypeChecker(host) {
|
|
|
49178
49183
|
var deferredGlobalImportMetaType;
|
|
49179
49184
|
var deferredGlobalImportMetaExpressionType;
|
|
49180
49185
|
var deferredGlobalImportCallOptionsType;
|
|
49186
|
+
var deferredGlobalImportAttributesType;
|
|
49181
49187
|
var deferredGlobalDisposableType;
|
|
49182
49188
|
var deferredGlobalAsyncDisposableType;
|
|
49183
49189
|
var deferredGlobalExtractSymbol;
|
|
@@ -57478,6 +57484,24 @@ function createTypeChecker(host) {
|
|
|
57478
57484
|
0 /* Normal */
|
|
57479
57485
|
), declaration, reportErrors2);
|
|
57480
57486
|
}
|
|
57487
|
+
function getTypeFromImportAttributes(node) {
|
|
57488
|
+
const links = getNodeLinks(node);
|
|
57489
|
+
if (!links.resolvedType) {
|
|
57490
|
+
const symbol = createSymbol(4096 /* ObjectLiteral */, "__importAttributes" /* ImportAttributes */);
|
|
57491
|
+
const members = createSymbolTable();
|
|
57492
|
+
forEach(node.elements, (attr) => {
|
|
57493
|
+
const member = createSymbol(4 /* Property */, getNameFromImportAttribute(attr));
|
|
57494
|
+
member.parent = symbol;
|
|
57495
|
+
member.links.type = checkImportAttribute(attr);
|
|
57496
|
+
member.links.target = member;
|
|
57497
|
+
members.set(member.escapedName, member);
|
|
57498
|
+
});
|
|
57499
|
+
const type = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
57500
|
+
type.objectFlags |= 128 /* ObjectLiteral */ | 262144 /* NonInferrableType */;
|
|
57501
|
+
links.resolvedType = type;
|
|
57502
|
+
}
|
|
57503
|
+
return links.resolvedType;
|
|
57504
|
+
}
|
|
57481
57505
|
function isGlobalSymbolConstructor(node) {
|
|
57482
57506
|
const symbol = getSymbolOfNode(node);
|
|
57483
57507
|
const globalSymbol = getGlobalESSymbolConstructorTypeSymbol(
|
|
@@ -61459,6 +61483,14 @@ function createTypeChecker(host) {
|
|
|
61459
61483
|
reportErrors2
|
|
61460
61484
|
)) || emptyObjectType;
|
|
61461
61485
|
}
|
|
61486
|
+
function getGlobalImportAttributesType(reportErrors2) {
|
|
61487
|
+
return deferredGlobalImportAttributesType || (deferredGlobalImportAttributesType = getGlobalType(
|
|
61488
|
+
"ImportAttributes",
|
|
61489
|
+
/*arity*/
|
|
61490
|
+
0,
|
|
61491
|
+
reportErrors2
|
|
61492
|
+
)) || emptyObjectType;
|
|
61493
|
+
}
|
|
61462
61494
|
function getGlobalESSymbolConstructorSymbol(reportErrors2) {
|
|
61463
61495
|
return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol", reportErrors2));
|
|
61464
61496
|
}
|
|
@@ -73567,6 +73599,8 @@ function createTypeChecker(host) {
|
|
|
73567
73599
|
case 286 /* JsxOpeningElement */:
|
|
73568
73600
|
case 285 /* JsxSelfClosingElement */:
|
|
73569
73601
|
return getContextualJsxElementAttributesType(parent2, contextFlags);
|
|
73602
|
+
case 301 /* ImportAttribute */:
|
|
73603
|
+
return getContextualImportAttributeType(parent2);
|
|
73570
73604
|
}
|
|
73571
73605
|
return void 0;
|
|
73572
73606
|
}
|
|
@@ -73614,6 +73648,12 @@ function createTypeChecker(host) {
|
|
|
73614
73648
|
}
|
|
73615
73649
|
}
|
|
73616
73650
|
}
|
|
73651
|
+
function getContextualImportAttributeType(node) {
|
|
73652
|
+
return getTypeOfPropertyOfContextualType(getGlobalImportAttributesType(
|
|
73653
|
+
/*reportErrors*/
|
|
73654
|
+
false
|
|
73655
|
+
), getNameFromImportAttribute(node));
|
|
73656
|
+
}
|
|
73617
73657
|
function getContextualJsxElementAttributesType(node, contextFlags) {
|
|
73618
73658
|
if (isJsxOpeningElement(node) && contextFlags !== 4 /* Completions */) {
|
|
73619
73659
|
const index = findContextualNode(
|
|
@@ -85699,6 +85739,13 @@ function createTypeChecker(host) {
|
|
|
85699
85739
|
var _a;
|
|
85700
85740
|
const node = declaration.attributes;
|
|
85701
85741
|
if (node) {
|
|
85742
|
+
const importAttributesType = getGlobalImportAttributesType(
|
|
85743
|
+
/*reportErrors*/
|
|
85744
|
+
true
|
|
85745
|
+
);
|
|
85746
|
+
if (importAttributesType !== emptyObjectType) {
|
|
85747
|
+
checkTypeAssignableTo(getTypeFromImportAttributes(node), getNullableType(importAttributesType, 32768 /* Undefined */), node);
|
|
85748
|
+
}
|
|
85702
85749
|
const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
85703
85750
|
const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : void 0);
|
|
85704
85751
|
const isImportAttributes2 = declaration.attributes.token === 118 /* WithKeyword */;
|
|
@@ -85718,6 +85765,9 @@ function createTypeChecker(host) {
|
|
|
85718
85765
|
}
|
|
85719
85766
|
}
|
|
85720
85767
|
}
|
|
85768
|
+
function checkImportAttribute(node) {
|
|
85769
|
+
return getRegularTypeOfLiteralType(checkExpressionCached(node.value));
|
|
85770
|
+
}
|
|
85721
85771
|
function checkImportDeclaration(node) {
|
|
85722
85772
|
if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
|
|
85723
85773
|
return;
|
|
@@ -87133,6 +87183,12 @@ function createTypeChecker(host) {
|
|
|
87133
87183
|
if (isMetaProperty(node.parent) && node.parent.keywordToken === node.kind) {
|
|
87134
87184
|
return checkMetaPropertyKeyword(node.parent);
|
|
87135
87185
|
}
|
|
87186
|
+
if (isImportAttributes(node)) {
|
|
87187
|
+
return getGlobalImportAttributesType(
|
|
87188
|
+
/*reportErrors*/
|
|
87189
|
+
false
|
|
87190
|
+
);
|
|
87191
|
+
}
|
|
87136
87192
|
return errorType;
|
|
87137
87193
|
}
|
|
87138
87194
|
function getTypeOfAssignmentPattern(expr) {
|
|
@@ -160753,7 +160809,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
160753
160809
|
return isIdentifier(e) ? e : isPropertyAccessExpression(e) ? getLeftMostName(e.expression) : void 0;
|
|
160754
160810
|
}
|
|
160755
160811
|
function tryGetGlobalSymbols() {
|
|
160756
|
-
const result = tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() || tryGetObjectLikeCompletionSymbols() || tryGetImportCompletionSymbols() || tryGetImportOrExportClauseCompletionSymbols() || tryGetLocalNamedExportCompletionSymbols() || tryGetConstructorCompletion() || tryGetClassLikeCompletionSymbols() || tryGetJsxCompletionSymbols() || (getGlobalCompletions(), 1 /* Success */);
|
|
160812
|
+
const result = tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() || tryGetObjectLikeCompletionSymbols() || tryGetImportCompletionSymbols() || tryGetImportOrExportClauseCompletionSymbols() || tryGetImportAttributesCompletionSymbols() || tryGetLocalNamedExportCompletionSymbols() || tryGetConstructorCompletion() || tryGetClassLikeCompletionSymbols() || tryGetJsxCompletionSymbols() || (getGlobalCompletions(), 1 /* Success */);
|
|
160757
160813
|
return result === 1 /* Success */;
|
|
160758
160814
|
}
|
|
160759
160815
|
function tryGetConstructorCompletion() {
|
|
@@ -161221,6 +161277,16 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
161221
161277
|
}
|
|
161222
161278
|
return 1 /* Success */;
|
|
161223
161279
|
}
|
|
161280
|
+
function tryGetImportAttributesCompletionSymbols() {
|
|
161281
|
+
if (contextToken === void 0)
|
|
161282
|
+
return 0 /* Continue */;
|
|
161283
|
+
const importAttributes = contextToken.kind === 19 /* OpenBraceToken */ || contextToken.kind === 28 /* CommaToken */ ? tryCast(contextToken.parent, isImportAttributes) : void 0;
|
|
161284
|
+
if (importAttributes === void 0)
|
|
161285
|
+
return 0 /* Continue */;
|
|
161286
|
+
const existing = new Set(importAttributes.elements.map(getNameFromImportAttribute));
|
|
161287
|
+
symbols = filter(typeChecker.getTypeAtLocation(importAttributes).getApparentProperties(), (attr) => !existing.has(attr.escapedName));
|
|
161288
|
+
return 1 /* Success */;
|
|
161289
|
+
}
|
|
161224
161290
|
function tryGetLocalNamedExportCompletionSymbols() {
|
|
161225
161291
|
var _a;
|
|
161226
161292
|
const namedExports = contextToken && (contextToken.kind === 19 /* OpenBraceToken */ || contextToken.kind === 28 /* CommaToken */) ? tryCast(contextToken.parent, isNamedExports) : void 0;
|
|
@@ -174727,6 +174793,7 @@ __export(ts_exports2, {
|
|
|
174727
174793
|
getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference,
|
|
174728
174794
|
getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost,
|
|
174729
174795
|
getNameForExportedSymbol: () => getNameForExportedSymbol,
|
|
174796
|
+
getNameFromImportAttribute: () => getNameFromImportAttribute,
|
|
174730
174797
|
getNameFromIndexInfo: () => getNameFromIndexInfo,
|
|
174731
174798
|
getNameFromPropertyName: () => getNameFromPropertyName,
|
|
174732
174799
|
getNameOfAccessExpression: () => getNameOfAccessExpression,
|
|
@@ -189528,6 +189595,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
189528
189595
|
getModuleSpecifierEndingPreference,
|
|
189529
189596
|
getModuleSpecifierResolverHost,
|
|
189530
189597
|
getNameForExportedSymbol,
|
|
189598
|
+
getNameFromImportAttribute,
|
|
189531
189599
|
getNameFromIndexInfo,
|
|
189532
189600
|
getNameFromPropertyName,
|
|
189533
189601
|
getNameOfAccessExpression,
|
package/lib/typescript.d.ts
CHANGED
|
@@ -6021,19 +6021,10 @@ declare namespace ts {
|
|
|
6021
6021
|
/** @deprecated */
|
|
6022
6022
|
type AssertionKey = ImportAttributeName;
|
|
6023
6023
|
/** @deprecated */
|
|
6024
|
-
interface AssertEntry extends
|
|
6025
|
-
readonly kind: SyntaxKind.AssertEntry;
|
|
6026
|
-
readonly parent: AssertClause;
|
|
6027
|
-
readonly name: ImportAttributeName;
|
|
6028
|
-
readonly value: Expression;
|
|
6024
|
+
interface AssertEntry extends ImportAttribute {
|
|
6029
6025
|
}
|
|
6030
6026
|
/** @deprecated */
|
|
6031
|
-
interface AssertClause extends
|
|
6032
|
-
readonly token: SyntaxKind.WithKeyword | SyntaxKind.AssertKeyword;
|
|
6033
|
-
readonly kind: SyntaxKind.AssertClause;
|
|
6034
|
-
readonly parent: ImportDeclaration | ExportDeclaration;
|
|
6035
|
-
readonly elements: NodeArray<AssertEntry>;
|
|
6036
|
-
readonly multiLine?: boolean;
|
|
6027
|
+
interface AssertClause extends ImportAttributes {
|
|
6037
6028
|
}
|
|
6038
6029
|
type ImportAttributeName = Identifier | StringLiteral;
|
|
6039
6030
|
interface ImportAttribute extends Node {
|
|
@@ -7078,6 +7069,7 @@ declare namespace ts {
|
|
|
7078
7069
|
Default = "default",
|
|
7079
7070
|
This = "this",
|
|
7080
7071
|
InstantiationExpression = "__instantiationExpression",
|
|
7072
|
+
ImportAttributes = "__importAttributes",
|
|
7081
7073
|
}
|
|
7082
7074
|
/**
|
|
7083
7075
|
* This represents a string whose leading underscore have been escaped by adding extra leading underscores.
|
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.4";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20240108`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4352,6 +4352,7 @@ ${lanes.join("\n")}
|
|
|
4352
4352
|
InternalSymbolName2["Default"] = "default";
|
|
4353
4353
|
InternalSymbolName2["This"] = "this";
|
|
4354
4354
|
InternalSymbolName2["InstantiationExpression"] = "__instantiationExpression";
|
|
4355
|
+
InternalSymbolName2["ImportAttributes"] = "__importAttributes";
|
|
4355
4356
|
return InternalSymbolName2;
|
|
4356
4357
|
})(InternalSymbolName || {});
|
|
4357
4358
|
NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags2) => {
|
|
@@ -18898,6 +18899,9 @@ ${lanes.join("\n")}
|
|
|
18898
18899
|
function replaceFirstStar(s, replacement) {
|
|
18899
18900
|
return stringReplace.call(s, "*", replacement);
|
|
18900
18901
|
}
|
|
18902
|
+
function getNameFromImportAttribute(node) {
|
|
18903
|
+
return isIdentifier(node.name) ? node.name.escapedText : escapeLeadingUnderscores(node.name.text);
|
|
18904
|
+
}
|
|
18901
18905
|
var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, getScriptTargetFeatures, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashLibReferenceRegEx, fullTripleSlashAMDReferencePathRegEx, fullTripleSlashAMDModuleRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, computedOptions, getEmitScriptTarget, getEmitModuleKind, getEmitModuleResolutionKind, getEmitModuleDetectionKind, getIsolatedModules, getESModuleInterop, getAllowSyntheticDefaultImports, getResolvePackageJsonExports, getResolvePackageJsonImports, getResolveJsonModule, getEmitDeclarations, shouldPreserveConstEnums, isIncrementalCompilation, getAreDeclarationMapsEnabled, getAllowJSCompilerOption, getUseDefineForClassFields, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries, stringReplace;
|
|
18902
18906
|
var init_utilities = __esm({
|
|
18903
18907
|
"src/compiler/utilities.ts"() {
|
|
@@ -46932,6 +46936,7 @@ ${lanes.join("\n")}
|
|
|
46932
46936
|
var deferredGlobalImportMetaType;
|
|
46933
46937
|
var deferredGlobalImportMetaExpressionType;
|
|
46934
46938
|
var deferredGlobalImportCallOptionsType;
|
|
46939
|
+
var deferredGlobalImportAttributesType;
|
|
46935
46940
|
var deferredGlobalDisposableType;
|
|
46936
46941
|
var deferredGlobalAsyncDisposableType;
|
|
46937
46942
|
var deferredGlobalExtractSymbol;
|
|
@@ -55232,6 +55237,24 @@ ${lanes.join("\n")}
|
|
|
55232
55237
|
0 /* Normal */
|
|
55233
55238
|
), declaration, reportErrors2);
|
|
55234
55239
|
}
|
|
55240
|
+
function getTypeFromImportAttributes(node) {
|
|
55241
|
+
const links = getNodeLinks(node);
|
|
55242
|
+
if (!links.resolvedType) {
|
|
55243
|
+
const symbol = createSymbol(4096 /* ObjectLiteral */, "__importAttributes" /* ImportAttributes */);
|
|
55244
|
+
const members = createSymbolTable();
|
|
55245
|
+
forEach(node.elements, (attr) => {
|
|
55246
|
+
const member = createSymbol(4 /* Property */, getNameFromImportAttribute(attr));
|
|
55247
|
+
member.parent = symbol;
|
|
55248
|
+
member.links.type = checkImportAttribute(attr);
|
|
55249
|
+
member.links.target = member;
|
|
55250
|
+
members.set(member.escapedName, member);
|
|
55251
|
+
});
|
|
55252
|
+
const type = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
55253
|
+
type.objectFlags |= 128 /* ObjectLiteral */ | 262144 /* NonInferrableType */;
|
|
55254
|
+
links.resolvedType = type;
|
|
55255
|
+
}
|
|
55256
|
+
return links.resolvedType;
|
|
55257
|
+
}
|
|
55235
55258
|
function isGlobalSymbolConstructor(node) {
|
|
55236
55259
|
const symbol = getSymbolOfNode(node);
|
|
55237
55260
|
const globalSymbol = getGlobalESSymbolConstructorTypeSymbol(
|
|
@@ -59213,6 +59236,14 @@ ${lanes.join("\n")}
|
|
|
59213
59236
|
reportErrors2
|
|
59214
59237
|
)) || emptyObjectType;
|
|
59215
59238
|
}
|
|
59239
|
+
function getGlobalImportAttributesType(reportErrors2) {
|
|
59240
|
+
return deferredGlobalImportAttributesType || (deferredGlobalImportAttributesType = getGlobalType(
|
|
59241
|
+
"ImportAttributes",
|
|
59242
|
+
/*arity*/
|
|
59243
|
+
0,
|
|
59244
|
+
reportErrors2
|
|
59245
|
+
)) || emptyObjectType;
|
|
59246
|
+
}
|
|
59216
59247
|
function getGlobalESSymbolConstructorSymbol(reportErrors2) {
|
|
59217
59248
|
return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol", reportErrors2));
|
|
59218
59249
|
}
|
|
@@ -71321,6 +71352,8 @@ ${lanes.join("\n")}
|
|
|
71321
71352
|
case 286 /* JsxOpeningElement */:
|
|
71322
71353
|
case 285 /* JsxSelfClosingElement */:
|
|
71323
71354
|
return getContextualJsxElementAttributesType(parent2, contextFlags);
|
|
71355
|
+
case 301 /* ImportAttribute */:
|
|
71356
|
+
return getContextualImportAttributeType(parent2);
|
|
71324
71357
|
}
|
|
71325
71358
|
return void 0;
|
|
71326
71359
|
}
|
|
@@ -71368,6 +71401,12 @@ ${lanes.join("\n")}
|
|
|
71368
71401
|
}
|
|
71369
71402
|
}
|
|
71370
71403
|
}
|
|
71404
|
+
function getContextualImportAttributeType(node) {
|
|
71405
|
+
return getTypeOfPropertyOfContextualType(getGlobalImportAttributesType(
|
|
71406
|
+
/*reportErrors*/
|
|
71407
|
+
false
|
|
71408
|
+
), getNameFromImportAttribute(node));
|
|
71409
|
+
}
|
|
71371
71410
|
function getContextualJsxElementAttributesType(node, contextFlags) {
|
|
71372
71411
|
if (isJsxOpeningElement(node) && contextFlags !== 4 /* Completions */) {
|
|
71373
71412
|
const index = findContextualNode(
|
|
@@ -83453,6 +83492,13 @@ ${lanes.join("\n")}
|
|
|
83453
83492
|
var _a;
|
|
83454
83493
|
const node = declaration.attributes;
|
|
83455
83494
|
if (node) {
|
|
83495
|
+
const importAttributesType = getGlobalImportAttributesType(
|
|
83496
|
+
/*reportErrors*/
|
|
83497
|
+
true
|
|
83498
|
+
);
|
|
83499
|
+
if (importAttributesType !== emptyObjectType) {
|
|
83500
|
+
checkTypeAssignableTo(getTypeFromImportAttributes(node), getNullableType(importAttributesType, 32768 /* Undefined */), node);
|
|
83501
|
+
}
|
|
83456
83502
|
const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
83457
83503
|
const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : void 0);
|
|
83458
83504
|
const isImportAttributes2 = declaration.attributes.token === 118 /* WithKeyword */;
|
|
@@ -83472,6 +83518,9 @@ ${lanes.join("\n")}
|
|
|
83472
83518
|
}
|
|
83473
83519
|
}
|
|
83474
83520
|
}
|
|
83521
|
+
function checkImportAttribute(node) {
|
|
83522
|
+
return getRegularTypeOfLiteralType(checkExpressionCached(node.value));
|
|
83523
|
+
}
|
|
83475
83524
|
function checkImportDeclaration(node) {
|
|
83476
83525
|
if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
|
|
83477
83526
|
return;
|
|
@@ -84887,6 +84936,12 @@ ${lanes.join("\n")}
|
|
|
84887
84936
|
if (isMetaProperty(node.parent) && node.parent.keywordToken === node.kind) {
|
|
84888
84937
|
return checkMetaPropertyKeyword(node.parent);
|
|
84889
84938
|
}
|
|
84939
|
+
if (isImportAttributes(node)) {
|
|
84940
|
+
return getGlobalImportAttributesType(
|
|
84941
|
+
/*reportErrors*/
|
|
84942
|
+
false
|
|
84943
|
+
);
|
|
84944
|
+
}
|
|
84890
84945
|
return errorType;
|
|
84891
84946
|
}
|
|
84892
84947
|
function getTypeOfAssignmentPattern(expr) {
|
|
@@ -159956,7 +160011,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159956
160011
|
return isIdentifier(e) ? e : isPropertyAccessExpression(e) ? getLeftMostName(e.expression) : void 0;
|
|
159957
160012
|
}
|
|
159958
160013
|
function tryGetGlobalSymbols() {
|
|
159959
|
-
const result = tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() || tryGetObjectLikeCompletionSymbols() || tryGetImportCompletionSymbols() || tryGetImportOrExportClauseCompletionSymbols() || tryGetLocalNamedExportCompletionSymbols() || tryGetConstructorCompletion() || tryGetClassLikeCompletionSymbols() || tryGetJsxCompletionSymbols() || (getGlobalCompletions(), 1 /* Success */);
|
|
160014
|
+
const result = tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() || tryGetObjectLikeCompletionSymbols() || tryGetImportCompletionSymbols() || tryGetImportOrExportClauseCompletionSymbols() || tryGetImportAttributesCompletionSymbols() || tryGetLocalNamedExportCompletionSymbols() || tryGetConstructorCompletion() || tryGetClassLikeCompletionSymbols() || tryGetJsxCompletionSymbols() || (getGlobalCompletions(), 1 /* Success */);
|
|
159960
160015
|
return result === 1 /* Success */;
|
|
159961
160016
|
}
|
|
159962
160017
|
function tryGetConstructorCompletion() {
|
|
@@ -160424,6 +160479,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160424
160479
|
}
|
|
160425
160480
|
return 1 /* Success */;
|
|
160426
160481
|
}
|
|
160482
|
+
function tryGetImportAttributesCompletionSymbols() {
|
|
160483
|
+
if (contextToken === void 0)
|
|
160484
|
+
return 0 /* Continue */;
|
|
160485
|
+
const importAttributes = contextToken.kind === 19 /* OpenBraceToken */ || contextToken.kind === 28 /* CommaToken */ ? tryCast(contextToken.parent, isImportAttributes) : void 0;
|
|
160486
|
+
if (importAttributes === void 0)
|
|
160487
|
+
return 0 /* Continue */;
|
|
160488
|
+
const existing = new Set(importAttributes.elements.map(getNameFromImportAttribute));
|
|
160489
|
+
symbols = filter(typeChecker.getTypeAtLocation(importAttributes).getApparentProperties(), (attr) => !existing.has(attr.escapedName));
|
|
160490
|
+
return 1 /* Success */;
|
|
160491
|
+
}
|
|
160427
160492
|
function tryGetLocalNamedExportCompletionSymbols() {
|
|
160428
160493
|
var _a;
|
|
160429
160494
|
const namedExports = contextToken && (contextToken.kind === 19 /* OpenBraceToken */ || contextToken.kind === 28 /* CommaToken */) ? tryCast(contextToken.parent, isNamedExports) : void 0;
|
|
@@ -186276,6 +186341,7 @@ ${e.message}`;
|
|
|
186276
186341
|
getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference,
|
|
186277
186342
|
getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost,
|
|
186278
186343
|
getNameForExportedSymbol: () => getNameForExportedSymbol,
|
|
186344
|
+
getNameFromImportAttribute: () => getNameFromImportAttribute,
|
|
186279
186345
|
getNameFromIndexInfo: () => getNameFromIndexInfo,
|
|
186280
186346
|
getNameFromPropertyName: () => getNameFromPropertyName,
|
|
186281
186347
|
getNameOfAccessExpression: () => getNameOfAccessExpression,
|
|
@@ -188698,6 +188764,7 @@ ${e.message}`;
|
|
|
188698
188764
|
getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference,
|
|
188699
188765
|
getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost,
|
|
188700
188766
|
getNameForExportedSymbol: () => getNameForExportedSymbol,
|
|
188767
|
+
getNameFromImportAttribute: () => getNameFromImportAttribute,
|
|
188701
188768
|
getNameFromIndexInfo: () => getNameFromIndexInfo,
|
|
188702
188769
|
getNameFromPropertyName: () => getNameFromPropertyName,
|
|
188703
188770
|
getNameOfAccessExpression: () => getNameOfAccessExpression,
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.4";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20240108`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.4.0-pr-
|
|
5
|
+
"version": "5.4.0-pr-56034-9",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"node": "20.1.0",
|
|
115
115
|
"npm": "8.19.4"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "3d7ec298514e9e6328f70e6f9aec65cfdfcc286e"
|
|
118
118
|
}
|