diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0991030bff6cc..ef7d552392778 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -340,7 +340,7 @@ import { getPropertyNameForPropertyNameNode, getPropertyNameFromType, getResolutionDiagnostic, - getResolutionModeOverrideForClause, + getResolutionModeOverride, getResolvedExternalModuleName, getResolveJsonModule, getRestParameterElementType, @@ -393,6 +393,7 @@ import { hasOverrideModifier, hasPossibleExternalModuleReference, hasQuestionToken, + hasResolutionModeOverride, hasRestParameter, hasScopeMarker, hasStaticModifier, @@ -405,6 +406,7 @@ import { IdentifierTypePredicate, idText, IfStatement, + ImportAttributes, ImportCall, ImportClause, ImportDeclaration, @@ -412,7 +414,6 @@ import { ImportOrExportSpecifier, ImportsNotUsedAsValues, ImportSpecifier, - ImportTypeAssertionContainer, ImportTypeNode, IndexedAccessType, IndexedAccessTypeNode, @@ -642,7 +643,6 @@ import { isNamespaceExportDeclaration, isNamespaceReexportDeclaration, isNewExpression, - isNightly, isNodeDescendantOf, isNonNullAccess, isNullishCoalesce, @@ -4997,11 +4997,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } if (moduleResolutionKind === ModuleResolutionKind.Node16 || moduleResolutionKind === ModuleResolutionKind.NodeNext) { const isSyncImport = (currentSourceFile.impliedNodeFormat === ModuleKind.CommonJS && !findAncestor(location, isImportCall)) || !!findAncestor(location, isImportEqualsDeclaration); - const overrideClauseHost = findAncestor(location, l => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l)) as ImportTypeNode | ImportDeclaration | ExportDeclaration | undefined; - const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? overrideClauseHost.assertions?.assertClause : overrideClauseHost?.assertClause; + const overrideHost = findAncestor(location, l => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l)) as ImportTypeNode | ImportDeclaration | ExportDeclaration | undefined; // An override clause will take effect for type-only imports and import types, and allows importing the types across formats, regardless of // normal mode restrictions - if (isSyncImport && sourceFile.impliedNodeFormat === ModuleKind.ESNext && !getResolutionModeOverrideForClause(overrideClause)) { + if (isSyncImport && sourceFile.impliedNodeFormat === ModuleKind.ESNext && !hasResolutionModeOverride(overrideHost)) { if (findAncestor(location, isImportEqualsDeclaration)) { // ImportEquals in a ESM file resolving to another ESM file error(errorNode, Diagnostics.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, moduleReference); @@ -7128,7 +7127,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return factory.updateImportTypeNode( root, root.argument, - root.assertions, + root.attributes, qualifier, typeArguments, root.isTypeOf, @@ -7916,18 +7915,19 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const contextFile = getSourceFileOfNode(getOriginalNode(context.enclosingDeclaration)); const targetFile = getSourceFileOfModule(chain[0]); let specifier: string | undefined; - let assertion: ImportTypeAssertionContainer | undefined; + let attributes: ImportAttributes | undefined; if (getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node16 || getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext) { // An `import` type directed at an esm format file is only going to resolve in esm mode - set the esm mode assertion if (targetFile?.impliedNodeFormat === ModuleKind.ESNext && targetFile.impliedNodeFormat !== contextFile?.impliedNodeFormat) { specifier = getSpecifierForModuleSymbol(chain[0], context, ModuleKind.ESNext); - assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([ - factory.createAssertEntry( - factory.createStringLiteral("resolution-mode"), - factory.createStringLiteral("import"), - ), - ]))); - context.tracker.reportImportTypeNodeResolutionModeOverride?.(); + attributes = factory.createImportAttributes( + factory.createNodeArray([ + factory.createImportAttribute( + factory.createStringLiteral("resolution-mode"), + factory.createStringLiteral("import"), + ), + ]), + ); } } if (!specifier) { @@ -7945,17 +7945,18 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { specifier = oldSpecifier; } else { - assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([ - factory.createAssertEntry( - factory.createStringLiteral("resolution-mode"), - factory.createStringLiteral(swappedMode === ModuleKind.ESNext ? "import" : "require"), - ), - ]))); - context.tracker.reportImportTypeNodeResolutionModeOverride?.(); + attributes = factory.createImportAttributes( + factory.createNodeArray([ + factory.createImportAttribute( + factory.createStringLiteral("resolution-mode"), + factory.createStringLiteral(swappedMode === ModuleKind.ESNext ? "import" : "require"), + ), + ]), + ); } } - if (!assertion) { + if (!attributes) { // If ultimately we can only name the symbol with a reference that dives into a `node_modules` folder, we should error // since declaration files with these kinds of references are liable to fail when published :( context.encounteredError = true; @@ -7972,12 +7973,12 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const lastId = isIdentifier(nonRootParts) ? nonRootParts : nonRootParts.right; setIdentifierTypeArguments(lastId, /*typeArguments*/ undefined); } - return factory.createImportTypeNode(lit, assertion, nonRootParts as EntityName, typeParameterNodes as readonly TypeNode[], isTypeOf); + return factory.createImportTypeNode(lit, attributes, nonRootParts as EntityName, typeParameterNodes as readonly TypeNode[], isTypeOf); } else { const splitNode = getTopmostIndexedAccessType(nonRootParts); const qualifier = (splitNode.objectType as TypeReferenceNode).typeName; - return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, assertion, qualifier, typeParameterNodes as readonly TypeNode[], isTypeOf), splitNode.indexType); + return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, attributes, qualifier, typeParameterNodes as readonly TypeNode[], isTypeOf), splitNode.indexType); } } @@ -8485,7 +8486,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return factory.updateImportTypeNode( node, factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)), - node.assertions, + node.attributes, node.qualifier, visitNodes(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode), node.isTypeOf, @@ -8710,7 +8711,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function inlineExportModifiers(statements: Statement[]) { // Pass 3: Move all `export {}`'s to `export` modifiers where possible - const index = findIndex(statements, d => isExportDeclaration(d) && !d.moduleSpecifier && !d.assertClause && !!d.exportClause && isNamedExports(d.exportClause)); + const index = findIndex(statements, d => isExportDeclaration(d) && !d.moduleSpecifier && !d.attributes && !!d.exportClause && isNamedExports(d.exportClause)); if (index >= 0) { const exportDecl = statements[index] as ExportDeclaration & { readonly exportClause: NamedExports; }; const replacements = mapDefined(exportDecl.exportClause.elements, e => { @@ -8742,7 +8743,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { replacements, ), exportDecl.moduleSpecifier, - exportDecl.assertClause, + exportDecl.attributes, ); } } @@ -9464,7 +9465,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { )]), ), factory.createStringLiteral(specifier), - /*assertClause*/ undefined, + /*attributes*/ undefined, ), ModifierFlags.None, ); @@ -9548,7 +9549,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { /*modifiers*/ undefined, factory.createImportClause(/*isTypeOnly*/ false, factory.createIdentifier(localName), /*namedBindings*/ undefined), specifier, - (node as ImportClause).parent.assertClause, + (node as ImportClause).parent.attributes, ), ModifierFlags.None, ); @@ -9562,7 +9563,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { /*modifiers*/ undefined, factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, factory.createNamespaceImport(factory.createIdentifier(localName))), specifier, - (node as NamespaceImport).parent.parent.assertClause, + (node as ImportClause).parent.attributes, ), ModifierFlags.None, ); @@ -9597,7 +9598,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { ]), ), specifier, - (node as ImportSpecifier).parent.parent.parent.assertClause, + (node as ImportSpecifier).parent.parent.parent.attributes, ), ModifierFlags.None, ); @@ -39744,18 +39745,18 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { function checkImportType(node: ImportTypeNode) { checkSourceElement(node.argument); - if (node.assertions) { - const override = getResolutionModeOverrideForClause(node.assertions.assertClause, grammarErrorOnNode); - if (override) { - if (!isNightly()) { - grammarErrorOnNode(node.assertions.assertClause, Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next); - } - if (getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Node16 && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.NodeNext) { - grammarErrorOnNode(node.assertions.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext); - } + if (node.attributes) { + const override = getResolutionModeOverride(node.attributes, grammarErrorOnNode); + const errorNode = node.attributes; + if (override && errorNode && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Node16 && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.NodeNext) { + grammarErrorOnNode( + errorNode, + node.attributes.token === SyntaxKind.WithKeyword + ? Diagnostics.The_resolution_mode_attribute_is_only_supported_when_moduleResolution_is_node16_or_nodenext + : Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext, + ); } } - checkTypeReferenceOrImport(node); } @@ -44994,12 +44995,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return false; } } - if (!isImportEqualsDeclaration(node) && node.assertClause) { + if (!isImportEqualsDeclaration(node) && node.attributes) { + const diagnostic = node.attributes.token === SyntaxKind.WithKeyword ? Diagnostics.Import_attribute_values_must_be_string_literal_expressions : Diagnostics.Import_assertion_values_must_be_string_literal_expressions; let hasError = false; - for (const clause of node.assertClause.elements) { - if (!isStringLiteral(clause.value)) { + for (const attr of node.attributes.elements) { + if (!isStringLiteral(attr.value)) { hasError = true; - error(clause.value, Diagnostics.Import_assertion_values_must_be_string_literal_expressions); + error(attr.value, diagnostic); } } return !hasError; @@ -45183,37 +45185,42 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } } - function checkAssertClause(declaration: ImportDeclaration | ExportDeclaration) { - if (declaration.assertClause) { - const validForTypeAssertions = isExclusivelyTypeOnlyImportOrExport(declaration); - const override = getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : undefined); - if (validForTypeAssertions && override) { - if (!isNightly()) { - grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next); - } - + function checkImportAttributes(declaration: ImportDeclaration | ExportDeclaration) { + const node = declaration.attributes; + if (node) { + const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration); + const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : undefined); + const isImportAttributes = declaration.attributes.token === SyntaxKind.WithKeyword; + if (validForTypeAttributes && override) { if (getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.Node16 && getEmitModuleResolutionKind(compilerOptions) !== ModuleResolutionKind.NodeNext) { - return grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext); + return grammarErrorOnNode( + node, + isImportAttributes + ? Diagnostics.The_resolution_mode_attribute_is_only_supported_when_moduleResolution_is_node16_or_nodenext + : Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext, + ); } return; // Other grammar checks do not apply to type-only imports with resolution mode assertions } const mode = (moduleKind === ModuleKind.NodeNext) && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier); if (mode !== ModuleKind.ESNext && moduleKind !== ModuleKind.ESNext) { - return grammarErrorOnNode( - declaration.assertClause, - moduleKind === ModuleKind.NodeNext - ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls - : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext, - ); + const message = isImportAttributes + ? moduleKind === ModuleKind.NodeNext + ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls + : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext + : moduleKind === ModuleKind.NodeNext + ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls + : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext; + return grammarErrorOnNode(node, message); } if (isImportDeclaration(declaration) ? declaration.importClause?.isTypeOnly : declaration.isTypeOnly) { - return grammarErrorOnNode(declaration.assertClause, Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports); + return grammarErrorOnNode(node, isImportAttributes ? Diagnostics.Import_attributes_cannot_be_used_with_type_only_imports_or_exports : Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports); } if (override) { - return grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports); + return grammarErrorOnNode(node, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports); } } } @@ -45249,7 +45256,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } } } - checkAssertClause(node); + checkImportAttributes(node); } function checkImportEqualsDeclaration(node: ImportEqualsDeclaration) { @@ -45345,7 +45352,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { } } } - checkAssertClause(node); + checkImportAttributes(node); } function checkGrammarExportDeclaration(node: ExportDeclaration): boolean { @@ -49887,13 +49894,13 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { checkGrammarForDisallowedTrailingComma(nodeArguments); if (nodeArguments.length > 1) { - const assertionArgument = nodeArguments[1]; - return grammarErrorOnNode(assertionArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext); + const importAttributesArgument = nodeArguments[1]; + return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext); } } if (nodeArguments.length === 0 || nodeArguments.length > 2) { - return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments); + return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments); } // see: parseArgumentOrArrayLiteralElement...we use this function which parse arguments of callExpression to parse specifier for dynamic import. @@ -50224,13 +50231,6 @@ class SymbolTrackerImpl implements SymbolTracker { } } - reportImportTypeNodeResolutionModeOverride(): void { - if (this.inner?.reportImportTypeNodeResolutionModeOverride) { - this.onDiagnosticReported(); - this.inner.reportImportTypeNodeResolutionModeOverride(); - } - } - private onDiagnosticReported() { this.context.reportedDiagnostic = true; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 68d87f7d28b57..9083506fbeb38 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1472,7 +1472,7 @@ "category": "Message", "code": 1449 }, - "Dynamic imports can only accept a module specifier and an optional assertion as arguments": { + "Dynamic imports can only accept a module specifier and an optional set of attributes as arguments": { "category": "Message", "code": 1450 }, @@ -1520,6 +1520,18 @@ "category": "Message", "code": 1461 }, + "The 'resolution-mode' attribute is only supported when 'moduleResolution' is 'node16' or 'nodenext'.": { + "category": "Error", + "code": 1462 + }, + "'resolution-mode' is the only valid key for type import attributes.": { + "category": "Error", + "code": 1463 + }, + "Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'.": { + "category": "Error", + "code": 1464 + }, "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output.": { "category": "Error", @@ -1625,6 +1637,10 @@ "category": "Error", "code": 1495 }, + "Identifier, string literal, or number literal expected.": { + "category": "Error", + "code": 1496 + }, "The types of '{0}' are incompatible between these types.": { "category": "Error", @@ -3579,6 +3595,10 @@ "category": "Error", "code": 2822 }, + "Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'.": { + "category": "Error", + "code": 2823 + }, "Cannot find namespace '{0}'. Did you mean '{1}'?": { "category": "Error", "code": 2833 @@ -3611,10 +3631,6 @@ "category": "Error", "code": 2840 }, - "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'.": { - "category": "Error", - "code": 2841 - }, "'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?": { "category": "Error", "code": 2842 @@ -3667,6 +3683,18 @@ "category": "Error", "code": 2855 }, + "Import attributes are not allowed on statements that transpile to CommonJS 'require' calls.": { + "category": "Error", + "code": 2856 + }, + "Import attributes cannot be used with type-only imports or exports.": { + "category": "Error", + "code": 2857 + }, + "Import attribute values must be string literal expressions.": { + "category": "Error", + "code": 2858 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", @@ -4100,10 +4128,6 @@ "category": "Error", "code": 4124 }, - "'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'.": { - "category": "Error", - "code": 4125 - }, "The current host does not support the '{0}' option.": { "category": "Error", diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 4a85cb8897db5..3d035053761af 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -7,8 +7,6 @@ import { ArrayTypeNode, ArrowFunction, AsExpression, - AssertClause, - AssertEntry, AwaitExpression, base64encode, BigIntLiteral, @@ -191,6 +189,8 @@ import { Identifier, idText, IfStatement, + ImportAttribute, + ImportAttributes, ImportClause, ImportDeclaration, ImportEqualsDeclaration, @@ -2055,10 +2055,10 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri return emitNamedExports(node as NamedExports); case SyntaxKind.ExportSpecifier: return emitExportSpecifier(node as ExportSpecifier); - case SyntaxKind.AssertClause: - return emitAssertClause(node as AssertClause); - case SyntaxKind.AssertEntry: - return emitAssertEntry(node as AssertEntry); + case SyntaxKind.ImportAttributes: + return emitImportAttributes(node as ImportAttributes); + case SyntaxKind.ImportAttribute: + return emitImportAttribute(node as ImportAttribute); case SyntaxKind.MissingDeclaration: return; @@ -2948,16 +2948,16 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri writeKeyword("import"); writePunctuation("("); emit(node.argument); - if (node.assertions) { + if (node.attributes) { writePunctuation(","); writeSpace(); writePunctuation("{"); writeSpace(); - writeKeyword("assert"); + writeKeyword(node.attributes.token === SyntaxKind.AssertKeyword ? "assert" : "with"); writePunctuation(":"); writeSpace(); - const elements = node.assertions.assertClause.elements; - emitList(node.assertions.assertClause, elements, ListFormat.ImportClauseEntries); + const elements = node.attributes.elements; + emitList(node.attributes, elements, ListFormat.ImportAttributes); writeSpace(); writePunctuation("}"); } @@ -4003,8 +4003,8 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri writeSpace(); } emitExpression(node.moduleSpecifier); - if (node.assertClause) { - emitWithLeadingSpace(node.assertClause); + if (node.attributes) { + emitWithLeadingSpace(node.attributes); } writeTrailingSemicolon(); } @@ -4078,20 +4078,20 @@ export function createPrinter(printerOptions: PrinterOptions = {}, handlers: Pri writeSpace(); emitExpression(node.moduleSpecifier); } - if (node.assertClause) { - emitWithLeadingSpace(node.assertClause); + if (node.attributes) { + emitWithLeadingSpace(node.attributes); } writeTrailingSemicolon(); } - function emitAssertClause(node: AssertClause) { - emitTokenWithComment(SyntaxKind.AssertKeyword, node.pos, writeKeyword, node); + function emitImportAttributes(node: ImportAttributes) { + emitTokenWithComment(node.token, node.pos, writeKeyword, node); writeSpace(); const elements = node.elements; - emitList(node, elements, ListFormat.ImportClauseEntries); + emitList(node, elements, ListFormat.ImportAttributes); } - function emitAssertEntry(node: AssertEntry) { + function emitImportAttribute(node: ImportAttribute) { emit(node.name); writePunctuation(":"); writeSpace(); diff --git a/src/compiler/factory/nodeFactory.ts b/src/compiler/factory/nodeFactory.ts index d84cce2ca0932..c01dee21917dd 100644 --- a/src/compiler/factory/nodeFactory.ts +++ b/src/compiler/factory/nodeFactory.ts @@ -137,6 +137,9 @@ import { IfStatement, ImmediatelyInvokedArrowFunction, ImmediatelyInvokedFunctionExpression, + ImportAttribute, + ImportAttributeName, + ImportAttributes, ImportClause, ImportDeclaration, ImportEqualsDeclaration, @@ -791,6 +794,10 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode updateAssertEntry, createImportTypeAssertionContainer, updateImportTypeAssertionContainer, + createImportAttributes, + updateImportAttributes, + createImportAttribute, + updateImportAttribute, createNamespaceImport, updateNamespaceImport, createNamespaceExport, @@ -2643,14 +2650,17 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode // @api function createImportTypeNode( argument: TypeNode, - assertions?: ImportTypeAssertionContainer, + attributes?: ImportAttributes, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf = false, ): ImportTypeNode { const node = createBaseNode(SyntaxKind.ImportType); node.argument = argument; - node.assertions = assertions; + node.attributes = attributes; + if (node.assertions && node.assertions.assertClause && node.attributes) { + (node.assertions as Mutable).assertClause = node.attributes; + } node.qualifier = qualifier; node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments); node.isTypeOf = isTypeOf; @@ -2662,17 +2672,17 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode function updateImportTypeNode( node: ImportTypeNode, argument: TypeNode, - assertions: ImportTypeAssertionContainer | undefined, + attributes: ImportAttributes | undefined, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf: boolean = node.isTypeOf, ): ImportTypeNode { return node.argument !== argument - || node.assertions !== assertions + || node.attributes !== attributes || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf - ? update(createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf), node) + ? update(createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf), node) : node; } @@ -4696,13 +4706,13 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, - assertClause: AssertClause | undefined, + attributes: ImportAttributes | undefined, ): ImportDeclaration { const node = createBaseNode(SyntaxKind.ImportDeclaration); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; node.moduleSpecifier = moduleSpecifier; - node.assertClause = assertClause; + node.attributes = node.assertClause = attributes; node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier); node.transformFlags &= ~TransformFlags.ContainsPossibleTopLevelAwait; // always parsed in an Await context @@ -4717,13 +4727,13 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, - assertClause: AssertClause | undefined, + attributes: ImportAttributes | undefined, ) { return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier - || node.assertClause !== assertClause - ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause), node) + || node.attributes !== attributes + ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes), node) : node; } @@ -4756,6 +4766,7 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode const node = createBaseNode(SyntaxKind.AssertClause); node.elements = createNodeArray(elements); node.multiLine = multiLine; + node.token = SyntaxKind.AssertKeyword; node.transformFlags |= TransformFlags.ContainsESNext; return node; } @@ -4801,6 +4812,43 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode : node; } + // @api + function createImportAttributes(elements: readonly ImportAttribute[], multiLine?: boolean): ImportAttributes; + function createImportAttributes(elements: readonly ImportAttribute[], multiLine?: boolean, token?: ImportAttributes["token"]): ImportAttributes; + function createImportAttributes(elements: readonly ImportAttribute[], multiLine?: boolean, token?: ImportAttributes["token"]): ImportAttributes { + const node = createBaseNode(SyntaxKind.ImportAttributes); + node.token = token ?? SyntaxKind.WithKeyword; + node.elements = createNodeArray(elements); + node.multiLine = multiLine; + node.transformFlags |= TransformFlags.ContainsESNext; + return node; + } + + // @api + function updateImportAttributes(node: ImportAttributes, elements: readonly ImportAttribute[], multiLine?: boolean): ImportAttributes { + return node.elements !== elements + || node.multiLine !== multiLine + ? update(createImportAttributes(elements, multiLine, node.token), node) + : node; + } + + // @api + function createImportAttribute(name: ImportAttributeName, value: Expression): ImportAttribute { + const node = createBaseNode(SyntaxKind.ImportAttribute); + node.name = name; + node.value = value; + node.transformFlags |= TransformFlags.ContainsESNext; + return node; + } + + // @api + function updateImportAttribute(node: ImportAttribute, name: ImportAttributeName, value: Expression): ImportAttribute { + return node.name !== name + || node.value !== value + ? update(createImportAttribute(name, value), node) + : node; + } + // @api function createNamespaceImport(name: Identifier): NamespaceImport { const node = createBaseDeclaration(SyntaxKind.NamespaceImport); @@ -4908,14 +4956,14 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, - assertClause?: AssertClause, + attributes?: ImportAttributes, ) { const node = createBaseDeclaration(SyntaxKind.ExportDeclaration); node.modifiers = asNodeArray(modifiers); node.isTypeOnly = isTypeOnly; node.exportClause = exportClause; node.moduleSpecifier = moduleSpecifier; - node.assertClause = assertClause; + node.attributes = node.assertClause = attributes; node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier); @@ -4932,14 +4980,14 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, - assertClause: AssertClause | undefined, + attributes: ImportAttributes | undefined, ) { 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.attributes !== attributes + ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes), node) : node; } @@ -7083,9 +7131,9 @@ export function createNodeFactory(flags: NodeFactoryFlags, baseFactory: BaseNode 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) : + isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.attributes) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : - isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : + isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.attributes) : Debug.assertNever(node); } diff --git a/src/compiler/factory/nodeTests.ts b/src/compiler/factory/nodeTests.ts index ffc8c4a44839d..eca54d346d882 100644 --- a/src/compiler/factory/nodeTests.ts +++ b/src/compiler/factory/nodeTests.ts @@ -67,6 +67,8 @@ import { HeritageClause, Identifier, IfStatement, + ImportAttribute, + ImportAttributes, ImportClause, ImportDeclaration, ImportEqualsDeclaration, @@ -847,14 +849,24 @@ export function isImportTypeAssertionContainer(node: Node): node is ImportTypeAs return node.kind === SyntaxKind.ImportTypeAssertionContainer; } +/** @deprecated */ export function isAssertClause(node: Node): node is AssertClause { return node.kind === SyntaxKind.AssertClause; } +/** @deprecated */ export function isAssertEntry(node: Node): node is AssertEntry { return node.kind === SyntaxKind.AssertEntry; } +export function isImportAttributes(node: Node): node is ImportAttributes { + return node.kind === SyntaxKind.ImportAttributes; +} + +export function isImportAttribute(node: Node): node is ImportAttribute { + return node.kind === SyntaxKind.ImportAttribute; +} + export function isNamespaceImport(node: Node): node is NamespaceImport { return node.kind === SyntaxKind.NamespaceImport; } diff --git a/src/compiler/factory/utilities.ts b/src/compiler/factory/utilities.ts index 23f8014586d5f..e952b614251c7 100644 --- a/src/compiler/factory/utilities.ts +++ b/src/compiler/factory/utilities.ts @@ -754,7 +754,7 @@ export function createExternalHelpersImportDeclarationIfNeeded(nodeFactory: Node /*modifiers*/ undefined, nodeFactory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, namedBindings), nodeFactory.createStringLiteral(externalHelpersModuleNameText), - /*assertClause*/ undefined, + /*attributes*/ undefined, ); addInternalEmitFlags(externalHelpersImportDeclaration, InternalEmitFlags.NeverApplyImportHelper); return externalHelpersImportDeclaration; diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 2a8f9f5165cc2..7511678393d2b 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -9,8 +9,6 @@ import { ArrayTypeNode, ArrowFunction, AsExpression, - AssertClause, - AssertEntry, AssertionLevel, AsteriskToken, attachFileToDiagnostics, @@ -117,6 +115,8 @@ import { Identifier, idText, IfStatement, + ImportAttribute, + ImportAttributes, ImportClause, ImportDeclaration, ImportEqualsDeclaration, @@ -689,7 +689,7 @@ const forEachChildTable: ForEachChildTable = { }, [SyntaxKind.ImportType]: function forEachChildInImportType(node: ImportTypeNode, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray) => T | undefined): T | undefined { return visitNode(cbNode, node.argument) || - visitNode(cbNode, node.assertions) || + visitNode(cbNode, node.attributes) || visitNode(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments); }, @@ -928,16 +928,16 @@ const forEachChildTable: ForEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier) || - visitNode(cbNode, node.assertClause); + visitNode(cbNode, node.attributes); }, [SyntaxKind.ImportClause]: function forEachChildInImportClause(node: ImportClause, cbNode: (node: Node) => T | undefined, _cbNodes?: (nodes: NodeArray) => T | undefined): T | undefined { return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); }, - [SyntaxKind.AssertClause]: function forEachChildInAssertClause(node: AssertClause, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray) => T | undefined): T | undefined { + [SyntaxKind.ImportAttributes]: function forEachChildInImportAttributes(node: ImportAttributes, cbNode: (node: Node) => T | undefined, cbNodes?: (nodes: NodeArray) => T | undefined): T | undefined { return visitNodes(cbNode, cbNodes, node.elements); }, - [SyntaxKind.AssertEntry]: function forEachChildInAssertEntry(node: AssertEntry, cbNode: (node: Node) => T | undefined, _cbNodes?: (nodes: NodeArray) => T | undefined): T | undefined { + [SyntaxKind.ImportAttribute]: function forEachChildInImportAttribute(node: ImportAttribute, cbNode: (node: Node) => T | undefined, _cbNodes?: (nodes: NodeArray) => T | undefined): T | undefined { return visitNode(cbNode, node.name) || visitNode(cbNode, node.value); }, @@ -957,7 +957,7 @@ const forEachChildTable: ForEachChildTable = { return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier) || - visitNode(cbNode, node.assertClause); + visitNode(cbNode, node.attributes); }, [SyntaxKind.ImportSpecifier]: forEachChildInImportOrExportSpecifier, [SyntaxKind.ExportSpecifier]: forEachChildInImportOrExportSpecifier, @@ -2683,9 +2683,8 @@ namespace Parser { token() === SyntaxKind.NumericLiteral; } - function isAssertionKey(): boolean { - return tokenIsIdentifierOrKeyword(token()) || - token() === SyntaxKind.StringLiteral; + function isImportAttributeName(): boolean { + return tokenIsIdentifierOrKeyword(token()) || token() === SyntaxKind.StringLiteral; } function parsePropertyNameWorker(allowComputedPropertyNames: boolean): PropertyName { @@ -2847,8 +2846,8 @@ namespace Parser { return isLiteralPropertyName(); case ParsingContext.ObjectBindingElements: return token() === SyntaxKind.OpenBracketToken || token() === SyntaxKind.DotDotDotToken || isLiteralPropertyName(); - case ParsingContext.AssertEntries: - return isAssertionKey(); + case ParsingContext.ImportAttributes: + return isImportAttributeName(); case ParsingContext.HeritageClauseElement: // If we see `{ ... }` then only consume it as an expression if it is followed by `,` or `{` // That way we won't consume the body of a class in its heritage clause. @@ -2979,7 +2978,7 @@ namespace Parser { case ParsingContext.ObjectLiteralMembers: case ParsingContext.ObjectBindingElements: case ParsingContext.ImportOrExportSpecifiers: - case ParsingContext.AssertEntries: + case ParsingContext.ImportAttributes: return token() === SyntaxKind.CloseBraceToken; case ParsingContext.SwitchClauseStatements: return token() === SyntaxKind.CloseBraceToken || token() === SyntaxKind.CaseKeyword || token() === SyntaxKind.DefaultKeyword; @@ -3442,8 +3441,8 @@ namespace Parser { return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); case ParsingContext.JsxChildren: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); - case ParsingContext.AssertEntries: - return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected); // AssertionKey. + case ParsingContext.ImportAttributes: + return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected); case ParsingContext.JSDocComment: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected); case ParsingContext.Count: @@ -4512,26 +4511,6 @@ namespace Parser { return token() === SyntaxKind.ImportKeyword; } - function parseImportTypeAssertions(): ImportTypeAssertionContainer { - const pos = getNodePos(); - const openBracePosition = scanner.getTokenStart(); - parseExpected(SyntaxKind.OpenBraceToken); - const multiLine = scanner.hasPrecedingLineBreak(); - parseExpected(SyntaxKind.AssertKeyword); - parseExpected(SyntaxKind.ColonToken); - const clause = parseAssertClause(/*skipAssertKeyword*/ true); - if (!parseExpected(SyntaxKind.CloseBraceToken)) { - const lastError = lastOrUndefined(parseDiagnostics); - if (lastError && lastError.code === Diagnostics._0_expected.code) { - addRelatedInfo( - lastError, - createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}"), - ); - } - } - return finishNode(factory.createImportTypeAssertionContainer(clause, multiLine), pos); - } - function parseImportType(): ImportTypeNode { sourceFlags |= NodeFlags.PossiblyContainsDynamicImport; const pos = getNodePos(); @@ -4539,14 +4518,33 @@ namespace Parser { parseExpected(SyntaxKind.ImportKeyword); parseExpected(SyntaxKind.OpenParenToken); const type = parseType(); - let assertions: ImportTypeAssertionContainer | undefined; + let attributes: ImportAttributes | undefined; if (parseOptional(SyntaxKind.CommaToken)) { - assertions = parseImportTypeAssertions(); + const openBracePosition = scanner.getTokenStart(); + parseExpected(SyntaxKind.OpenBraceToken); + const currentToken = token(); + if (currentToken === SyntaxKind.WithKeyword || currentToken === SyntaxKind.AssertKeyword) { + nextToken(); + } + else { + parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(SyntaxKind.WithKeyword)); + } + parseExpected(SyntaxKind.ColonToken); + attributes = parseImportAttributes(currentToken as SyntaxKind.WithKeyword | SyntaxKind.AssertKeyword, /*skipKeyword*/ true); + if (!parseExpected(SyntaxKind.CloseBraceToken)) { + const lastError = lastOrUndefined(parseDiagnostics); + if (lastError && lastError.code === Diagnostics._0_expected.code) { + addRelatedInfo( + lastError, + createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}"), + ); + } + } } parseExpected(SyntaxKind.CloseParenToken); const qualifier = parseOptional(SyntaxKind.DotToken) ? parseEntityNameOfTypeReference() : undefined; const typeArguments = parseTypeArgumentsOfTypeReference(); - return finishNode(factory.createImportTypeNode(type, assertions, qualifier, typeArguments, isTypeOf), pos); + return finishNode(factory.createImportTypeNode(type, attributes, qualifier, typeArguments, isTypeOf), pos); } function nextTokenIsNumericOrBigIntLiteral() { @@ -8358,34 +8356,33 @@ namespace Parser { parseExpected(SyntaxKind.FromKeyword); } const moduleSpecifier = parseModuleSpecifier(); - - let assertClause: AssertClause | undefined; - if (token() === SyntaxKind.AssertKeyword && !scanner.hasPrecedingLineBreak()) { - assertClause = parseAssertClause(); + const currentToken = token(); + let attributes: ImportAttributes | undefined; + if ((currentToken === SyntaxKind.WithKeyword || currentToken === SyntaxKind.AssertKeyword) && !scanner.hasPrecedingLineBreak()) { + attributes = parseImportAttributes(currentToken); } - parseSemicolon(); - const node = factory.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause); + const node = factory.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes); return withJSDoc(finishNode(node, pos), hasJSDoc); } - function parseAssertEntry() { + function parseImportAttribute() { const pos = getNodePos(); const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(SyntaxKind.StringLiteral) as StringLiteral; parseExpected(SyntaxKind.ColonToken); const value = parseAssignmentExpressionOrHigher(/*allowReturnTypeInArrowFunction*/ true); - return finishNode(factory.createAssertEntry(name, value), pos); + return finishNode(factory.createImportAttribute(name, value), pos); } - function parseAssertClause(skipAssertKeyword?: true) { + function parseImportAttributes(token: SyntaxKind.AssertKeyword | SyntaxKind.WithKeyword, skipKeyword?: true) { const pos = getNodePos(); - if (!skipAssertKeyword) { - parseExpected(SyntaxKind.AssertKeyword); + if (!skipKeyword) { + parseExpected(token); } const openBracePosition = scanner.getTokenStart(); if (parseExpected(SyntaxKind.OpenBraceToken)) { const multiLine = scanner.hasPrecedingLineBreak(); - const elements = parseDelimitedList(ParsingContext.AssertEntries, parseAssertEntry, /*considerSemicolonAsDelimiter*/ true); + const elements = parseDelimitedList(ParsingContext.ImportAttributes, parseImportAttribute, /*considerSemicolonAsDelimiter*/ true); if (!parseExpected(SyntaxKind.CloseBraceToken)) { const lastError = lastOrUndefined(parseDiagnostics); if (lastError && lastError.code === Diagnostics._0_expected.code) { @@ -8395,11 +8392,11 @@ namespace Parser { ); } } - return finishNode(factory.createAssertClause(elements, multiLine), pos); + return finishNode(factory.createImportAttributes(elements, multiLine, token), pos); } else { const elements = createNodeArray([], getNodePos(), /*end*/ undefined, /*hasTrailingComma*/ false); - return finishNode(factory.createAssertClause(elements, /*multiLine*/ false), pos); + return finishNode(factory.createImportAttributes(elements, /*multiLine*/ false, token), pos); } } @@ -8602,7 +8599,7 @@ namespace Parser { setAwaitContext(/*value*/ true); let exportClause: NamedExportBindings | undefined; let moduleSpecifier: Expression | undefined; - let assertClause: AssertClause | undefined; + let attributes: ImportAttributes | undefined; const isTypeOnly = parseOptional(SyntaxKind.TypeKeyword); const namespaceExportPos = getNodePos(); if (parseOptional(SyntaxKind.AsteriskToken)) { @@ -8622,12 +8619,13 @@ namespace Parser { moduleSpecifier = parseModuleSpecifier(); } } - if (moduleSpecifier && token() === SyntaxKind.AssertKeyword && !scanner.hasPrecedingLineBreak()) { - assertClause = parseAssertClause(); + const currentToken = token(); + if (moduleSpecifier && (currentToken === SyntaxKind.WithKeyword || currentToken === SyntaxKind.AssertKeyword) && !scanner.hasPrecedingLineBreak()) { + attributes = parseImportAttributes(currentToken); } parseSemicolon(); setAwaitContext(savedAwaitContext); - const node = factory.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause); + const node = factory.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes); return withJSDoc(finishNode(node, pos), hasJSDoc); } @@ -8674,9 +8672,9 @@ namespace Parser { TupleElementTypes, // Element types in tuple element type list HeritageClauses, // Heritage clauses for a class or interface declaration. ImportOrExportSpecifiers, // Named import clause's import specifier list, - AssertEntries, // Import entries list. + ImportAttributes, // Import attributes JSDocComment, // Parsing via JSDocParser - Count, // Number of parsing contexts + Count, // Number of parsing contexts } const enum Tristate { diff --git a/src/compiler/program.ts b/src/compiler/program.ts index e95e525f4731f..49934452ff9f5 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -167,6 +167,7 @@ import { HeritageClause, Identifier, identity, + ImportAttributes, ImportClause, ImportDeclaration, ImportOrExportSpecifier, @@ -895,14 +896,14 @@ export function getModeForUsageLocation(file: { impliedNodeFormat?: ResolutionMo if ((isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent))) { const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent); if (isTypeOnly) { - const override = getResolutionModeOverrideForClause(usage.parent.assertClause); + const override = getResolutionModeOverride(usage.parent.attributes); if (override) { return override; } } } if (usage.parent.parent && isImportTypeNode(usage.parent.parent)) { - const override = getResolutionModeOverrideForClause(usage.parent.parent.assertions?.assertClause); + const override = getResolutionModeOverride(usage.parent.parent.attributes); if (override) { return override; } @@ -918,16 +919,26 @@ export function getModeForUsageLocation(file: { impliedNodeFormat?: ResolutionMo } /** @internal */ -export function getResolutionModeOverrideForClause(clause: AssertClause | undefined, grammarErrorOnNode?: (node: Node, diagnostic: DiagnosticMessage) => void) { - if (!clause) return undefined; - if (length(clause.elements) !== 1) { - grammarErrorOnNode?.(clause, Diagnostics.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require); +export function getResolutionModeOverride(node: AssertClause | ImportAttributes | undefined, grammarErrorOnNode?: (node: Node, diagnostic: DiagnosticMessage) => void) { + if (!node) return undefined; + if (length(node.elements) !== 1) { + grammarErrorOnNode?.( + node, + node.token === SyntaxKind.WithKeyword + ? Diagnostics.Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require + : Diagnostics.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require, + ); return undefined; } - const elem = clause.elements[0]; + const elem = node.elements[0]; if (!isStringLiteralLike(elem.name)) return undefined; if (elem.name.text !== "resolution-mode") { - grammarErrorOnNode?.(elem.name, Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_assertions); + grammarErrorOnNode?.( + elem.name, + node.token === SyntaxKind.WithKeyword + ? Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_attributes + : Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_assertions, + ); return undefined; } if (!isStringLiteralLike(elem.value)) return undefined; @@ -1393,7 +1404,7 @@ export const plainJSErrors = new Set([ Diagnostics.Classes_may_not_have_a_field_named_constructor.code, 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, Diagnostics.Duplicate_label_0.code, - Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code, + Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code, Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block.code, Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code, Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code, @@ -3294,7 +3305,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg function createSyntheticImport(text: string, file: SourceFile) { const externalHelpersModuleReference = factory.createStringLiteral(text); - const importDecl = factory.createImportDeclaration(/*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference, /*assertClause*/ undefined); + const importDecl = factory.createImportDeclaration(/*modifiers*/ undefined, /*importClause*/ undefined, externalHelpersModuleReference, /*attributes*/ undefined); addInternalEmitFlags(importDecl, InternalEmitFlags.NeverApplyImportHelper); setParent(externalHelpersModuleReference, importDecl); setParent(importDecl, file); diff --git a/src/compiler/transformers/declarations.ts b/src/compiler/transformers/declarations.ts index bdcb19825e9f3..05b5ad1c8b9b4 100644 --- a/src/compiler/transformers/declarations.ts +++ b/src/compiler/transformers/declarations.ts @@ -6,7 +6,6 @@ import { append, ArrayBindingElement, arrayFrom, - AssertClause, BindingElement, BindingName, BindingPattern, @@ -70,7 +69,7 @@ import { getOutputPathsFor, getParseTreeNode, getRelativePathToDirectoryOrUrl, - getResolutionModeOverrideForClause, + getResolutionModeOverride, getResolvedExternalModuleName, getSetAccessorValueParameter, getSourceFileOfNode, @@ -86,6 +85,7 @@ import { hasSyntacticModifier, HeritageClause, Identifier, + ImportAttributes, ImportDeclaration, ImportEqualsDeclaration, ImportTypeNode, @@ -130,7 +130,6 @@ import { isMethodSignature, isModifier, isModuleDeclaration, - isNightly, isOmittedExpression, isPrivateIdentifier, isPropertySignature, @@ -312,7 +311,6 @@ export function transformDeclarations(context: TransformationContext) { trackExternalModuleSymbolOfImportTypeNode, reportNonlocalAugmentation, reportNonSerializableProperty, - reportImportTypeNodeResolutionModeOverride, }; let errorNameNode: DeclarationName | undefined; let errorFallbackNode: Declaration | undefined; @@ -456,12 +454,6 @@ export function transformDeclarations(context: TransformationContext) { } } - function reportImportTypeNodeResolutionModeOverride() { - if (!isNightly() && (errorNameNode || errorFallbackNode)) { - context.addDiagnostic(createDiagnosticForNode((errorNameNode || errorFallbackNode)!, Diagnostics.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)); - } - } - function transformDeclarationsForJS(sourceFile: SourceFile, bundled?: boolean) { const oldDiag = getSymbolAccessibilityDiagnostic; getSymbolAccessibilityDiagnostic = s => (s.errorNode && canProduceDiagnostics(s.errorNode) ? createGetSymbolAccessibilityDiagnosticForNode(s.errorNode)(s) : ({ @@ -985,7 +977,7 @@ export function transformDeclarations(context: TransformationContext) { decl.modifiers, decl.importClause, rewriteModuleSpecifier(decl, decl.moduleSpecifier), - getResolutionModeOverrideForClauseInNightly(decl.assertClause), + tryGetResolutionModeOverride(decl.attributes), ); } // The `importClause` visibility corresponds to the default's visibility. @@ -1002,7 +994,7 @@ export function transformDeclarations(context: TransformationContext) { /*namedBindings*/ undefined, ), rewriteModuleSpecifier(decl, decl.moduleSpecifier), - getResolutionModeOverrideForClauseInNightly(decl.assertClause), + tryGetResolutionModeOverride(decl.attributes), ); } if (decl.importClause.namedBindings.kind === SyntaxKind.NamespaceImport) { @@ -1018,7 +1010,7 @@ export function transformDeclarations(context: TransformationContext) { namedBindings, ), rewriteModuleSpecifier(decl, decl.moduleSpecifier), - getResolutionModeOverrideForClauseInNightly(decl.assertClause), + tryGetResolutionModeOverride(decl.attributes), ) : undefined; } // Named imports (optionally with visible default) @@ -1034,7 +1026,7 @@ export function transformDeclarations(context: TransformationContext) { bindingList && bindingList.length ? factory.updateNamedImports(decl.importClause.namedBindings, bindingList) : undefined, ), rewriteModuleSpecifier(decl, decl.moduleSpecifier), - getResolutionModeOverrideForClauseInNightly(decl.assertClause), + tryGetResolutionModeOverride(decl.attributes), ); } // Augmentation of export depends on import @@ -1044,21 +1036,15 @@ export function transformDeclarations(context: TransformationContext) { decl.modifiers, /*importClause*/ undefined, rewriteModuleSpecifier(decl, decl.moduleSpecifier), - getResolutionModeOverrideForClauseInNightly(decl.assertClause), + tryGetResolutionModeOverride(decl.attributes), ); } // Nothing visible } - function getResolutionModeOverrideForClauseInNightly(assertClause: AssertClause | undefined) { - const mode = getResolutionModeOverrideForClause(assertClause); - if (mode !== undefined) { - if (!isNightly()) { - context.addDiagnostic(createDiagnosticForNode(assertClause!, Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next)); - } - return assertClause; - } - return undefined; + function tryGetResolutionModeOverride(node: ImportAttributes | undefined) { + const mode = getResolutionModeOverride(node); + return node && mode !== undefined ? node : undefined; } function transformAndReplaceLatePaintedStatements(statements: NodeArray): NodeArray { @@ -1329,7 +1315,7 @@ export function transformDeclarations(context: TransformationContext) { return cleanup(factory.updateImportTypeNode( input, factory.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), - input.assertions, + input.attributes, input.qualifier, visitNodes(input.typeArguments, visitDeclarationSubtree, isTypeNode), input.isTypeOf, @@ -1391,7 +1377,7 @@ export function transformDeclarations(context: TransformationContext) { input.isTypeOnly, input.exportClause, rewriteModuleSpecifier(input, input.moduleSpecifier), - getResolutionModeOverrideForClause(input.assertClause) ? input.assertClause : undefined, + tryGetResolutionModeOverride(input.attributes), ); } case SyntaxKind.ExportAssignment: { diff --git a/src/compiler/transformers/jsx.ts b/src/compiler/transformers/jsx.ts index d0e191d537ad0..a71edbe2baeb6 100644 --- a/src/compiler/transformers/jsx.ts +++ b/src/compiler/transformers/jsx.ts @@ -170,7 +170,7 @@ export function transformJsx(context: TransformationContext): (x: SourceFile | B for (const [importSource, importSpecifiersMap] of arrayFrom(currentFileState.utilizedImplicitRuntimeImports.entries())) { if (isExternalModule(node)) { // Add `import` statement - const importStatement = factory.createImportDeclaration(/*modifiers*/ undefined, factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, factory.createNamedImports(arrayFrom(importSpecifiersMap.values()))), factory.createStringLiteral(importSource), /*assertClause*/ undefined); + const importStatement = factory.createImportDeclaration(/*modifiers*/ undefined, factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, factory.createNamedImports(arrayFrom(importSpecifiersMap.values()))), factory.createStringLiteral(importSource), /*attributes*/ undefined); setParentRecursive(importStatement, /*incremental*/ false); statements = insertStatementAfterCustomPrologue(statements.slice(), importStatement); } diff --git a/src/compiler/transformers/module/esnextAnd2015.ts b/src/compiler/transformers/module/esnextAnd2015.ts index 9e41ffc75de04..b99185231a892 100644 --- a/src/compiler/transformers/module/esnextAnd2015.ts +++ b/src/compiler/transformers/module/esnextAnd2015.ts @@ -159,6 +159,7 @@ export function transformECMAScriptModule(context: TransformationContext): (x: S ]), ), factory.createStringLiteral("module"), + /*attributes*/ undefined, ); const requireHelperName = factory.createUniqueName("__require", GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.FileLevel); const requireStatement = factory.createVariableStatement( @@ -265,7 +266,7 @@ export function transformECMAScriptModule(context: TransformationContext): (x: S ), ), node.moduleSpecifier, - node.assertClause, + node.attributes, ); setOriginalNode(importDecl, node.exportClause); diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 00eb218342e00..584cf837e180a 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -2227,7 +2227,7 @@ export function transformTypeScript(context: TransformationContext) { /*modifiers*/ undefined, importClause, node.moduleSpecifier, - node.assertClause, + node.attributes, ) : undefined; } @@ -2323,7 +2323,7 @@ export function transformTypeScript(context: TransformationContext) { node.isTypeOnly, exportClause, node.moduleSpecifier, - node.assertClause, + node.attributes, ) : undefined; } @@ -2393,7 +2393,7 @@ export function transformTypeScript(context: TransformationContext) { /*modifiers*/ undefined, /*importClause*/ undefined, node.moduleReference.expression, - /*assertClause*/ undefined, + /*attributes*/ undefined, ), node, ), diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 1f796f8b2a0da..f88f8a7dd31ce 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -376,9 +376,12 @@ export const enum SyntaxKind { DefaultClause, HeritageClause, CatchClause, - AssertClause, - AssertEntry, - ImportTypeAssertionContainer, + + ImportAttributes, + ImportAttribute, + /** @deprecated */ AssertClause = ImportAttributes, + /** @deprecated */ AssertEntry = ImportAttribute, + /** @deprecated */ ImportTypeAssertionContainer, // Property assignments PropertyAssignment, @@ -1129,6 +1132,8 @@ export type HasChildren = | ImportDeclaration | AssertClause | AssertEntry + | ImportAttributes + | ImportAttribute | ImportClause | NamespaceImport | NamespaceExport @@ -2141,10 +2146,11 @@ export interface KeywordTypeNode; + readonly elements: NodeArray; readonly multiLine?: boolean; } @@ -3672,7 +3690,8 @@ export interface ExportDeclaration extends DeclarationStatement, JSDocContainer readonly exportClause?: NamedExportBindings; /** If this is not a StringLiteral it will be a grammar error. */ readonly moduleSpecifier?: Expression; - readonly assertClause?: AssertClause; + /** @deprecated */ readonly assertClause?: AssertClause; + readonly attributes?: ImportAttributes; } export interface NamedImports extends Node { @@ -8419,8 +8438,8 @@ export interface NodeFactory { updateConditionalTypeNode(node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode; createInferTypeNode(typeParameter: TypeParameterDeclaration): InferTypeNode; updateInferTypeNode(node: InferTypeNode, typeParameter: TypeParameterDeclaration): InferTypeNode; - createImportTypeNode(argument: TypeNode, assertions?: ImportTypeAssertionContainer, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode; - updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, assertions: ImportTypeAssertionContainer | undefined, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean): ImportTypeNode; + createImportTypeNode(argument: TypeNode, attributes?: ImportAttributes, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode; + updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, attributes: ImportAttributes | undefined, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean): ImportTypeNode; createParenthesizedType(type: TypeNode): ParenthesizedTypeNode; updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; createThisTypeNode(): ThisTypeNode; @@ -8600,16 +8619,21 @@ export interface NodeFactory { updateNamespaceExportDeclaration(node: NamespaceExportDeclaration, name: Identifier): NamespaceExportDeclaration; createImportEqualsDeclaration(modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; updateImportEqualsDeclaration(node: ImportEqualsDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; - createImportDeclaration(modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause?: AssertClause): ImportDeclaration; - updateImportDeclaration(node: ImportDeclaration, modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; + createImportDeclaration(modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, attributes?: ImportAttributes): ImportDeclaration; + updateImportDeclaration(node: ImportDeclaration, modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, attributes: ImportAttributes | undefined): ImportDeclaration; createImportClause(isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; - createAssertClause(elements: NodeArray, multiLine?: boolean): AssertClause; - updateAssertClause(node: AssertClause, elements: NodeArray, multiLine?: boolean): AssertClause; - createAssertEntry(name: AssertionKey, value: Expression): AssertEntry; - updateAssertEntry(node: AssertEntry, name: AssertionKey, value: Expression): AssertEntry; - createImportTypeAssertionContainer(clause: AssertClause, multiLine?: boolean): ImportTypeAssertionContainer; - updateImportTypeAssertionContainer(node: ImportTypeAssertionContainer, clause: AssertClause, multiLine?: boolean): ImportTypeAssertionContainer; + /** @deprecated */ createAssertClause(elements: NodeArray, multiLine?: boolean): AssertClause; + /** @deprecated */ updateAssertClause(node: AssertClause, elements: NodeArray, multiLine?: boolean): AssertClause; + /** @deprecated */ createAssertEntry(name: AssertionKey, value: Expression): AssertEntry; + /** @deprecated */ updateAssertEntry(node: AssertEntry, name: AssertionKey, value: Expression): AssertEntry; + /** @deprecated */ createImportTypeAssertionContainer(clause: AssertClause, multiLine?: boolean): ImportTypeAssertionContainer; + /** @deprecated */ updateImportTypeAssertionContainer(node: ImportTypeAssertionContainer, clause: AssertClause, multiLine?: boolean): ImportTypeAssertionContainer; + createImportAttributes(elements: NodeArray, multiLine?: boolean): ImportAttributes; + /** @internal */ createImportAttributes(elements: NodeArray, multiLine?: boolean, token?: ImportAttributes["token"]): ImportAttributes; + updateImportAttributes(node: ImportAttributes, elements: NodeArray, multiLine?: boolean): ImportAttributes; + createImportAttribute(name: ImportAttributeName, value: Expression): ImportAttribute; + updateImportAttribute(node: ImportAttribute, name: ImportAttributeName, value: Expression): ImportAttribute; createNamespaceImport(name: Identifier): NamespaceImport; updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport; createNamespaceExport(name: Identifier): NamespaceExport; @@ -8620,8 +8644,8 @@ export interface NodeFactory { updateImportSpecifier(node: ImportSpecifier, isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier; createExportAssignment(modifiers: readonly ModifierLike[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment; updateExportAssignment(node: ExportAssignment, modifiers: readonly ModifierLike[] | undefined, expression: Expression): ExportAssignment; - createExportDeclaration(modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, assertClause?: AssertClause): ExportDeclaration; - updateExportDeclaration(node: ExportDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, assertClause: AssertClause | undefined): ExportDeclaration; + createExportDeclaration(modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, attributes?: ImportAttributes): ExportDeclaration; + updateExportDeclaration(node: ExportDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, attributes: ImportAttributes | undefined): ExportDeclaration; createNamedExports(elements: readonly ExportSpecifier[]): NamedExports; updateNamedExports(node: NamedExports, elements: readonly ExportSpecifier[]): NamedExports; createExportSpecifier(isTypeOnly: boolean, propertyName: string | Identifier | undefined, name: string | Identifier): ExportSpecifier; @@ -9658,7 +9682,6 @@ export interface SymbolTracker { trackExternalModuleSymbolOfImportTypeNode?(symbol: Symbol): void; reportNonlocalAugmentation?(containingFile: SourceFile, parentSymbol: Symbol, augmentingSymbol: Symbol): void; reportNonSerializableProperty?(propertyName: string): void; - reportImportTypeNodeResolutionModeOverride?(): void; } export interface TextSpan { @@ -9751,7 +9774,8 @@ export const enum ListFormat { ObjectBindingPatternElements = SingleLine | AllowTrailingComma | SpaceBetweenBraces | CommaDelimited | SpaceBetweenSiblings | NoSpaceIfEmpty, ArrayBindingPatternElements = SingleLine | AllowTrailingComma | CommaDelimited | SpaceBetweenSiblings | NoSpaceIfEmpty, ObjectLiteralExpressionProperties = PreserveLines | CommaDelimited | SpaceBetweenSiblings | SpaceBetweenBraces | Indented | Braces | NoSpaceIfEmpty, - ImportClauseEntries = PreserveLines | CommaDelimited | SpaceBetweenSiblings | SpaceBetweenBraces | Indented | Braces | NoSpaceIfEmpty, + ImportAttributes = PreserveLines | CommaDelimited | SpaceBetweenSiblings | SpaceBetweenBraces | Indented | Braces | NoSpaceIfEmpty, + /** @deprecated */ ImportClauseEntries = ImportAttributes, ArrayLiteralExpressionElements = PreserveLines | CommaDelimited | SpaceBetweenSiblings | AllowTrailingComma | Indented | SquareBrackets, CommaListElements = CommaDelimited | SpaceBetweenSiblings | SingleLine, CallExpressionArguments = CommaDelimited | SpaceBetweenSiblings | SingleLine | Parenthesis, diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index e7f376029eb9f..27d8731ec6e2f 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -194,6 +194,7 @@ import { getPathComponents, getPathFromPathComponents, getRelativePathToDirectoryOrUrl, + getResolutionModeOverride, getRootLength, getSnippetElement, getStringComparer, @@ -553,7 +554,6 @@ import { VariableDeclarationList, VariableLikeDeclaration, VariableStatement, - version, WhileStatement, WithStatement, WrappedExpression, @@ -5975,11 +5975,6 @@ export function getIndentSize() { return indentStrings[1].length; } -/** @internal */ -export function isNightly() { - return version.includes("-dev") || version.includes("-insiders"); -} - /** @internal */ export function createTextWriter(newLine: string): EmitTextWriter { // Why var? It avoids TDZ checks in the runtime which can be costly. @@ -10437,3 +10432,11 @@ export function getPropertyNameFromType(type: StringLiteralType | NumberLiteralT export function isExpandoPropertyDeclaration(declaration: Declaration | undefined): declaration is PropertyAccessExpression | ElementAccessExpression | BinaryExpression { return !!declaration && (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isBinaryExpression(declaration)); } + +/** @internal */ +export function hasResolutionModeOverride(node: ImportTypeNode | ImportDeclaration | ExportDeclaration | undefined) { + if (node === undefined) { + return false; + } + return !!getResolutionModeOverride(node.attributes); +} diff --git a/src/compiler/utilitiesPublic.ts b/src/compiler/utilitiesPublic.ts index 060b6f7b059a5..b274d533b81da 100644 --- a/src/compiler/utilitiesPublic.ts +++ b/src/compiler/utilitiesPublic.ts @@ -6,7 +6,6 @@ import { ArrayBindingOrAssignmentElement, ArrayBindingOrAssignmentPattern, AssertionExpression, - AssertionKey, AssignmentDeclarationKind, AssignmentPattern, AutoAccessorPropertyDeclaration, @@ -92,6 +91,7 @@ import { hasSyntacticModifier, HasType, Identifier, + ImportAttributeName, ImportClause, ImportEqualsDeclaration, ImportSpecifier, @@ -1518,14 +1518,14 @@ export function isTypeOnlyImportOrExportDeclaration(node: Node): node is TypeOnl return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node); } -export function isAssertionKey(node: Node): node is AssertionKey { - return isStringLiteral(node) || isIdentifier(node); -} - export function isStringTextContainingNode(node: Node): node is StringLiteral | TemplateLiteralToken { return node.kind === SyntaxKind.StringLiteral || isTemplateLiteralKind(node.kind); } +export function isImportAttributeName(node: Node): node is ImportAttributeName { + return isStringLiteral(node) || isIdentifier(node); +} + // Identifiers /** @internal */ diff --git a/src/compiler/visitorPublic.ts b/src/compiler/visitorPublic.ts index 109614c3244b2..c5e99d170911c 100644 --- a/src/compiler/visitorPublic.ts +++ b/src/compiler/visitorPublic.ts @@ -12,8 +12,6 @@ import { isArray, isArrayBindingElement, isAssertClause, - isAssertEntry, - isAssertionKey, isAssertsKeyword, isAsteriskToken, isAwaitKeyword, @@ -42,9 +40,11 @@ import { isHeritageClause, isIdentifier, isIdentifierOrThisTypeNode, + isImportAttribute, + isImportAttributeName, + isImportAttributes, isImportClause, isImportSpecifier, - isImportTypeAssertionContainer, isJsxAttributeLike, isJsxAttributeName, isJsxAttributes, @@ -894,7 +894,7 @@ const visitEachChildTable: VisitEachChildTable = { return context.factory.updateImportTypeNode( node, Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)), - nodeVisitor(node.assertions, visitor, isImportTypeAssertionContainer), + nodeVisitor(node.attributes, visitor, isImportAttributes), nodeVisitor(node.qualifier, visitor, isEntityName), nodesVisitor(node.typeArguments, visitor, isTypeNode), node.isTypeOf, @@ -1524,22 +1524,22 @@ const visitEachChildTable: VisitEachChildTable = { nodesVisitor(node.modifiers, visitor, isModifierLike), nodeVisitor(node.importClause, visitor, isImportClause), Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)), - nodeVisitor(node.assertClause, visitor, isAssertClause), + nodeVisitor(node.attributes, visitor, isImportAttributes), ); }, - [SyntaxKind.AssertClause]: function visitEachChildOfAssertClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { - return context.factory.updateAssertClause( + [SyntaxKind.ImportAttributes]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) { + return context.factory.updateImportAttributes( node, - nodesVisitor(node.elements, visitor, isAssertEntry), + nodesVisitor(node.elements, visitor, isImportAttribute), node.multiLine, ); }, - [SyntaxKind.AssertEntry]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { - return context.factory.updateAssertEntry( + [SyntaxKind.ImportAttribute]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) { + return context.factory.updateImportAttribute( node, - Debug.checkDefined(nodeVisitor(node.name, visitor, isAssertionKey)), + Debug.checkDefined(nodeVisitor(node.name, visitor, isImportAttributeName)), Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression)), ); }, @@ -1598,7 +1598,7 @@ const visitEachChildTable: VisitEachChildTable = { node.isTypeOnly, nodeVisitor(node.exportClause, visitor, isNamedExportBindings), nodeVisitor(node.moduleSpecifier, visitor, isExpression), - nodeVisitor(node.assertClause, visitor, isAssertClause), + nodeVisitor(node.attributes, visitor, isImportAttributes), ); }, diff --git a/src/harness/fourslashInterfaceImpl.ts b/src/harness/fourslashInterfaceImpl.ts index d115c7b42dc90..e9f9dd0b40233 100644 --- a/src/harness/fourslashInterfaceImpl.ts +++ b/src/harness/fourslashInterfaceImpl.ts @@ -1133,6 +1133,7 @@ export namespace Completion { interfaceEntry("ImportMeta"), interfaceEntry("ImportCallOptions"), interfaceEntry("ImportAssertions"), + interfaceEntry("ImportAttributes"), varEntry("Math"), varEntry("Date"), interfaceEntry("DateConstructor"), diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 988751cd338b3..8065e2d3de83c 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -620,7 +620,8 @@ interface ImportMeta { * augmented via interface merging. */ interface ImportCallOptions { - assert?: ImportAssertions; + /** @deprecated*/ assert?: ImportAssertions; + with?: ImportAttributes; } /** @@ -630,6 +631,13 @@ interface ImportAssertions { [key: string]: string; } +/** + * The type for the `with` property of the optional second argument to `import()`. + */ +interface ImportAttributes { + [key: string]: string; +} + interface Math { /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ readonly E: number; diff --git a/src/services/codefixes/convertToTypeOnlyExport.ts b/src/services/codefixes/convertToTypeOnlyExport.ts index 36a75c5ddefaa..14ec2e3e8e31d 100644 --- a/src/services/codefixes/convertToTypeOnlyExport.ts +++ b/src/services/codefixes/convertToTypeOnlyExport.ts @@ -68,14 +68,14 @@ function fixSingleExportDeclaration(changes: textChanges.ChangeTracker, exportSp /*isTypeOnly*/ false, factory.updateNamedExports(exportClause, filter(exportClause.elements, e => !contains(typeExportSpecifiers, e))), exportDeclaration.moduleSpecifier, - /*assertClause*/ undefined, + /*attributes*/ undefined, ); const typeExportDeclaration = factory.createExportDeclaration( /*modifiers*/ undefined, /*isTypeOnly*/ true, factory.createNamedExports(typeExportSpecifiers), exportDeclaration.moduleSpecifier, - /*assertClause*/ undefined, + /*attributes*/ undefined, ); changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration, { diff --git a/src/services/codefixes/convertToTypeOnlyImport.ts b/src/services/codefixes/convertToTypeOnlyImport.ts index 5578ddc5d6902..43ebf3e7ac6bc 100644 --- a/src/services/codefixes/convertToTypeOnlyImport.ts +++ b/src/services/codefixes/convertToTypeOnlyImport.ts @@ -125,13 +125,13 @@ function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, de getSynthesizedDeepClones(declaration.modifiers, /*includeTrivia*/ true), factory.createImportClause(/*isTypeOnly*/ true, getSynthesizedDeepClone(importClause.name, /*includeTrivia*/ true), /*namedBindings*/ undefined), getSynthesizedDeepClone(declaration.moduleSpecifier, /*includeTrivia*/ true), - getSynthesizedDeepClone(declaration.assertClause, /*includeTrivia*/ true), + getSynthesizedDeepClone(declaration.attributes, /*includeTrivia*/ true), ), factory.createImportDeclaration( getSynthesizedDeepClones(declaration.modifiers, /*includeTrivia*/ true), factory.createImportClause(/*isTypeOnly*/ true, /*name*/ undefined, getSynthesizedDeepClone(importClause.namedBindings, /*includeTrivia*/ true)), getSynthesizedDeepClone(declaration.moduleSpecifier, /*includeTrivia*/ true), - getSynthesizedDeepClone(declaration.assertClause, /*includeTrivia*/ true), + getSynthesizedDeepClone(declaration.attributes, /*includeTrivia*/ true), ), ]); } @@ -142,7 +142,7 @@ function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, de sameMap(importClause.namedBindings.elements, e => factory.updateImportSpecifier(e, /*isTypeOnly*/ false, e.propertyName, e.name)), ) : importClause.namedBindings; - const importDeclaration = factory.updateImportDeclaration(declaration, declaration.modifiers, factory.updateImportClause(importClause, /*isTypeOnly*/ true, importClause.name, newNamedBindings), declaration.moduleSpecifier, declaration.assertClause); + const importDeclaration = factory.updateImportDeclaration(declaration, declaration.modifiers, factory.updateImportClause(importClause, /*isTypeOnly*/ true, importClause.name, newNamedBindings), declaration.moduleSpecifier, declaration.attributes); changes.replaceNode(sourceFile, declaration, importDeclaration); } } diff --git a/src/services/codefixes/fixAddModuleReferTypeMissingTypeof.ts b/src/services/codefixes/fixAddModuleReferTypeMissingTypeof.ts index 830e76d60f9c8..1523819f60190 100644 --- a/src/services/codefixes/fixAddModuleReferTypeMissingTypeof.ts +++ b/src/services/codefixes/fixAddModuleReferTypeMissingTypeof.ts @@ -38,6 +38,6 @@ function getImportTypeNode(sourceFile: SourceFile, pos: number): ImportTypeNode } function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, importType: ImportTypeNode) { - const newTypeNode = factory.updateImportTypeNode(importType, importType.argument, importType.assertions, importType.qualifier, importType.typeArguments, /*isTypeOf*/ true); + const newTypeNode = factory.updateImportTypeNode(importType, importType.argument, importType.attributes, importType.qualifier, importType.typeArguments, /*isTypeOf*/ true); changes.replaceNode(sourceFile, importType, newTypeNode); } diff --git a/src/services/codefixes/fixImportNonExportedMember.ts b/src/services/codefixes/fixImportNonExportedMember.ts index 62d82a42c496f..376a74663e114 100644 --- a/src/services/codefixes/fixImportNonExportedMember.ts +++ b/src/services/codefixes/fixImportNonExportedMember.ts @@ -184,13 +184,13 @@ function updateExport(changes: textChanges.ChangeTracker, program: Program, sour factory.createNodeArray([...namedExports, ...createExportSpecifiers(names, allowTypeModifier)], /*hasTrailingComma*/ namedExports.hasTrailingComma), ), node.moduleSpecifier, - node.assertClause, + node.attributes, ), ); } function createExport(changes: textChanges.ChangeTracker, program: Program, sourceFile: SourceFile, names: ExportName[]) { - changes.insertNodeAtEndOfScope(sourceFile, sourceFile, factory.createExportDeclaration(/*modifiers*/ undefined, /*isTypeOnly*/ false, factory.createNamedExports(createExportSpecifiers(names, /*allowTypeModifier*/ getIsolatedModules(program.getCompilerOptions()))), /*moduleSpecifier*/ undefined, /*assertClause*/ undefined)); + changes.insertNodeAtEndOfScope(sourceFile, sourceFile, factory.createExportDeclaration(/*modifiers*/ undefined, /*isTypeOnly*/ false, factory.createNamedExports(createExportSpecifiers(names, /*allowTypeModifier*/ getIsolatedModules(program.getCompilerOptions()))), /*moduleSpecifier*/ undefined, /*attributes*/ undefined)); } function createExportSpecifiers(names: ExportName[], allowTypeModifier: boolean) { diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index e6c3eda6e2b14..b0466d065d982 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -1655,7 +1655,7 @@ function getNewImports( factory.createNamespaceImport(factory.createIdentifier(namespaceLikeImport.name)), ), quotedModuleSpecifier, - /*assertClause*/ undefined, + /*attributes*/ undefined, ); statements = combine(statements, declaration); } diff --git a/src/services/codefixes/requireInTs.ts b/src/services/codefixes/requireInTs.ts index cc22d5e9f0078..1c385d5ed0e19 100644 --- a/src/services/codefixes/requireInTs.ts +++ b/src/services/codefixes/requireInTs.ts @@ -57,7 +57,7 @@ function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, in statement, defaultImportName && !allowSyntheticDefaults ? factory.createImportEqualsDeclaration(/*modifiers*/ undefined, /*isTypeOnly*/ false, defaultImportName, factory.createExternalModuleReference(required)) - : factory.createImportDeclaration(/*modifiers*/ undefined, factory.createImportClause(/*isTypeOnly*/ false, defaultImportName, namedImports), required, /*assertClause*/ undefined), + : factory.createImportDeclaration(/*modifiers*/ undefined, factory.createImportClause(/*isTypeOnly*/ false, defaultImportName, namedImports), required, /*attributes*/ undefined), ); } diff --git a/src/services/codefixes/splitTypeOnlyImport.ts b/src/services/codefixes/splitTypeOnlyImport.ts index 0b1e2e48e577e..8ceba91300fbe 100644 --- a/src/services/codefixes/splitTypeOnlyImport.ts +++ b/src/services/codefixes/splitTypeOnlyImport.ts @@ -53,7 +53,7 @@ function splitTypeOnlyImport(changes: textChanges.ChangeTracker, importDeclarati importDeclaration.modifiers, factory.updateImportClause(importClause, importClause.isTypeOnly, importClause.name, /*namedBindings*/ undefined), importDeclaration.moduleSpecifier, - importDeclaration.assertClause, + importDeclaration.attributes, ), ); @@ -64,7 +64,7 @@ function splitTypeOnlyImport(changes: textChanges.ChangeTracker, importDeclarati /*modifiers*/ undefined, factory.updateImportClause(importClause, importClause.isTypeOnly, /*name*/ undefined, importClause.namedBindings), importDeclaration.moduleSpecifier, - importDeclaration.assertClause, + importDeclaration.attributes, ), ); } diff --git a/src/services/organizeImports.ts b/src/services/organizeImports.ts index 1a5fa964a9c63..777541679b7da 100644 --- a/src/services/organizeImports.ts +++ b/src/services/organizeImports.ts @@ -269,7 +269,7 @@ function removeUnusedImports(oldImports: readonly ImportDeclaration[], sourceFil importDecl.modifiers, /*importClause*/ undefined, moduleSpecifier, - /*assertClause*/ undefined, + /*attributes*/ undefined, )); } // If we're not in a declaration file, we can't remove the import clause even though @@ -530,7 +530,7 @@ function coalesceExportsWorker(exportGroup: readonly ExportDeclaration[], compar factory.updateNamespaceExport(exportDecl.exportClause, exportDecl.exportClause.name) ), exportDecl.moduleSpecifier, - exportDecl.assertClause, + exportDecl.attributes, ), ); } @@ -579,7 +579,7 @@ function updateImportDeclarationAndClause( importDeclaration.modifiers, factory.updateImportClause(importDeclaration.importClause!, importDeclaration.importClause!.isTypeOnly, name, namedBindings), // TODO: GH#18217 importDeclaration.moduleSpecifier, - importDeclaration.assertClause, + importDeclaration.attributes, ); } diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index 977979c69b1f8..87ac0d10ba931 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -12,6 +12,7 @@ import { DefaultClause, findChildOfKind, getLeadingCommentRanges, + ImportAttributes, isAnyImportSyntax, isArrayLiteralExpression, isBinaryExpression, @@ -300,11 +301,12 @@ function getOutliningSpanForNode(n: Node, sourceFile: SourceFile): OutliningSpan return spanForParenthesizedExpression(n as ParenthesizedExpression); case SyntaxKind.NamedImports: case SyntaxKind.NamedExports: + case SyntaxKind.ImportAttributes: case SyntaxKind.AssertClause: - return spanForNamedImportsOrExportsOrAssertClause(n as NamedImports | NamedExports | AssertClause); + return spanForImportExportElements(n as NamedImports | NamedExports | AssertClause | ImportAttributes); } - function spanForNamedImportsOrExportsOrAssertClause(node: NamedImports | NamedExports | AssertClause) { + function spanForImportExportElements(node: NamedImports | NamedExports | AssertClause | ImportAttributes) { if (!node.elements.length) { return undefined; } diff --git a/src/services/refactors/convertExport.ts b/src/services/refactors/convertExport.ts index 342013cdac37b..7f477fc1a86ac 100644 --- a/src/services/refactors/convertExport.ts +++ b/src/services/refactors/convertExport.ts @@ -275,7 +275,7 @@ function changeDefaultToNamedImport(importingSourceFile: SourceFile, ref: Identi } case SyntaxKind.ImportType: const importTypeNode = parent as ImportTypeNode; - changes.replaceNode(importingSourceFile, parent, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.assertions, factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf)); + changes.replaceNode(importingSourceFile, parent, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.attributes, factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf)); break; default: Debug.failBadSyntaxKind(parent); diff --git a/src/services/refactors/convertImport.ts b/src/services/refactors/convertImport.ts index fdcaccff5773c..5e6ac06ec846d 100644 --- a/src/services/refactors/convertImport.ts +++ b/src/services/refactors/convertImport.ts @@ -280,5 +280,5 @@ function isExportEqualsModule(moduleSpecifier: Expression, checker: TypeChecker) } function updateImport(old: ImportDeclaration, defaultImportName: Identifier | undefined, elements: readonly ImportSpecifier[] | undefined): ImportDeclaration { - return factory.createImportDeclaration(/*modifiers*/ undefined, factory.createImportClause(/*isTypeOnly*/ false, defaultImportName, elements && elements.length ? factory.createNamedImports(elements) : undefined), old.moduleSpecifier, /*assertClause*/ undefined); + return factory.createImportDeclaration(/*modifiers*/ undefined, factory.createImportClause(/*isTypeOnly*/ false, defaultImportName, elements && elements.length ? factory.createNamedImports(elements) : undefined), old.moduleSpecifier, /*attributes*/ undefined); } diff --git a/src/services/refactors/moveToFile.ts b/src/services/refactors/moveToFile.ts index effd943751963..29aa22de80216 100644 --- a/src/services/refactors/moveToFile.ts +++ b/src/services/refactors/moveToFile.ts @@ -479,7 +479,7 @@ function updateNamespaceLikeImportNode(node: SupportedImport, newNamespaceName: /*modifiers*/ undefined, factory.createImportClause(/*isTypeOnly*/ false, /*name*/ undefined, factory.createNamespaceImport(newNamespaceId)), newModuleString, - /*assertClause*/ undefined, + /*attributes*/ undefined, ); case SyntaxKind.ImportEqualsDeclaration: return factory.createImportEqualsDeclaration(/*modifiers*/ undefined, /*isTypeOnly*/ false, newNamespaceId, factory.createExternalModuleReference(newModuleString)); @@ -772,7 +772,7 @@ export function filterImport(i: SupportedImport, moduleSpecifier: StringLiteralL const defaultImport = clause.name && keep(clause.name) ? clause.name : undefined; const namedBindings = clause.namedBindings && filterNamedBindings(clause.namedBindings, keep); return defaultImport || namedBindings - ? factory.createImportDeclaration(/*modifiers*/ undefined, factory.createImportClause(clause.isTypeOnly, defaultImport, namedBindings), getSynthesizedDeepClone(moduleSpecifier), /*assertClause*/ undefined) + ? factory.createImportDeclaration(/*modifiers*/ undefined, factory.createImportClause(clause.isTypeOnly, defaultImport, namedBindings), getSynthesizedDeepClone(moduleSpecifier), /*attributes*/ undefined) : undefined; } case SyntaxKind.ImportEqualsDeclaration: @@ -1198,7 +1198,7 @@ function moveStatementsToTargetFile(changes: textChanges.ChangeTracker, program: } if (length(updatedElements) < length(elements)) { - changes.replaceNode(targetFile, exportDeclaration, factory.updateExportDeclaration(exportDeclaration, exportDeclaration.modifiers, exportDeclaration.isTypeOnly, factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)), exportDeclaration.moduleSpecifier, exportDeclaration.assertClause)); + changes.replaceNode(targetFile, exportDeclaration, factory.updateExportDeclaration(exportDeclaration, exportDeclaration.modifiers, exportDeclaration.isTypeOnly, factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)), exportDeclaration.moduleSpecifier, exportDeclaration.attributes)); } } } diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 8d9032a6d4844..b14d16bd671c2 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -2501,7 +2501,7 @@ export function makeImport(defaultImport: Identifier | undefined, namedImports: ? factory.createImportClause(!!isTypeOnly, defaultImport, namedImports && namedImports.length ? factory.createNamedImports(namedImports) : undefined) : undefined, typeof moduleSpecifier === "string" ? makeStringLiteral(moduleSpecifier, quotePreference) : moduleSpecifier, - /*assertClause*/ undefined, + /*attributes*/ undefined, ); } diff --git a/src/testRunner/unittests/transform.ts b/src/testRunner/unittests/transform.ts index 766a1d9f8ec9a..c56721a2c9ca4 100644 --- a/src/testRunner/unittests/transform.ts +++ b/src/testRunner/unittests/transform.ts @@ -309,7 +309,7 @@ describe("unittests:: TransformAPI", () => { const exports = [{ name: "x" }]; const exportSpecifiers = exports.map(e => ts.factory.createExportSpecifier(/*isTypeOnly*/ false, e.name, e.name)); const exportClause = ts.factory.createNamedExports(exportSpecifiers); - const newEd = ts.factory.updateExportDeclaration(ed, ed.modifiers, ed.isTypeOnly, exportClause, ed.moduleSpecifier, ed.assertClause); + const newEd = ts.factory.updateExportDeclaration(ed, ed.modifiers, ed.isTypeOnly, exportClause, ed.moduleSpecifier, ed.attributes); return newEd as ts.Node as T; } @@ -347,7 +347,7 @@ describe("unittests:: TransformAPI", () => { ts.factory.createNamespaceImport(ts.factory.createIdentifier("i0")), ), /*moduleSpecifier*/ ts.factory.createStringLiteral("./comp1"), - /*assertClause*/ undefined, + /*attributes*/ undefined, ); return ts.factory.updateSourceFile(sf, [importStar]); } diff --git a/src/testRunner/unittests/tscWatch/moduleResolution.ts b/src/testRunner/unittests/tscWatch/moduleResolution.ts index 10a7a86a1614b..099d43066f6ba 100644 --- a/src/testRunner/unittests/tscWatch/moduleResolution.ts +++ b/src/testRunner/unittests/tscWatch/moduleResolution.ts @@ -376,6 +376,77 @@ describe("unittests:: tsc-watch:: moduleResolution", () => { ], }); + verifyTscWatch({ + scenario: "moduleResolution", + subScenario: "module resolutions from files with partially used import attributes", + sys: () => + createWatchedSystem([ + { + path: `/user/username/projects/myproject/tsconfig.json`, + content: JSON.stringify({ + compilerOptions: { moduleResolution: "node16" }, + }), + }, + { + path: `/user/username/projects/myproject/index.ts`, + content: Utils.dedent` + import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + import type { RequireInterface } from "pkg1" with { "resolution-mode": "require" }; + import {x} from "./a"; + `, + }, + { + path: `/user/username/projects/myproject/a.ts`, + content: Utils.dedent` + export const x = 10; + `, + }, + { + path: `/user/username/projects/myproject/node_modules/pkg/package.json`, + content: JSON.stringify({ + name: "pkg", + version: "0.0.1", + exports: { + import: "./import.js", + require: "./require.js", + }, + }), + }, + { + path: `/user/username/projects/myproject/node_modules/pkg/import.d.ts`, + content: `export interface ImportInterface {}`, + }, + { + path: `/user/username/projects/myproject/node_modules/pkg/require.d.ts`, + content: `export interface RequireInterface {}`, + }, + { + path: `/user/username/projects/myproject/node_modules/pkg1/package.json`, + content: JSON.stringify({ + name: "pkg1", + version: "0.0.1", + exports: { + import: "./import.js", + require: "./require.js", + }, + }), + }, + { + path: `/user/username/projects/myproject/node_modules/pkg1/import.d.ts`, + content: `export interface ImportInterface {}`, + }, + libFile, + ], { currentDirectory: "/user/username/projects/myproject" }), + commandLineArgs: ["-w", "--traceResolution"], + edits: [ + { + caption: "modify aFile by adding import", + edit: sys => sys.appendFile(`/user/username/projects/myproject/a.ts`, `import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }`), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + ], + }); + verifyTscWatch({ scenario: "moduleResolution", subScenario: "type reference resolutions reuse", diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index dcacb96447abe..e5d6d5f2136cf 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -4464,9 +4464,11 @@ declare namespace ts { DefaultClause = 297, HeritageClause = 298, CatchClause = 299, - AssertClause = 300, - AssertEntry = 301, - ImportTypeAssertionContainer = 302, + ImportAttributes = 300, + ImportAttribute = 301, + /** @deprecated */ AssertClause = 300, + /** @deprecated */ AssertEntry = 301, + /** @deprecated */ ImportTypeAssertionContainer = 302, PropertyAssignment = 303, ShorthandPropertyAssignment = 304, SpreadAssignment = 305, @@ -5197,17 +5199,19 @@ declare namespace ts { interface KeywordTypeNode extends KeywordToken, TypeNode { readonly kind: TKind; } + /** @deprecated */ interface ImportTypeAssertionContainer extends Node { readonly kind: SyntaxKind.ImportTypeAssertionContainer; readonly parent: ImportTypeNode; - readonly assertClause: AssertClause; + /** @deprecated */ readonly assertClause: AssertClause; readonly multiLine?: boolean; } interface ImportTypeNode extends NodeWithTypeArguments { readonly kind: SyntaxKind.ImportType; readonly isTypeOf: boolean; readonly argument: TypeNode; - readonly assertions?: ImportTypeAssertionContainer; + /** @deprecated */ readonly assertions?: ImportTypeAssertionContainer; + readonly attributes?: ImportAttributes; readonly qualifier?: EntityName; } interface ThisTypeNode extends TypeNode { @@ -5998,7 +6002,8 @@ declare namespace ts { readonly importClause?: ImportClause; /** If this is not a StringLiteral it will be a grammar error. */ readonly moduleSpecifier: Expression; - readonly assertClause?: AssertClause; + /** @deprecated */ readonly assertClause?: AssertClause; + readonly attributes?: ImportAttributes; } type NamedImportBindings = NamespaceImport | NamedImports; type NamedExportBindings = NamespaceExport | NamedExports; @@ -6009,17 +6014,24 @@ declare namespace ts { readonly name?: Identifier; readonly namedBindings?: NamedImportBindings; } - type AssertionKey = Identifier | StringLiteral; - interface AssertEntry extends Node { - readonly kind: SyntaxKind.AssertEntry; - readonly parent: AssertClause; - readonly name: AssertionKey; + /** @deprecated */ + type AssertionKey = ImportAttributeName; + /** @deprecated */ + type AssertEntry = ImportAttribute; + /** @deprecated */ + type AssertClause = ImportAttributes; + type ImportAttributeName = Identifier | StringLiteral; + interface ImportAttribute extends Node { + readonly kind: SyntaxKind.ImportAttribute; + readonly parent: ImportAttributes; + readonly name: ImportAttributeName; readonly value: Expression; } - interface AssertClause extends Node { - readonly kind: SyntaxKind.AssertClause; + interface ImportAttributes extends Node { + readonly token: SyntaxKind.WithKeyword | SyntaxKind.AssertKeyword; + readonly kind: SyntaxKind.ImportAttributes; readonly parent: ImportDeclaration | ExportDeclaration; - readonly elements: NodeArray; + readonly elements: NodeArray; readonly multiLine?: boolean; } interface NamespaceImport extends NamedDeclaration { @@ -6045,7 +6057,8 @@ declare namespace ts { readonly exportClause?: NamedExportBindings; /** If this is not a StringLiteral it will be a grammar error. */ readonly moduleSpecifier?: Expression; - readonly assertClause?: AssertClause; + /** @deprecated */ readonly assertClause?: AssertClause; + readonly attributes?: ImportAttributes; } interface NamedImports extends Node { readonly kind: SyntaxKind.NamedImports; @@ -8008,8 +8021,8 @@ declare namespace ts { updateConditionalTypeNode(node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode; createInferTypeNode(typeParameter: TypeParameterDeclaration): InferTypeNode; updateInferTypeNode(node: InferTypeNode, typeParameter: TypeParameterDeclaration): InferTypeNode; - createImportTypeNode(argument: TypeNode, assertions?: ImportTypeAssertionContainer, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode; - updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, assertions: ImportTypeAssertionContainer | undefined, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean): ImportTypeNode; + createImportTypeNode(argument: TypeNode, attributes?: ImportAttributes, qualifier?: EntityName, typeArguments?: readonly TypeNode[], isTypeOf?: boolean): ImportTypeNode; + updateImportTypeNode(node: ImportTypeNode, argument: TypeNode, attributes: ImportAttributes | undefined, qualifier: EntityName | undefined, typeArguments: readonly TypeNode[] | undefined, isTypeOf?: boolean): ImportTypeNode; createParenthesizedType(type: TypeNode): ParenthesizedTypeNode; updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; createThisTypeNode(): ThisTypeNode; @@ -8166,16 +8179,20 @@ declare namespace ts { updateNamespaceExportDeclaration(node: NamespaceExportDeclaration, name: Identifier): NamespaceExportDeclaration; createImportEqualsDeclaration(modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, name: string | Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; updateImportEqualsDeclaration(node: ImportEqualsDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, name: Identifier, moduleReference: ModuleReference): ImportEqualsDeclaration; - createImportDeclaration(modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause?: AssertClause): ImportDeclaration; - updateImportDeclaration(node: ImportDeclaration, modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, assertClause: AssertClause | undefined): ImportDeclaration; + createImportDeclaration(modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, attributes?: ImportAttributes): ImportDeclaration; + updateImportDeclaration(node: ImportDeclaration, modifiers: readonly ModifierLike[] | undefined, importClause: ImportClause | undefined, moduleSpecifier: Expression, attributes: ImportAttributes | undefined): ImportDeclaration; createImportClause(isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; updateImportClause(node: ImportClause, isTypeOnly: boolean, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined): ImportClause; - createAssertClause(elements: NodeArray, multiLine?: boolean): AssertClause; - updateAssertClause(node: AssertClause, elements: NodeArray, multiLine?: boolean): AssertClause; - createAssertEntry(name: AssertionKey, value: Expression): AssertEntry; - updateAssertEntry(node: AssertEntry, name: AssertionKey, value: Expression): AssertEntry; - createImportTypeAssertionContainer(clause: AssertClause, multiLine?: boolean): ImportTypeAssertionContainer; - updateImportTypeAssertionContainer(node: ImportTypeAssertionContainer, clause: AssertClause, multiLine?: boolean): ImportTypeAssertionContainer; + /** @deprecated */ createAssertClause(elements: NodeArray, multiLine?: boolean): AssertClause; + /** @deprecated */ updateAssertClause(node: AssertClause, elements: NodeArray, multiLine?: boolean): AssertClause; + /** @deprecated */ createAssertEntry(name: AssertionKey, value: Expression): AssertEntry; + /** @deprecated */ updateAssertEntry(node: AssertEntry, name: AssertionKey, value: Expression): AssertEntry; + /** @deprecated */ createImportTypeAssertionContainer(clause: AssertClause, multiLine?: boolean): ImportTypeAssertionContainer; + /** @deprecated */ updateImportTypeAssertionContainer(node: ImportTypeAssertionContainer, clause: AssertClause, multiLine?: boolean): ImportTypeAssertionContainer; + createImportAttributes(elements: NodeArray, multiLine?: boolean): ImportAttributes; + updateImportAttributes(node: ImportAttributes, elements: NodeArray, multiLine?: boolean): ImportAttributes; + createImportAttribute(name: ImportAttributeName, value: Expression): ImportAttribute; + updateImportAttribute(node: ImportAttribute, name: ImportAttributeName, value: Expression): ImportAttribute; createNamespaceImport(name: Identifier): NamespaceImport; updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport; createNamespaceExport(name: Identifier): NamespaceExport; @@ -8186,8 +8203,8 @@ declare namespace ts { updateImportSpecifier(node: ImportSpecifier, isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier; createExportAssignment(modifiers: readonly ModifierLike[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment; updateExportAssignment(node: ExportAssignment, modifiers: readonly ModifierLike[] | undefined, expression: Expression): ExportAssignment; - createExportDeclaration(modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, assertClause?: AssertClause): ExportDeclaration; - updateExportDeclaration(node: ExportDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, assertClause: AssertClause | undefined): ExportDeclaration; + createExportDeclaration(modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, attributes?: ImportAttributes): ExportDeclaration; + updateExportDeclaration(node: ExportDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, attributes: ImportAttributes | undefined): ExportDeclaration; createNamedExports(elements: readonly ExportSpecifier[]): NamedExports; updateNamedExports(node: NamedExports, elements: readonly ExportSpecifier[]): NamedExports; createExportSpecifier(isTypeOnly: boolean, propertyName: string | Identifier | undefined, name: string | Identifier): ExportSpecifier; @@ -8636,7 +8653,8 @@ declare namespace ts { ObjectBindingPatternElements = 525136, ArrayBindingPatternElements = 524880, ObjectLiteralExpressionProperties = 526226, - ImportClauseEntries = 526226, + ImportAttributes = 526226, + /** @deprecated */ ImportClauseEntries = 526226, ArrayLiteralExpressionElements = 8914, CommaListElements = 528, CallExpressionArguments = 2576, @@ -9094,8 +9112,8 @@ declare namespace ts { function isTypeOnlyImportDeclaration(node: Node): node is TypeOnlyImportDeclaration; function isTypeOnlyExportDeclaration(node: Node): node is TypeOnlyExportDeclaration; function isTypeOnlyImportOrExportDeclaration(node: Node): node is TypeOnlyAliasDeclaration; - function isAssertionKey(node: Node): node is AssertionKey; function isStringTextContainingNode(node: Node): node is StringLiteral | TemplateLiteralToken; + function isImportAttributeName(node: Node): node is ImportAttributeName; function isModifier(node: Node): node is Modifier; function isEntityName(node: Node): node is EntityName; function isPropertyName(node: Node): node is PropertyName; @@ -9397,8 +9415,12 @@ declare namespace ts { function isImportDeclaration(node: Node): node is ImportDeclaration; function isImportClause(node: Node): node is ImportClause; function isImportTypeAssertionContainer(node: Node): node is ImportTypeAssertionContainer; + /** @deprecated */ function isAssertClause(node: Node): node is AssertClause; + /** @deprecated */ function isAssertEntry(node: Node): node is AssertEntry; + function isImportAttributes(node: Node): node is ImportAttributes; + function isImportAttribute(node: Node): node is ImportAttribute; function isNamespaceImport(node: Node): node is NamespaceImport; function isNamespaceExport(node: Node): node is NamespaceExport; function isNamedImports(node: Node): node is NamedImports; diff --git a/tests/baselines/reference/completionImportAttributes.baseline b/tests/baselines/reference/completionImportAttributes.baseline new file mode 100644 index 0000000000000..7594f95cfc836 --- /dev/null +++ b/tests/baselines/reference/completionImportAttributes.baseline @@ -0,0 +1,272 @@ +=== /tests/cases/fourslash/main.ts === +// import("./other.json", {}); +// ^ +// | ---------------------------------------------------------------------- +// | (property) ImportCallOptions.with?: ImportAttributes +// | (property) ImportCallOptions.assert?: ImportAssertions +// | ---------------------------------------------------------------------- +// import("./other.json", { wi}); +// ^^ +// | ---------------------------------------------------------------------- +// | (property) ImportCallOptions.with?: ImportAttributes +// | (property) ImportCallOptions.assert?: ImportAssertions +// | ---------------------------------------------------------------------- + +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/main.ts", + "position": 24, + "name": "0" + }, + "item": { + "flags": 0, + "isGlobalCompletion": false, + "isMemberCompletion": true, + "isNewIdentifierLocation": false, + "entries": [ + { + "name": "with", + "kind": "property", + "kindModifiers": "declare,optional", + "sortText": "12", + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ImportCallOptions", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "with", + "kind": "propertyName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ImportAttributes", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "assert", + "kind": "property", + "kindModifiers": "deprecated,declare,optional", + "sortText": "z12", + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ImportCallOptions", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "assert", + "kind": "propertyName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ImportAssertions", + "kind": "interfaceName" + } + ], + "documentation": [], + "tags": [ + { + "name": "deprecated" + } + ] + } + ] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/main.ts", + "position": 55, + "name": "1" + }, + "item": { + "flags": 0, + "isGlobalCompletion": false, + "isMemberCompletion": true, + "isNewIdentifierLocation": false, + "optionalReplacementSpan": { + "start": 53, + "length": 2 + }, + "entries": [ + { + "name": "with", + "kind": "property", + "kindModifiers": "declare,optional", + "sortText": "12", + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ImportCallOptions", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "with", + "kind": "propertyName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ImportAttributes", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "assert", + "kind": "property", + "kindModifiers": "deprecated,declare,optional", + "sortText": "z12", + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ImportCallOptions", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "assert", + "kind": "propertyName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ImportAssertions", + "kind": "interfaceName" + } + ], + "documentation": [], + "tags": [ + { + "name": "deprecated" + } + ] + } + ] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/completionImportCallAssertion.baseline b/tests/baselines/reference/completionImportCallAssertion.baseline index a4c3b58bd0ebc..605d0485a0813 100644 --- a/tests/baselines/reference/completionImportCallAssertion.baseline +++ b/tests/baselines/reference/completionImportCallAssertion.baseline @@ -2,11 +2,13 @@ // import("./other.json", {}); // ^ // | ---------------------------------------------------------------------- +// | (property) ImportCallOptions.with?: ImportAttributes // | (property) ImportCallOptions.assert?: ImportAssertions // | ---------------------------------------------------------------------- // import("./other.json", { asse}); // ^^^^ // | ---------------------------------------------------------------------- +// | (property) ImportCallOptions.with?: ImportAttributes // | (property) ImportCallOptions.assert?: ImportAssertions // | ---------------------------------------------------------------------- @@ -24,10 +26,63 @@ "isNewIdentifierLocation": false, "entries": [ { - "name": "assert", + "name": "with", "kind": "property", "kindModifiers": "declare,optional", "sortText": "12", + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ImportCallOptions", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "with", + "kind": "propertyName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ImportAttributes", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "assert", + "kind": "property", + "kindModifiers": "deprecated,declare,optional", + "sortText": "z12", "displayParts": [ { "text": "(", @@ -74,7 +129,12 @@ "kind": "interfaceName" } ], - "documentation": [] + "documentation": [], + "tags": [ + { + "name": "deprecated" + } + ] } ] } @@ -96,10 +156,63 @@ }, "entries": [ { - "name": "assert", + "name": "with", "kind": "property", "kindModifiers": "declare,optional", "sortText": "12", + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ImportCallOptions", + "kind": "interfaceName" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "with", + "kind": "propertyName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ImportAttributes", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "assert", + "kind": "property", + "kindModifiers": "deprecated,declare,optional", + "sortText": "z12", "displayParts": [ { "text": "(", @@ -146,7 +259,12 @@ "kind": "interfaceName" } ], - "documentation": [] + "documentation": [], + "tags": [ + { + "name": "deprecated" + } + ] } ] } diff --git a/tests/baselines/reference/completionsImportWithKeyword.baseline b/tests/baselines/reference/completionsImportWithKeyword.baseline new file mode 100644 index 0000000000000..6c516ae03b07b --- /dev/null +++ b/tests/baselines/reference/completionsImportWithKeyword.baseline @@ -0,0 +1,25192 @@ +=== /tests/cases/fourslash/a.ts === +// const f = { +// a: 1 +// }; +// import * as thing from "thing" +// ^ +// | ---------------------------------------------------------------------- +// | const f: { +// | a: number; +// | } +// | import that +// | import thing +// | import those +// | abstract +// | any +// | interface Array +// | var Array: ArrayConstructor +// | interface ArrayBuffer +// | var ArrayBuffer: ArrayBufferConstructor +// | as +// | assert +// | asserts +// | async +// | await +// | bigint +// | boolean +// | interface Boolean +// | var Boolean: BooleanConstructor +// | break +// | case +// | catch +// | class +// | const +// | continue +// | interface DataView +// | var DataView: DataViewConstructor +// | interface Date +// | var Date: DateConstructor +// | debugger +// | declare +// | function decodeURI(encodedURI: string): string +// | function decodeURIComponent(encodedURIComponent: string): string +// | default +// | delete +// | do +// | else +// | function encodeURI(uri: string): string +// | function encodeURIComponent(uriComponent: string | number | boolean): string +// | enum +// | interface Error +// | var Error: ErrorConstructor +// | function eval(x: string): any +// | interface EvalError +// | var EvalError: EvalErrorConstructor +// | export +// | extends +// | false +// | finally +// | interface Float32Array +// | var Float32Array: Float32ArrayConstructor +// | interface Float64Array +// | var Float64Array: Float64ArrayConstructor +// | for +// | function +// | interface Function +// | var Function: FunctionConstructor +// | module globalThis +// | if +// | implements +// | import +// | in +// | infer +// | var Infinity: number +// | instanceof +// | interface Int16Array +// | var Int16Array: Int16ArrayConstructor +// | interface Int32Array +// | var Int32Array: Int32ArrayConstructor +// | interface Int8Array +// | var Int8Array: Int8ArrayConstructor +// | interface +// | namespace Intl +// | function isFinite(number: number): boolean +// | function isNaN(number: number): boolean +// | interface JSON +// | var JSON: JSON +// | keyof +// | let +// | interface Math +// | var Math: Math +// | module +// | namespace +// | var NaN: number +// | never +// | new +// | null +// | number +// | interface Number +// | var Number: NumberConstructor +// | object +// | interface Object +// | var Object: ObjectConstructor +// | package +// | function parseFloat(string: string): number +// | function parseInt(string: string, radix?: number): number +// | interface RangeError +// | var RangeError: RangeErrorConstructor +// | readonly +// | interface ReferenceError +// | var ReferenceError: ReferenceErrorConstructor +// | interface RegExp +// | var RegExp: RegExpConstructor +// | return +// | satisfies +// | string +// | interface String +// | var String: StringConstructor +// | super +// | switch +// | symbol +// | interface SyntaxError +// | var SyntaxError: SyntaxErrorConstructor +// | this +// | throw +// | true +// | try +// | type +// | interface TypeError +// | var TypeError: TypeErrorConstructor +// | typeof +// | interface Uint16Array +// | var Uint16Array: Uint16ArrayConstructor +// | interface Uint32Array +// | var Uint32Array: Uint32ArrayConstructor +// | interface Uint8Array +// | var Uint8Array: Uint8ArrayConstructor +// | interface Uint8ClampedArray +// | var Uint8ClampedArray: Uint8ClampedArrayConstructor +// | var undefined +// | unique +// | unknown +// | interface URIError +// | var URIError: URIErrorConstructor +// | var +// | void +// | while +// | with +// | yield +// | function escape(string: string): string +// | function unescape(string: string): string +// | ---------------------------------------------------------------------- +// export { foo } from "foo" +// ^ +// | ---------------------------------------------------------------------- +// | const f: { +// | a: number; +// | } +// | import that +// | import thing +// | import those +// | abstract +// | any +// | interface Array +// | var Array: ArrayConstructor +// | interface ArrayBuffer +// | var ArrayBuffer: ArrayBufferConstructor +// | as +// | assert +// | asserts +// | async +// | await +// | bigint +// | boolean +// | interface Boolean +// | var Boolean: BooleanConstructor +// | break +// | case +// | catch +// | class +// | const +// | continue +// | interface DataView +// | var DataView: DataViewConstructor +// | interface Date +// | var Date: DateConstructor +// | debugger +// | declare +// | function decodeURI(encodedURI: string): string +// | function decodeURIComponent(encodedURIComponent: string): string +// | default +// | delete +// | do +// | else +// | function encodeURI(uri: string): string +// | function encodeURIComponent(uriComponent: string | number | boolean): string +// | enum +// | interface Error +// | var Error: ErrorConstructor +// | function eval(x: string): any +// | interface EvalError +// | var EvalError: EvalErrorConstructor +// | export +// | extends +// | false +// | finally +// | interface Float32Array +// | var Float32Array: Float32ArrayConstructor +// | interface Float64Array +// | var Float64Array: Float64ArrayConstructor +// | for +// | function +// | interface Function +// | var Function: FunctionConstructor +// | module globalThis +// | if +// | implements +// | import +// | in +// | infer +// | var Infinity: number +// | instanceof +// | interface Int16Array +// | var Int16Array: Int16ArrayConstructor +// | interface Int32Array +// | var Int32Array: Int32ArrayConstructor +// | interface Int8Array +// | var Int8Array: Int8ArrayConstructor +// | interface +// | namespace Intl +// | function isFinite(number: number): boolean +// | function isNaN(number: number): boolean +// | interface JSON +// | var JSON: JSON +// | keyof +// | let +// | interface Math +// | var Math: Math +// | module +// | namespace +// | var NaN: number +// | never +// | new +// | null +// | number +// | interface Number +// | var Number: NumberConstructor +// | object +// | interface Object +// | var Object: ObjectConstructor +// | package +// | function parseFloat(string: string): number +// | function parseInt(string: string, radix?: number): number +// | interface RangeError +// | var RangeError: RangeErrorConstructor +// | readonly +// | interface ReferenceError +// | var ReferenceError: ReferenceErrorConstructor +// | interface RegExp +// | var RegExp: RegExpConstructor +// | return +// | satisfies +// | string +// | interface String +// | var String: StringConstructor +// | super +// | switch +// | symbol +// | interface SyntaxError +// | var SyntaxError: SyntaxErrorConstructor +// | this +// | throw +// | true +// | try +// | type +// | interface TypeError +// | var TypeError: TypeErrorConstructor +// | typeof +// | interface Uint16Array +// | var Uint16Array: Uint16ArrayConstructor +// | interface Uint32Array +// | var Uint32Array: Uint32ArrayConstructor +// | interface Uint8Array +// | var Uint8Array: Uint8ArrayConstructor +// | interface Uint8ClampedArray +// | var Uint8ClampedArray: Uint8ClampedArrayConstructor +// | var undefined +// | unique +// | unknown +// | interface URIError +// | var URIError: URIErrorConstructor +// | var +// | void +// | while +// | with +// | yield +// | function escape(string: string): string +// | function unescape(string: string): string +// | ---------------------------------------------------------------------- +// import "foo" as +// ^ +// | ---------------------------------------------------------------------- +// | const f: { +// | a: number; +// | } +// | import that +// | import thing +// | import those +// | abstract +// | any +// | interface Array +// | var Array: ArrayConstructor +// | interface ArrayBuffer +// | var ArrayBuffer: ArrayBufferConstructor +// | as +// | asserts +// | async +// | await +// | bigint +// | boolean +// | interface Boolean +// | var Boolean: BooleanConstructor +// | break +// | case +// | catch +// | class +// | const +// | continue +// | interface DataView +// | var DataView: DataViewConstructor +// | interface Date +// | var Date: DateConstructor +// | debugger +// | declare +// | function decodeURI(encodedURI: string): string +// | function decodeURIComponent(encodedURIComponent: string): string +// | default +// | delete +// | do +// | else +// | function encodeURI(uri: string): string +// | function encodeURIComponent(uriComponent: string | number | boolean): string +// | enum +// | interface Error +// | var Error: ErrorConstructor +// | function eval(x: string): any +// | interface EvalError +// | var EvalError: EvalErrorConstructor +// | export +// | extends +// | false +// | finally +// | interface Float32Array +// | var Float32Array: Float32ArrayConstructor +// | interface Float64Array +// | var Float64Array: Float64ArrayConstructor +// | for +// | function +// | interface Function +// | var Function: FunctionConstructor +// | module globalThis +// | if +// | implements +// | import +// | in +// | infer +// | var Infinity: number +// | instanceof +// | interface Int16Array +// | var Int16Array: Int16ArrayConstructor +// | interface Int32Array +// | var Int32Array: Int32ArrayConstructor +// | interface Int8Array +// | var Int8Array: Int8ArrayConstructor +// | interface +// | namespace Intl +// | function isFinite(number: number): boolean +// | function isNaN(number: number): boolean +// | interface JSON +// | var JSON: JSON +// | keyof +// | let +// | interface Math +// | var Math: Math +// | module +// | namespace +// | var NaN: number +// | never +// | new +// | null +// | number +// | interface Number +// | var Number: NumberConstructor +// | object +// | interface Object +// | var Object: ObjectConstructor +// | package +// | function parseFloat(string: string): number +// | function parseInt(string: string, radix?: number): number +// | interface RangeError +// | var RangeError: RangeErrorConstructor +// | readonly +// | interface ReferenceError +// | var ReferenceError: ReferenceErrorConstructor +// | interface RegExp +// | var RegExp: RegExpConstructor +// | return +// | satisfies +// | string +// | interface String +// | var String: StringConstructor +// | super +// | switch +// | symbol +// | interface SyntaxError +// | var SyntaxError: SyntaxErrorConstructor +// | this +// | throw +// | true +// | try +// | type +// | interface TypeError +// | var TypeError: TypeErrorConstructor +// | typeof +// | interface Uint16Array +// | var Uint16Array: Uint16ArrayConstructor +// | interface Uint32Array +// | var Uint32Array: Uint32ArrayConstructor +// | interface Uint8Array +// | var Uint8Array: Uint8ArrayConstructor +// | interface Uint8ClampedArray +// | var Uint8ClampedArray: Uint8ClampedArrayConstructor +// | var undefined +// | unique +// | unknown +// | interface URIError +// | var URIError: URIErrorConstructor +// | var +// | void +// | while +// | with +// | yield +// | function escape(string: string): string +// | function unescape(string: string): string +// | ---------------------------------------------------------------------- +// import "foo" w +// ^ +// | ---------------------------------------------------------------------- +// | const f: { +// | a: number; +// | } +// | import that +// | import thing +// | import those +// | abstract +// | any +// | interface Array +// | var Array: ArrayConstructor +// | interface ArrayBuffer +// | var ArrayBuffer: ArrayBufferConstructor +// | as +// | assert +// | asserts +// | async +// | await +// | bigint +// | boolean +// | interface Boolean +// | var Boolean: BooleanConstructor +// | break +// | case +// | catch +// | class +// | const +// | continue +// | interface DataView +// | var DataView: DataViewConstructor +// | interface Date +// | var Date: DateConstructor +// | debugger +// | declare +// | function decodeURI(encodedURI: string): string +// | function decodeURIComponent(encodedURIComponent: string): string +// | default +// | delete +// | do +// | else +// | function encodeURI(uri: string): string +// | function encodeURIComponent(uriComponent: string | number | boolean): string +// | enum +// | interface Error +// | var Error: ErrorConstructor +// | function eval(x: string): any +// | interface EvalError +// | var EvalError: EvalErrorConstructor +// | export +// | extends +// | false +// | finally +// | interface Float32Array +// | var Float32Array: Float32ArrayConstructor +// | interface Float64Array +// | var Float64Array: Float64ArrayConstructor +// | for +// | function +// | interface Function +// | var Function: FunctionConstructor +// | module globalThis +// | if +// | implements +// | import +// | in +// | infer +// | var Infinity: number +// | instanceof +// | interface Int16Array +// | var Int16Array: Int16ArrayConstructor +// | interface Int32Array +// | var Int32Array: Int32ArrayConstructor +// | interface Int8Array +// | var Int8Array: Int8ArrayConstructor +// | interface +// | namespace Intl +// | function isFinite(number: number): boolean +// | function isNaN(number: number): boolean +// | interface JSON +// | var JSON: JSON +// | keyof +// | let +// | interface Math +// | var Math: Math +// | module +// | namespace +// | var NaN: number +// | never +// | new +// | null +// | number +// | interface Number +// | var Number: NumberConstructor +// | object +// | interface Object +// | var Object: ObjectConstructor +// | package +// | function parseFloat(string: string): number +// | function parseInt(string: string, radix?: number): number +// | interface RangeError +// | var RangeError: RangeErrorConstructor +// | readonly +// | interface ReferenceError +// | var ReferenceError: ReferenceErrorConstructor +// | interface RegExp +// | var RegExp: RegExpConstructor +// | return +// | satisfies +// | string +// | interface String +// | var String: StringConstructor +// | super +// | switch +// | symbol +// | interface SyntaxError +// | var SyntaxError: SyntaxErrorConstructor +// | this +// | throw +// | true +// | try +// | type +// | interface TypeError +// | var TypeError: TypeErrorConstructor +// | typeof +// | interface Uint16Array +// | var Uint16Array: Uint16ArrayConstructor +// | interface Uint32Array +// | var Uint32Array: Uint32ArrayConstructor +// | interface Uint8Array +// | var Uint8Array: Uint8ArrayConstructor +// | interface Uint8ClampedArray +// | var Uint8ClampedArray: Uint8ClampedArrayConstructor +// | var undefined +// | unique +// | unknown +// | interface URIError +// | var URIError: URIErrorConstructor +// | var +// | void +// | while +// | with +// | yield +// | function escape(string: string): string +// | function unescape(string: string): string +// | ---------------------------------------------------------------------- +// import * as that from "that" +// +// ^ +// | ---------------------------------------------------------------------- +// | const f: { +// | a: number; +// | } +// | import that +// | import thing +// | import those +// | abstract +// | any +// | interface Array +// | var Array: ArrayConstructor +// | interface ArrayBuffer +// | var ArrayBuffer: ArrayBufferConstructor +// | as +// | asserts +// | async +// | await +// | bigint +// | boolean +// | interface Boolean +// | var Boolean: BooleanConstructor +// | break +// | case +// | catch +// | class +// | const +// | continue +// | interface DataView +// | var DataView: DataViewConstructor +// | interface Date +// | var Date: DateConstructor +// | debugger +// | declare +// | function decodeURI(encodedURI: string): string +// | function decodeURIComponent(encodedURIComponent: string): string +// | default +// | delete +// | do +// | else +// | function encodeURI(uri: string): string +// | function encodeURIComponent(uriComponent: string | number | boolean): string +// | enum +// | interface Error +// | var Error: ErrorConstructor +// | function eval(x: string): any +// | interface EvalError +// | var EvalError: EvalErrorConstructor +// | export +// | extends +// | false +// | finally +// | interface Float32Array +// | var Float32Array: Float32ArrayConstructor +// | interface Float64Array +// | var Float64Array: Float64ArrayConstructor +// | for +// | function +// | interface Function +// | var Function: FunctionConstructor +// | module globalThis +// | if +// | implements +// | import +// | in +// | infer +// | var Infinity: number +// | instanceof +// | interface Int16Array +// | var Int16Array: Int16ArrayConstructor +// | interface Int32Array +// | var Int32Array: Int32ArrayConstructor +// | interface Int8Array +// | var Int8Array: Int8ArrayConstructor +// | interface +// | namespace Intl +// | function isFinite(number: number): boolean +// | function isNaN(number: number): boolean +// | interface JSON +// | var JSON: JSON +// | keyof +// | let +// | interface Math +// | var Math: Math +// | module +// | namespace +// | var NaN: number +// | never +// | new +// | null +// | number +// | interface Number +// | var Number: NumberConstructor +// | object +// | interface Object +// | var Object: ObjectConstructor +// | package +// | function parseFloat(string: string): number +// | function parseInt(string: string, radix?: number): number +// | interface RangeError +// | var RangeError: RangeErrorConstructor +// | readonly +// | interface ReferenceError +// | var ReferenceError: ReferenceErrorConstructor +// | interface RegExp +// | var RegExp: RegExpConstructor +// | return +// | satisfies +// | string +// | interface String +// | var String: StringConstructor +// | super +// | switch +// | symbol +// | interface SyntaxError +// | var SyntaxError: SyntaxErrorConstructor +// | this +// | throw +// | true +// | try +// | type +// | interface TypeError +// | var TypeError: TypeErrorConstructor +// | typeof +// | interface Uint16Array +// | var Uint16Array: Uint16ArrayConstructor +// | interface Uint32Array +// | var Uint32Array: Uint32ArrayConstructor +// | interface Uint8Array +// | var Uint8Array: Uint8ArrayConstructor +// | interface Uint8ClampedArray +// | var Uint8ClampedArray: Uint8ClampedArrayConstructor +// | var undefined +// | unique +// | unknown +// | interface URIError +// | var URIError: URIErrorConstructor +// | var +// | void +// | while +// | with +// | yield +// | function escape(string: string): string +// | function unescape(string: string): string +// | ---------------------------------------------------------------------- +// import * as those from "those" +// ^ +// | ---------------------------------------------------------------------- +// | const f: { +// | a: number; +// | } +// | import that +// | import thing +// | import those +// | abstract +// | any +// | interface Array +// | var Array: ArrayConstructor +// | interface ArrayBuffer +// | var ArrayBuffer: ArrayBufferConstructor +// | as +// | asserts +// | async +// | await +// | bigint +// | boolean +// | interface Boolean +// | var Boolean: BooleanConstructor +// | break +// | case +// | catch +// | class +// | const +// | continue +// | interface DataView +// | var DataView: DataViewConstructor +// | interface Date +// | var Date: DateConstructor +// | debugger +// | declare +// | function decodeURI(encodedURI: string): string +// | function decodeURIComponent(encodedURIComponent: string): string +// | default +// | delete +// | do +// | else +// | function encodeURI(uri: string): string +// | function encodeURIComponent(uriComponent: string | number | boolean): string +// | enum +// | interface Error +// | var Error: ErrorConstructor +// | function eval(x: string): any +// | interface EvalError +// | var EvalError: EvalErrorConstructor +// | export +// | extends +// | false +// | finally +// | interface Float32Array +// | var Float32Array: Float32ArrayConstructor +// | interface Float64Array +// | var Float64Array: Float64ArrayConstructor +// | for +// | function +// | interface Function +// | var Function: FunctionConstructor +// | module globalThis +// | if +// | implements +// | import +// | in +// | infer +// | var Infinity: number +// | instanceof +// | interface Int16Array +// | var Int16Array: Int16ArrayConstructor +// | interface Int32Array +// | var Int32Array: Int32ArrayConstructor +// | interface Int8Array +// | var Int8Array: Int8ArrayConstructor +// | interface +// | namespace Intl +// | function isFinite(number: number): boolean +// | function isNaN(number: number): boolean +// | interface JSON +// | var JSON: JSON +// | keyof +// | let +// | interface Math +// | var Math: Math +// | module +// | namespace +// | var NaN: number +// | never +// | new +// | null +// | number +// | interface Number +// | var Number: NumberConstructor +// | object +// | interface Object +// | var Object: ObjectConstructor +// | package +// | function parseFloat(string: string): number +// | function parseInt(string: string, radix?: number): number +// | interface RangeError +// | var RangeError: RangeErrorConstructor +// | readonly +// | interface ReferenceError +// | var ReferenceError: ReferenceErrorConstructor +// | interface RegExp +// | var RegExp: RegExpConstructor +// | return +// | satisfies +// | string +// | interface String +// | var String: StringConstructor +// | super +// | switch +// | symbol +// | interface SyntaxError +// | var SyntaxError: SyntaxErrorConstructor +// | this +// | throw +// | true +// | try +// | type +// | interface TypeError +// | var TypeError: TypeErrorConstructor +// | typeof +// | interface Uint16Array +// | var Uint16Array: Uint16ArrayConstructor +// | interface Uint32Array +// | var Uint32Array: Uint32ArrayConstructor +// | interface Uint8Array +// | var Uint8Array: Uint8ArrayConstructor +// | interface Uint8ClampedArray +// | var Uint8ClampedArray: Uint8ClampedArrayConstructor +// | var undefined +// | unique +// | unknown +// | interface URIError +// | var URIError: URIErrorConstructor +// | var +// | void +// | while +// | with +// | yield +// | function escape(string: string): string +// | function unescape(string: string): string +// | ---------------------------------------------------------------------- + +=== /tests/cases/fourslash/b.js === +// import * as thing from "thing" ; +// ^ +// | ---------------------------------------------------------------------- +// | import thing +// | interface Array +// | var Array: ArrayConstructor +// | interface ArrayBuffer +// | var ArrayBuffer: ArrayBufferConstructor +// | as +// | assert +// | asserts +// | async +// | await +// | interface Boolean +// | var Boolean: BooleanConstructor +// | break +// | case +// | catch +// | class +// | const +// | continue +// | interface DataView +// | var DataView: DataViewConstructor +// | interface Date +// | var Date: DateConstructor +// | debugger +// | function decodeURI(encodedURI: string): string +// | function decodeURIComponent(encodedURIComponent: string): string +// | default +// | delete +// | do +// | else +// | function encodeURI(uri: string): string +// | function encodeURIComponent(uriComponent: string | number | boolean): string +// | interface Error +// | var Error: ErrorConstructor +// | function eval(x: string): any +// | interface EvalError +// | var EvalError: EvalErrorConstructor +// | export +// | extends +// | false +// | finally +// | interface Float32Array +// | var Float32Array: Float32ArrayConstructor +// | interface Float64Array +// | var Float64Array: Float64ArrayConstructor +// | for +// | function +// | interface Function +// | var Function: FunctionConstructor +// | module globalThis +// | if +// | import +// | in +// | var Infinity: number +// | instanceof +// | interface Int16Array +// | var Int16Array: Int16ArrayConstructor +// | interface Int32Array +// | var Int32Array: Int32ArrayConstructor +// | interface Int8Array +// | var Int8Array: Int8ArrayConstructor +// | namespace Intl +// | function isFinite(number: number): boolean +// | function isNaN(number: number): boolean +// | interface JSON +// | var JSON: JSON +// | let +// | interface Math +// | var Math: Math +// | var NaN: number +// | new +// | null +// | interface Number +// | var Number: NumberConstructor +// | interface Object +// | var Object: ObjectConstructor +// | package +// | function parseFloat(string: string): number +// | function parseInt(string: string, radix?: number): number +// | interface RangeError +// | var RangeError: RangeErrorConstructor +// | interface ReferenceError +// | var ReferenceError: ReferenceErrorConstructor +// | interface RegExp +// | var RegExp: RegExpConstructor +// | return +// | satisfies +// | interface String +// | var String: StringConstructor +// | super +// | switch +// | interface SyntaxError +// | var SyntaxError: SyntaxErrorConstructor +// | this +// | throw +// | true +// | try +// | interface TypeError +// | var TypeError: TypeErrorConstructor +// | typeof +// | interface Uint16Array +// | var Uint16Array: Uint16ArrayConstructor +// | interface Uint32Array +// | var Uint32Array: Uint32ArrayConstructor +// | interface Uint8Array +// | var Uint8Array: Uint8ArrayConstructor +// | interface Uint8ClampedArray +// | var Uint8ClampedArray: Uint8ClampedArrayConstructor +// | var undefined +// | interface URIError +// | var URIError: URIErrorConstructor +// | var +// | void +// | while +// | with +// | yield +// | function escape(string: string): string +// | function unescape(string: string): string +// | ---------------------------------------------------------------------- + +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/a.ts", + "position": 57, + "name": "0" + }, + "item": { + "flags": 0, + "isGlobalCompletion": true, + "isMemberCompletion": false, + "isNewIdentifierLocation": false, + "entries": [ + { + "name": "f", + "kind": "const", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + }, + { + "name": "that", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "that", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "thing", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "thing", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "those", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "those", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "abstract", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "abstract", + "kind": "keyword" + } + ] + }, + { + "name": "any", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "any", + "kind": "keyword" + } + ] + }, + { + "name": "Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "ArrayBuffer", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBufferConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Represents a raw buffer of binary data, which is used to store data for the\ndifferent typed arrays. ArrayBuffers cannot be read from or written to directly,\nbut can be passed to a typed array or DataView Object to interpret the raw\nbuffer as needed.", + "kind": "text" + } + ] + }, + { + "name": "as", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "as", + "kind": "keyword" + } + ] + }, + { + "name": "assert", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "assert", + "kind": "keyword" + } + ] + }, + { + "name": "asserts", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "asserts", + "kind": "keyword" + } + ] + }, + { + "name": "async", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "async", + "kind": "keyword" + } + ] + }, + { + "name": "await", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "await", + "kind": "keyword" + } + ] + }, + { + "name": "bigint", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "bigint", + "kind": "keyword" + } + ] + }, + { + "name": "boolean", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "boolean", + "kind": "keyword" + } + ] + }, + { + "name": "Boolean", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Boolean", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Boolean", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "BooleanConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "break", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "break", + "kind": "keyword" + } + ] + }, + { + "name": "case", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "case", + "kind": "keyword" + } + ] + }, + { + "name": "catch", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "catch", + "kind": "keyword" + } + ] + }, + { + "name": "class", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "class", + "kind": "keyword" + } + ] + }, + { + "name": "const", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "const", + "kind": "keyword" + } + ] + }, + { + "name": "continue", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "continue", + "kind": "keyword" + } + ] + }, + { + "name": "DataView", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataView", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataView", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataViewConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "Date", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Date", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Date", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DateConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Enables basic storage and retrieval of dates and times.", + "kind": "text" + } + ] + }, + { + "name": "debugger", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "debugger", + "kind": "keyword" + } + ] + }, + { + "name": "declare", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "declare", + "kind": "keyword" + } + ] + }, + { + "name": "decodeURI", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "decodeURI", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "encodedURI", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Gets the unencoded version of an encoded Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "encodedURI", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an encoded URI.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "decodeURIComponent", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "decodeURIComponent", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "encodedURIComponent", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "encodedURIComponent", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an encoded URI component.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "default", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "default", + "kind": "keyword" + } + ] + }, + { + "name": "delete", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "delete", + "kind": "keyword" + } + ] + }, + { + "name": "do", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "do", + "kind": "keyword" + } + ] + }, + { + "name": "else", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "else", + "kind": "keyword" + } + ] + }, + { + "name": "encodeURI", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "encodeURI", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "uri", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Encodes a text string as a valid Uniform Resource Identifier (URI)", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "uri", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an unencoded URI.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "encodeURIComponent", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "encodeURIComponent", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "uriComponent", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Encodes a text string as a valid component of a Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "uriComponent", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an unencoded URI component.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "enum", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + } + ] + }, + { + "name": "Error", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Error", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Error", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "eval", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eval", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Evaluates JavaScript code and executes it.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "x", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A String value that contains valid JavaScript code.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "EvalError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "export", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "export", + "kind": "keyword" + } + ] + }, + { + "name": "extends", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "extends", + "kind": "keyword" + } + ] + }, + { + "name": "false", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "false", + "kind": "keyword" + } + ] + }, + { + "name": "finally", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "finally", + "kind": "keyword" + } + ] + }, + { + "name": "Float32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit float values. The contents are initialized to 0. If the requested number\nof bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Float64Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 64-bit float values. The contents are initialized to 0. If the requested\nnumber of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "for", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "for", + "kind": "keyword" + } + ] + }, + { + "name": "function", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + } + ] + }, + { + "name": "Function", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Function", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Function", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "FunctionConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Creates a new function.", + "kind": "text" + } + ] + }, + { + "name": "globalThis", + "kind": "module", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "module", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalThis", + "kind": "moduleName" + } + ], + "documentation": [] + }, + { + "name": "if", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "if", + "kind": "keyword" + } + ] + }, + { + "name": "implements", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "implements", + "kind": "keyword" + } + ] + }, + { + "name": "import", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + } + ] + }, + { + "name": "in", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "in", + "kind": "keyword" + } + ] + }, + { + "name": "infer", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "infer", + "kind": "keyword" + } + ] + }, + { + "name": "Infinity", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Infinity", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + }, + { + "name": "instanceof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "instanceof", + "kind": "keyword" + } + ] + }, + { + "name": "Int16Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 16-bit signed integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Int32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit signed integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Int8Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit integer values. The contents are initialized to 0. If the requested\nnumber of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "interface", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + } + ] + }, + { + "name": "Intl", + "kind": "module", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Intl", + "kind": "moduleName" + } + ], + "documentation": [] + }, + { + "name": "isFinite", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "isFinite", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Determines whether a supplied number is finite.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "number", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Any numeric value.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "isNaN", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "isNaN", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "number", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A numeric value.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "JSON", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + } + ], + "documentation": [ + { + "text": "An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.", + "kind": "text" + } + ] + }, + { + "name": "keyof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "keyof", + "kind": "keyword" + } + ] + }, + { + "name": "let", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "let", + "kind": "keyword" + } + ] + }, + { + "name": "Math", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + } + ], + "documentation": [ + { + "text": "An intrinsic object that provides basic mathematics functionality and constants.", + "kind": "text" + } + ] + }, + { + "name": "module", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "module", + "kind": "keyword" + } + ] + }, + { + "name": "namespace", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + } + ] + }, + { + "name": "NaN", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "NaN", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + }, + { + "name": "never", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "never", + "kind": "keyword" + } + ] + }, + { + "name": "new", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "new", + "kind": "keyword" + } + ] + }, + { + "name": "null", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "null", + "kind": "keyword" + } + ] + }, + { + "name": "number", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "number", + "kind": "keyword" + } + ] + }, + { + "name": "Number", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Number", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Number", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "NumberConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers.", + "kind": "text" + } + ] + }, + { + "name": "object", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "object", + "kind": "keyword" + } + ] + }, + { + "name": "Object", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Object", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Object", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ObjectConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Provides functionality common to all JavaScript objects.", + "kind": "text" + } + ] + }, + { + "name": "package", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "package", + "kind": "keyword" + } + ] + }, + { + "name": "parseFloat", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "parseFloat", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Converts a string to a floating-point number.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string that contains a floating-point number.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "parseInt", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "parseInt", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "radix", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Converts a string to an integer.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string to convert into a number.", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "radix", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value between 2 and 36 that specifies the base of the number in `string`.\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\nAll other strings are considered decimal.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "RangeError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "readonly", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "readonly", + "kind": "keyword" + } + ] + }, + { + "name": "ReferenceError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "RegExp", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExp", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExp", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExpConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "return", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "return", + "kind": "keyword" + } + ] + }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, + { + "name": "string", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "string", + "kind": "keyword" + } + ] + }, + { + "name": "String", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "String", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "String", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "StringConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "kind": "text" + } + ] + }, + { + "name": "super", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "super", + "kind": "keyword" + } + ] + }, + { + "name": "switch", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "switch", + "kind": "keyword" + } + ] + }, + { + "name": "symbol", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "symbol", + "kind": "keyword" + } + ] + }, + { + "name": "SyntaxError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "this", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "this", + "kind": "keyword" + } + ] + }, + { + "name": "throw", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "throw", + "kind": "keyword" + } + ] + }, + { + "name": "true", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "true", + "kind": "keyword" + } + ] + }, + { + "name": "try", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "try", + "kind": "keyword" + } + ] + }, + { + "name": "type", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "type", + "kind": "keyword" + } + ] + }, + { + "name": "TypeError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "typeof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "typeof", + "kind": "keyword" + } + ] + }, + { + "name": "Uint16Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint8Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint8ClampedArray", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArray", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArray", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.\nIf the requested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "undefined", + "kind": "var", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "propertyName" + } + ], + "documentation": [] + }, + { + "name": "unique", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "unique", + "kind": "keyword" + } + ] + }, + { + "name": "unknown", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "unknown", + "kind": "keyword" + } + ] + }, + { + "name": "URIError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "var", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + } + ] + }, + { + "name": "void", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "void", + "kind": "keyword" + } + ] + }, + { + "name": "while", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "while", + "kind": "keyword" + } + ] + }, + { + "name": "with", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "with", + "kind": "keyword" + } + ] + }, + { + "name": "yield", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "yield", + "kind": "keyword" + } + ] + }, + { + "name": "escape", + "kind": "function", + "kindModifiers": "deprecated,declare", + "sortText": "z15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "escape", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.", + "kind": "text" + } + ], + "tags": [ + { + "name": "deprecated", + "text": [ + { + "text": "A legacy feature for browser compatibility", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string value", + "kind": "text" + } + ] + } + ] + }, + { + "name": "unescape", + "kind": "function", + "kindModifiers": "deprecated,declare", + "sortText": "z15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "unescape", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.", + "kind": "text" + } + ], + "tags": [ + { + "name": "deprecated", + "text": [ + { + "text": "A legacy feature for browser compatibility", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string value", + "kind": "text" + } + ] + } + ] + } + ] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/a.ts", + "position": 85, + "name": "1" + }, + "item": { + "flags": 0, + "isGlobalCompletion": true, + "isMemberCompletion": false, + "isNewIdentifierLocation": false, + "entries": [ + { + "name": "f", + "kind": "const", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + }, + { + "name": "that", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "that", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "thing", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "thing", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "those", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "those", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "abstract", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "abstract", + "kind": "keyword" + } + ] + }, + { + "name": "any", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "any", + "kind": "keyword" + } + ] + }, + { + "name": "Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "ArrayBuffer", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBufferConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Represents a raw buffer of binary data, which is used to store data for the\ndifferent typed arrays. ArrayBuffers cannot be read from or written to directly,\nbut can be passed to a typed array or DataView Object to interpret the raw\nbuffer as needed.", + "kind": "text" + } + ] + }, + { + "name": "as", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "as", + "kind": "keyword" + } + ] + }, + { + "name": "assert", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "assert", + "kind": "keyword" + } + ] + }, + { + "name": "asserts", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "asserts", + "kind": "keyword" + } + ] + }, + { + "name": "async", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "async", + "kind": "keyword" + } + ] + }, + { + "name": "await", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "await", + "kind": "keyword" + } + ] + }, + { + "name": "bigint", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "bigint", + "kind": "keyword" + } + ] + }, + { + "name": "boolean", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "boolean", + "kind": "keyword" + } + ] + }, + { + "name": "Boolean", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Boolean", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Boolean", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "BooleanConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "break", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "break", + "kind": "keyword" + } + ] + }, + { + "name": "case", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "case", + "kind": "keyword" + } + ] + }, + { + "name": "catch", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "catch", + "kind": "keyword" + } + ] + }, + { + "name": "class", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "class", + "kind": "keyword" + } + ] + }, + { + "name": "const", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "const", + "kind": "keyword" + } + ] + }, + { + "name": "continue", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "continue", + "kind": "keyword" + } + ] + }, + { + "name": "DataView", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataView", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataView", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataViewConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "Date", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Date", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Date", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DateConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Enables basic storage and retrieval of dates and times.", + "kind": "text" + } + ] + }, + { + "name": "debugger", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "debugger", + "kind": "keyword" + } + ] + }, + { + "name": "declare", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "declare", + "kind": "keyword" + } + ] + }, + { + "name": "decodeURI", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "decodeURI", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "encodedURI", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Gets the unencoded version of an encoded Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "encodedURI", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an encoded URI.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "decodeURIComponent", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "decodeURIComponent", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "encodedURIComponent", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "encodedURIComponent", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an encoded URI component.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "default", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "default", + "kind": "keyword" + } + ] + }, + { + "name": "delete", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "delete", + "kind": "keyword" + } + ] + }, + { + "name": "do", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "do", + "kind": "keyword" + } + ] + }, + { + "name": "else", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "else", + "kind": "keyword" + } + ] + }, + { + "name": "encodeURI", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "encodeURI", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "uri", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Encodes a text string as a valid Uniform Resource Identifier (URI)", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "uri", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an unencoded URI.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "encodeURIComponent", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "encodeURIComponent", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "uriComponent", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Encodes a text string as a valid component of a Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "uriComponent", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an unencoded URI component.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "enum", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + } + ] + }, + { + "name": "Error", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Error", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Error", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "eval", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eval", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Evaluates JavaScript code and executes it.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "x", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A String value that contains valid JavaScript code.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "EvalError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "export", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "export", + "kind": "keyword" + } + ] + }, + { + "name": "extends", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "extends", + "kind": "keyword" + } + ] + }, + { + "name": "false", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "false", + "kind": "keyword" + } + ] + }, + { + "name": "finally", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "finally", + "kind": "keyword" + } + ] + }, + { + "name": "Float32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit float values. The contents are initialized to 0. If the requested number\nof bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Float64Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 64-bit float values. The contents are initialized to 0. If the requested\nnumber of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "for", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "for", + "kind": "keyword" + } + ] + }, + { + "name": "function", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + } + ] + }, + { + "name": "Function", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Function", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Function", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "FunctionConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Creates a new function.", + "kind": "text" + } + ] + }, + { + "name": "globalThis", + "kind": "module", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "module", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalThis", + "kind": "moduleName" + } + ], + "documentation": [] + }, + { + "name": "if", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "if", + "kind": "keyword" + } + ] + }, + { + "name": "implements", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "implements", + "kind": "keyword" + } + ] + }, + { + "name": "import", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + } + ] + }, + { + "name": "in", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "in", + "kind": "keyword" + } + ] + }, + { + "name": "infer", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "infer", + "kind": "keyword" + } + ] + }, + { + "name": "Infinity", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Infinity", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + }, + { + "name": "instanceof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "instanceof", + "kind": "keyword" + } + ] + }, + { + "name": "Int16Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 16-bit signed integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Int32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit signed integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Int8Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit integer values. The contents are initialized to 0. If the requested\nnumber of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "interface", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + } + ] + }, + { + "name": "Intl", + "kind": "module", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Intl", + "kind": "moduleName" + } + ], + "documentation": [] + }, + { + "name": "isFinite", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "isFinite", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Determines whether a supplied number is finite.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "number", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Any numeric value.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "isNaN", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "isNaN", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "number", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A numeric value.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "JSON", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + } + ], + "documentation": [ + { + "text": "An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.", + "kind": "text" + } + ] + }, + { + "name": "keyof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "keyof", + "kind": "keyword" + } + ] + }, + { + "name": "let", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "let", + "kind": "keyword" + } + ] + }, + { + "name": "Math", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + } + ], + "documentation": [ + { + "text": "An intrinsic object that provides basic mathematics functionality and constants.", + "kind": "text" + } + ] + }, + { + "name": "module", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "module", + "kind": "keyword" + } + ] + }, + { + "name": "namespace", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + } + ] + }, + { + "name": "NaN", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "NaN", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + }, + { + "name": "never", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "never", + "kind": "keyword" + } + ] + }, + { + "name": "new", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "new", + "kind": "keyword" + } + ] + }, + { + "name": "null", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "null", + "kind": "keyword" + } + ] + }, + { + "name": "number", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "number", + "kind": "keyword" + } + ] + }, + { + "name": "Number", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Number", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Number", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "NumberConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers.", + "kind": "text" + } + ] + }, + { + "name": "object", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "object", + "kind": "keyword" + } + ] + }, + { + "name": "Object", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Object", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Object", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ObjectConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Provides functionality common to all JavaScript objects.", + "kind": "text" + } + ] + }, + { + "name": "package", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "package", + "kind": "keyword" + } + ] + }, + { + "name": "parseFloat", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "parseFloat", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Converts a string to a floating-point number.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string that contains a floating-point number.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "parseInt", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "parseInt", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "radix", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Converts a string to an integer.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string to convert into a number.", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "radix", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value between 2 and 36 that specifies the base of the number in `string`.\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\nAll other strings are considered decimal.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "RangeError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "readonly", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "readonly", + "kind": "keyword" + } + ] + }, + { + "name": "ReferenceError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "RegExp", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExp", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExp", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExpConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "return", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "return", + "kind": "keyword" + } + ] + }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, + { + "name": "string", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "string", + "kind": "keyword" + } + ] + }, + { + "name": "String", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "String", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "String", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "StringConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "kind": "text" + } + ] + }, + { + "name": "super", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "super", + "kind": "keyword" + } + ] + }, + { + "name": "switch", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "switch", + "kind": "keyword" + } + ] + }, + { + "name": "symbol", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "symbol", + "kind": "keyword" + } + ] + }, + { + "name": "SyntaxError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "this", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "this", + "kind": "keyword" + } + ] + }, + { + "name": "throw", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "throw", + "kind": "keyword" + } + ] + }, + { + "name": "true", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "true", + "kind": "keyword" + } + ] + }, + { + "name": "try", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "try", + "kind": "keyword" + } + ] + }, + { + "name": "type", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "type", + "kind": "keyword" + } + ] + }, + { + "name": "TypeError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "typeof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "typeof", + "kind": "keyword" + } + ] + }, + { + "name": "Uint16Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint8Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint8ClampedArray", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArray", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArray", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.\nIf the requested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "undefined", + "kind": "var", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "propertyName" + } + ], + "documentation": [] + }, + { + "name": "unique", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "unique", + "kind": "keyword" + } + ] + }, + { + "name": "unknown", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "unknown", + "kind": "keyword" + } + ] + }, + { + "name": "URIError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "var", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + } + ] + }, + { + "name": "void", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "void", + "kind": "keyword" + } + ] + }, + { + "name": "while", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "while", + "kind": "keyword" + } + ] + }, + { + "name": "with", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "with", + "kind": "keyword" + } + ] + }, + { + "name": "yield", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "yield", + "kind": "keyword" + } + ] + }, + { + "name": "escape", + "kind": "function", + "kindModifiers": "deprecated,declare", + "sortText": "z15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "escape", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.", + "kind": "text" + } + ], + "tags": [ + { + "name": "deprecated", + "text": [ + { + "text": "A legacy feature for browser compatibility", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string value", + "kind": "text" + } + ] + } + ] + }, + { + "name": "unescape", + "kind": "function", + "kindModifiers": "deprecated,declare", + "sortText": "z15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "unescape", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.", + "kind": "text" + } + ], + "tags": [ + { + "name": "deprecated", + "text": [ + { + "text": "A legacy feature for browser compatibility", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string value", + "kind": "text" + } + ] + } + ] + } + ] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/a.ts", + "position": 103, + "name": "2" + }, + "item": { + "flags": 0, + "isGlobalCompletion": true, + "isMemberCompletion": false, + "isNewIdentifierLocation": false, + "entries": [ + { + "name": "f", + "kind": "const", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + }, + { + "name": "that", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "that", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "thing", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "thing", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "those", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "those", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "abstract", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "abstract", + "kind": "keyword" + } + ] + }, + { + "name": "any", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "any", + "kind": "keyword" + } + ] + }, + { + "name": "Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "ArrayBuffer", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBufferConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Represents a raw buffer of binary data, which is used to store data for the\ndifferent typed arrays. ArrayBuffers cannot be read from or written to directly,\nbut can be passed to a typed array or DataView Object to interpret the raw\nbuffer as needed.", + "kind": "text" + } + ] + }, + { + "name": "as", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "as", + "kind": "keyword" + } + ] + }, + { + "name": "asserts", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "asserts", + "kind": "keyword" + } + ] + }, + { + "name": "async", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "async", + "kind": "keyword" + } + ] + }, + { + "name": "await", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "await", + "kind": "keyword" + } + ] + }, + { + "name": "bigint", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "bigint", + "kind": "keyword" + } + ] + }, + { + "name": "boolean", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "boolean", + "kind": "keyword" + } + ] + }, + { + "name": "Boolean", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Boolean", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Boolean", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "BooleanConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "break", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "break", + "kind": "keyword" + } + ] + }, + { + "name": "case", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "case", + "kind": "keyword" + } + ] + }, + { + "name": "catch", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "catch", + "kind": "keyword" + } + ] + }, + { + "name": "class", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "class", + "kind": "keyword" + } + ] + }, + { + "name": "const", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "const", + "kind": "keyword" + } + ] + }, + { + "name": "continue", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "continue", + "kind": "keyword" + } + ] + }, + { + "name": "DataView", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataView", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataView", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataViewConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "Date", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Date", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Date", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DateConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Enables basic storage and retrieval of dates and times.", + "kind": "text" + } + ] + }, + { + "name": "debugger", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "debugger", + "kind": "keyword" + } + ] + }, + { + "name": "declare", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "declare", + "kind": "keyword" + } + ] + }, + { + "name": "decodeURI", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "decodeURI", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "encodedURI", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Gets the unencoded version of an encoded Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "encodedURI", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an encoded URI.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "decodeURIComponent", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "decodeURIComponent", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "encodedURIComponent", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "encodedURIComponent", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an encoded URI component.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "default", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "default", + "kind": "keyword" + } + ] + }, + { + "name": "delete", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "delete", + "kind": "keyword" + } + ] + }, + { + "name": "do", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "do", + "kind": "keyword" + } + ] + }, + { + "name": "else", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "else", + "kind": "keyword" + } + ] + }, + { + "name": "encodeURI", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "encodeURI", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "uri", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Encodes a text string as a valid Uniform Resource Identifier (URI)", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "uri", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an unencoded URI.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "encodeURIComponent", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "encodeURIComponent", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "uriComponent", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Encodes a text string as a valid component of a Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "uriComponent", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an unencoded URI component.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "enum", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + } + ] + }, + { + "name": "Error", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Error", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Error", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "eval", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eval", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Evaluates JavaScript code and executes it.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "x", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A String value that contains valid JavaScript code.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "EvalError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "export", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "export", + "kind": "keyword" + } + ] + }, + { + "name": "extends", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "extends", + "kind": "keyword" + } + ] + }, + { + "name": "false", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "false", + "kind": "keyword" + } + ] + }, + { + "name": "finally", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "finally", + "kind": "keyword" + } + ] + }, + { + "name": "Float32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit float values. The contents are initialized to 0. If the requested number\nof bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Float64Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 64-bit float values. The contents are initialized to 0. If the requested\nnumber of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "for", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "for", + "kind": "keyword" + } + ] + }, + { + "name": "function", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + } + ] + }, + { + "name": "Function", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Function", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Function", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "FunctionConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Creates a new function.", + "kind": "text" + } + ] + }, + { + "name": "globalThis", + "kind": "module", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "module", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalThis", + "kind": "moduleName" + } + ], + "documentation": [] + }, + { + "name": "if", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "if", + "kind": "keyword" + } + ] + }, + { + "name": "implements", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "implements", + "kind": "keyword" + } + ] + }, + { + "name": "import", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + } + ] + }, + { + "name": "in", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "in", + "kind": "keyword" + } + ] + }, + { + "name": "infer", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "infer", + "kind": "keyword" + } + ] + }, + { + "name": "Infinity", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Infinity", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + }, + { + "name": "instanceof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "instanceof", + "kind": "keyword" + } + ] + }, + { + "name": "Int16Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 16-bit signed integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Int32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit signed integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Int8Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit integer values. The contents are initialized to 0. If the requested\nnumber of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "interface", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + } + ] + }, + { + "name": "Intl", + "kind": "module", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Intl", + "kind": "moduleName" + } + ], + "documentation": [] + }, + { + "name": "isFinite", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "isFinite", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Determines whether a supplied number is finite.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "number", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Any numeric value.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "isNaN", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "isNaN", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "number", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A numeric value.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "JSON", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + } + ], + "documentation": [ + { + "text": "An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.", + "kind": "text" + } + ] + }, + { + "name": "keyof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "keyof", + "kind": "keyword" + } + ] + }, + { + "name": "let", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "let", + "kind": "keyword" + } + ] + }, + { + "name": "Math", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + } + ], + "documentation": [ + { + "text": "An intrinsic object that provides basic mathematics functionality and constants.", + "kind": "text" + } + ] + }, + { + "name": "module", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "module", + "kind": "keyword" + } + ] + }, + { + "name": "namespace", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + } + ] + }, + { + "name": "NaN", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "NaN", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + }, + { + "name": "never", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "never", + "kind": "keyword" + } + ] + }, + { + "name": "new", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "new", + "kind": "keyword" + } + ] + }, + { + "name": "null", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "null", + "kind": "keyword" + } + ] + }, + { + "name": "number", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "number", + "kind": "keyword" + } + ] + }, + { + "name": "Number", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Number", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Number", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "NumberConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers.", + "kind": "text" + } + ] + }, + { + "name": "object", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "object", + "kind": "keyword" + } + ] + }, + { + "name": "Object", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Object", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Object", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ObjectConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Provides functionality common to all JavaScript objects.", + "kind": "text" + } + ] + }, + { + "name": "package", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "package", + "kind": "keyword" + } + ] + }, + { + "name": "parseFloat", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "parseFloat", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Converts a string to a floating-point number.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string that contains a floating-point number.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "parseInt", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "parseInt", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "radix", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Converts a string to an integer.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string to convert into a number.", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "radix", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value between 2 and 36 that specifies the base of the number in `string`.\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\nAll other strings are considered decimal.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "RangeError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "readonly", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "readonly", + "kind": "keyword" + } + ] + }, + { + "name": "ReferenceError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "RegExp", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExp", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExp", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExpConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "return", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "return", + "kind": "keyword" + } + ] + }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, + { + "name": "string", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "string", + "kind": "keyword" + } + ] + }, + { + "name": "String", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "String", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "String", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "StringConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "kind": "text" + } + ] + }, + { + "name": "super", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "super", + "kind": "keyword" + } + ] + }, + { + "name": "switch", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "switch", + "kind": "keyword" + } + ] + }, + { + "name": "symbol", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "symbol", + "kind": "keyword" + } + ] + }, + { + "name": "SyntaxError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "this", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "this", + "kind": "keyword" + } + ] + }, + { + "name": "throw", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "throw", + "kind": "keyword" + } + ] + }, + { + "name": "true", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "true", + "kind": "keyword" + } + ] + }, + { + "name": "try", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "try", + "kind": "keyword" + } + ] + }, + { + "name": "type", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "type", + "kind": "keyword" + } + ] + }, + { + "name": "TypeError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "typeof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "typeof", + "kind": "keyword" + } + ] + }, + { + "name": "Uint16Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint8Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint8ClampedArray", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArray", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArray", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.\nIf the requested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "undefined", + "kind": "var", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "propertyName" + } + ], + "documentation": [] + }, + { + "name": "unique", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "unique", + "kind": "keyword" + } + ] + }, + { + "name": "unknown", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "unknown", + "kind": "keyword" + } + ] + }, + { + "name": "URIError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "var", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + } + ] + }, + { + "name": "void", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "void", + "kind": "keyword" + } + ] + }, + { + "name": "while", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "while", + "kind": "keyword" + } + ] + }, + { + "name": "with", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "with", + "kind": "keyword" + } + ] + }, + { + "name": "yield", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "yield", + "kind": "keyword" + } + ] + }, + { + "name": "escape", + "kind": "function", + "kindModifiers": "deprecated,declare", + "sortText": "z15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "escape", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.", + "kind": "text" + } + ], + "tags": [ + { + "name": "deprecated", + "text": [ + { + "text": "A legacy feature for browser compatibility", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string value", + "kind": "text" + } + ] + } + ] + }, + { + "name": "unescape", + "kind": "function", + "kindModifiers": "deprecated,declare", + "sortText": "z15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "unescape", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.", + "kind": "text" + } + ], + "tags": [ + { + "name": "deprecated", + "text": [ + { + "text": "A legacy feature for browser compatibility", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string value", + "kind": "text" + } + ] + } + ] + } + ] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/a.ts", + "position": 119, + "name": "3" + }, + "item": { + "flags": 0, + "isGlobalCompletion": true, + "isMemberCompletion": false, + "isNewIdentifierLocation": false, + "optionalReplacementSpan": { + "start": 118, + "length": 1 + }, + "entries": [ + { + "name": "f", + "kind": "const", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + }, + { + "name": "that", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "that", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "thing", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "thing", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "those", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "those", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "abstract", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "abstract", + "kind": "keyword" + } + ] + }, + { + "name": "any", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "any", + "kind": "keyword" + } + ] + }, + { + "name": "Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "ArrayBuffer", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBufferConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Represents a raw buffer of binary data, which is used to store data for the\ndifferent typed arrays. ArrayBuffers cannot be read from or written to directly,\nbut can be passed to a typed array or DataView Object to interpret the raw\nbuffer as needed.", + "kind": "text" + } + ] + }, + { + "name": "as", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "as", + "kind": "keyword" + } + ] + }, + { + "name": "assert", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "assert", + "kind": "keyword" + } + ] + }, + { + "name": "asserts", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "asserts", + "kind": "keyword" + } + ] + }, + { + "name": "async", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "async", + "kind": "keyword" + } + ] + }, + { + "name": "await", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "await", + "kind": "keyword" + } + ] + }, + { + "name": "bigint", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "bigint", + "kind": "keyword" + } + ] + }, + { + "name": "boolean", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "boolean", + "kind": "keyword" + } + ] + }, + { + "name": "Boolean", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Boolean", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Boolean", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "BooleanConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "break", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "break", + "kind": "keyword" + } + ] + }, + { + "name": "case", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "case", + "kind": "keyword" + } + ] + }, + { + "name": "catch", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "catch", + "kind": "keyword" + } + ] + }, + { + "name": "class", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "class", + "kind": "keyword" + } + ] + }, + { + "name": "const", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "const", + "kind": "keyword" + } + ] + }, + { + "name": "continue", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "continue", + "kind": "keyword" + } + ] + }, + { + "name": "DataView", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataView", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataView", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataViewConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "Date", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Date", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Date", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DateConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Enables basic storage and retrieval of dates and times.", + "kind": "text" + } + ] + }, + { + "name": "debugger", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "debugger", + "kind": "keyword" + } + ] + }, + { + "name": "declare", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "declare", + "kind": "keyword" + } + ] + }, + { + "name": "decodeURI", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "decodeURI", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "encodedURI", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Gets the unencoded version of an encoded Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "encodedURI", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an encoded URI.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "decodeURIComponent", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "decodeURIComponent", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "encodedURIComponent", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "encodedURIComponent", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an encoded URI component.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "default", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "default", + "kind": "keyword" + } + ] + }, + { + "name": "delete", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "delete", + "kind": "keyword" + } + ] + }, + { + "name": "do", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "do", + "kind": "keyword" + } + ] + }, + { + "name": "else", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "else", + "kind": "keyword" + } + ] + }, + { + "name": "encodeURI", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "encodeURI", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "uri", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Encodes a text string as a valid Uniform Resource Identifier (URI)", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "uri", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an unencoded URI.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "encodeURIComponent", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "encodeURIComponent", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "uriComponent", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Encodes a text string as a valid component of a Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "uriComponent", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an unencoded URI component.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "enum", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + } + ] + }, + { + "name": "Error", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Error", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Error", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "eval", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eval", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Evaluates JavaScript code and executes it.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "x", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A String value that contains valid JavaScript code.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "EvalError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "export", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "export", + "kind": "keyword" + } + ] + }, + { + "name": "extends", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "extends", + "kind": "keyword" + } + ] + }, + { + "name": "false", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "false", + "kind": "keyword" + } + ] + }, + { + "name": "finally", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "finally", + "kind": "keyword" + } + ] + }, + { + "name": "Float32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit float values. The contents are initialized to 0. If the requested number\nof bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Float64Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 64-bit float values. The contents are initialized to 0. If the requested\nnumber of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "for", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "for", + "kind": "keyword" + } + ] + }, + { + "name": "function", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + } + ] + }, + { + "name": "Function", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Function", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Function", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "FunctionConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Creates a new function.", + "kind": "text" + } + ] + }, + { + "name": "globalThis", + "kind": "module", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "module", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalThis", + "kind": "moduleName" + } + ], + "documentation": [] + }, + { + "name": "if", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "if", + "kind": "keyword" + } + ] + }, + { + "name": "implements", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "implements", + "kind": "keyword" + } + ] + }, + { + "name": "import", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + } + ] + }, + { + "name": "in", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "in", + "kind": "keyword" + } + ] + }, + { + "name": "infer", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "infer", + "kind": "keyword" + } + ] + }, + { + "name": "Infinity", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Infinity", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + }, + { + "name": "instanceof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "instanceof", + "kind": "keyword" + } + ] + }, + { + "name": "Int16Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 16-bit signed integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Int32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit signed integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Int8Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit integer values. The contents are initialized to 0. If the requested\nnumber of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "interface", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + } + ] + }, + { + "name": "Intl", + "kind": "module", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Intl", + "kind": "moduleName" + } + ], + "documentation": [] + }, + { + "name": "isFinite", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "isFinite", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Determines whether a supplied number is finite.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "number", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Any numeric value.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "isNaN", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "isNaN", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "number", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A numeric value.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "JSON", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + } + ], + "documentation": [ + { + "text": "An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.", + "kind": "text" + } + ] + }, + { + "name": "keyof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "keyof", + "kind": "keyword" + } + ] + }, + { + "name": "let", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "let", + "kind": "keyword" + } + ] + }, + { + "name": "Math", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + } + ], + "documentation": [ + { + "text": "An intrinsic object that provides basic mathematics functionality and constants.", + "kind": "text" + } + ] + }, + { + "name": "module", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "module", + "kind": "keyword" + } + ] + }, + { + "name": "namespace", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + } + ] + }, + { + "name": "NaN", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "NaN", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + }, + { + "name": "never", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "never", + "kind": "keyword" + } + ] + }, + { + "name": "new", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "new", + "kind": "keyword" + } + ] + }, + { + "name": "null", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "null", + "kind": "keyword" + } + ] + }, + { + "name": "number", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "number", + "kind": "keyword" + } + ] + }, + { + "name": "Number", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Number", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Number", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "NumberConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers.", + "kind": "text" + } + ] + }, + { + "name": "object", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "object", + "kind": "keyword" + } + ] + }, + { + "name": "Object", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Object", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Object", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ObjectConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Provides functionality common to all JavaScript objects.", + "kind": "text" + } + ] + }, + { + "name": "package", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "package", + "kind": "keyword" + } + ] + }, + { + "name": "parseFloat", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "parseFloat", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Converts a string to a floating-point number.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string that contains a floating-point number.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "parseInt", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "parseInt", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "radix", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Converts a string to an integer.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string to convert into a number.", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "radix", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value between 2 and 36 that specifies the base of the number in `string`.\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\nAll other strings are considered decimal.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "RangeError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "readonly", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "readonly", + "kind": "keyword" + } + ] + }, + { + "name": "ReferenceError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "RegExp", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExp", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExp", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExpConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "return", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "return", + "kind": "keyword" + } + ] + }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, + { + "name": "string", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "string", + "kind": "keyword" + } + ] + }, + { + "name": "String", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "String", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "String", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "StringConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "kind": "text" + } + ] + }, + { + "name": "super", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "super", + "kind": "keyword" + } + ] + }, + { + "name": "switch", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "switch", + "kind": "keyword" + } + ] + }, + { + "name": "symbol", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "symbol", + "kind": "keyword" + } + ] + }, + { + "name": "SyntaxError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "this", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "this", + "kind": "keyword" + } + ] + }, + { + "name": "throw", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "throw", + "kind": "keyword" + } + ] + }, + { + "name": "true", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "true", + "kind": "keyword" + } + ] + }, + { + "name": "try", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "try", + "kind": "keyword" + } + ] + }, + { + "name": "type", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "type", + "kind": "keyword" + } + ] + }, + { + "name": "TypeError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "typeof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "typeof", + "kind": "keyword" + } + ] + }, + { + "name": "Uint16Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint8Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint8ClampedArray", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArray", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArray", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.\nIf the requested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "undefined", + "kind": "var", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "propertyName" + } + ], + "documentation": [] + }, + { + "name": "unique", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "unique", + "kind": "keyword" + } + ] + }, + { + "name": "unknown", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "unknown", + "kind": "keyword" + } + ] + }, + { + "name": "URIError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "var", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + } + ] + }, + { + "name": "void", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "void", + "kind": "keyword" + } + ] + }, + { + "name": "while", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "while", + "kind": "keyword" + } + ] + }, + { + "name": "with", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "with", + "kind": "keyword" + } + ] + }, + { + "name": "yield", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "yield", + "kind": "keyword" + } + ] + }, + { + "name": "escape", + "kind": "function", + "kindModifiers": "deprecated,declare", + "sortText": "z15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "escape", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.", + "kind": "text" + } + ], + "tags": [ + { + "name": "deprecated", + "text": [ + { + "text": "A legacy feature for browser compatibility", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string value", + "kind": "text" + } + ] + } + ] + }, + { + "name": "unescape", + "kind": "function", + "kindModifiers": "deprecated,declare", + "sortText": "z15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "unescape", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.", + "kind": "text" + } + ], + "tags": [ + { + "name": "deprecated", + "text": [ + { + "text": "A legacy feature for browser compatibility", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string value", + "kind": "text" + } + ] + } + ] + } + ] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/a.ts", + "position": 151, + "name": "4" + }, + "item": { + "flags": 0, + "isGlobalCompletion": true, + "isMemberCompletion": false, + "isNewIdentifierLocation": false, + "entries": [ + { + "name": "f", + "kind": "const", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + }, + { + "name": "that", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "that", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "thing", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "thing", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "those", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "those", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "abstract", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "abstract", + "kind": "keyword" + } + ] + }, + { + "name": "any", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "any", + "kind": "keyword" + } + ] + }, + { + "name": "Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "ArrayBuffer", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBufferConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Represents a raw buffer of binary data, which is used to store data for the\ndifferent typed arrays. ArrayBuffers cannot be read from or written to directly,\nbut can be passed to a typed array or DataView Object to interpret the raw\nbuffer as needed.", + "kind": "text" + } + ] + }, + { + "name": "as", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "as", + "kind": "keyword" + } + ] + }, + { + "name": "asserts", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "asserts", + "kind": "keyword" + } + ] + }, + { + "name": "async", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "async", + "kind": "keyword" + } + ] + }, + { + "name": "await", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "await", + "kind": "keyword" + } + ] + }, + { + "name": "bigint", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "bigint", + "kind": "keyword" + } + ] + }, + { + "name": "boolean", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "boolean", + "kind": "keyword" + } + ] + }, + { + "name": "Boolean", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Boolean", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Boolean", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "BooleanConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "break", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "break", + "kind": "keyword" + } + ] + }, + { + "name": "case", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "case", + "kind": "keyword" + } + ] + }, + { + "name": "catch", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "catch", + "kind": "keyword" + } + ] + }, + { + "name": "class", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "class", + "kind": "keyword" + } + ] + }, + { + "name": "const", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "const", + "kind": "keyword" + } + ] + }, + { + "name": "continue", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "continue", + "kind": "keyword" + } + ] + }, + { + "name": "DataView", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataView", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataView", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataViewConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "Date", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Date", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Date", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DateConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Enables basic storage and retrieval of dates and times.", + "kind": "text" + } + ] + }, + { + "name": "debugger", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "debugger", + "kind": "keyword" + } + ] + }, + { + "name": "declare", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "declare", + "kind": "keyword" + } + ] + }, + { + "name": "decodeURI", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "decodeURI", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "encodedURI", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Gets the unencoded version of an encoded Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "encodedURI", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an encoded URI.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "decodeURIComponent", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "decodeURIComponent", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "encodedURIComponent", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "encodedURIComponent", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an encoded URI component.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "default", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "default", + "kind": "keyword" + } + ] + }, + { + "name": "delete", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "delete", + "kind": "keyword" + } + ] + }, + { + "name": "do", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "do", + "kind": "keyword" + } + ] + }, + { + "name": "else", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "else", + "kind": "keyword" + } + ] + }, + { + "name": "encodeURI", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "encodeURI", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "uri", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Encodes a text string as a valid Uniform Resource Identifier (URI)", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "uri", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an unencoded URI.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "encodeURIComponent", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "encodeURIComponent", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "uriComponent", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Encodes a text string as a valid component of a Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "uriComponent", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an unencoded URI component.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "enum", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + } + ] + }, + { + "name": "Error", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Error", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Error", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "eval", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eval", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Evaluates JavaScript code and executes it.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "x", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A String value that contains valid JavaScript code.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "EvalError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "export", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "export", + "kind": "keyword" + } + ] + }, + { + "name": "extends", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "extends", + "kind": "keyword" + } + ] + }, + { + "name": "false", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "false", + "kind": "keyword" + } + ] + }, + { + "name": "finally", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "finally", + "kind": "keyword" + } + ] + }, + { + "name": "Float32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit float values. The contents are initialized to 0. If the requested number\nof bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Float64Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 64-bit float values. The contents are initialized to 0. If the requested\nnumber of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "for", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "for", + "kind": "keyword" + } + ] + }, + { + "name": "function", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + } + ] + }, + { + "name": "Function", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Function", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Function", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "FunctionConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Creates a new function.", + "kind": "text" + } + ] + }, + { + "name": "globalThis", + "kind": "module", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "module", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalThis", + "kind": "moduleName" + } + ], + "documentation": [] + }, + { + "name": "if", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "if", + "kind": "keyword" + } + ] + }, + { + "name": "implements", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "implements", + "kind": "keyword" + } + ] + }, + { + "name": "import", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + } + ] + }, + { + "name": "in", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "in", + "kind": "keyword" + } + ] + }, + { + "name": "infer", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "infer", + "kind": "keyword" + } + ] + }, + { + "name": "Infinity", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Infinity", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + }, + { + "name": "instanceof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "instanceof", + "kind": "keyword" + } + ] + }, + { + "name": "Int16Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 16-bit signed integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Int32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit signed integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Int8Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit integer values. The contents are initialized to 0. If the requested\nnumber of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "interface", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + } + ] + }, + { + "name": "Intl", + "kind": "module", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Intl", + "kind": "moduleName" + } + ], + "documentation": [] + }, + { + "name": "isFinite", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "isFinite", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Determines whether a supplied number is finite.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "number", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Any numeric value.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "isNaN", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "isNaN", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "number", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A numeric value.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "JSON", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + } + ], + "documentation": [ + { + "text": "An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.", + "kind": "text" + } + ] + }, + { + "name": "keyof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "keyof", + "kind": "keyword" + } + ] + }, + { + "name": "let", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "let", + "kind": "keyword" + } + ] + }, + { + "name": "Math", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + } + ], + "documentation": [ + { + "text": "An intrinsic object that provides basic mathematics functionality and constants.", + "kind": "text" + } + ] + }, + { + "name": "module", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "module", + "kind": "keyword" + } + ] + }, + { + "name": "namespace", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + } + ] + }, + { + "name": "NaN", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "NaN", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + }, + { + "name": "never", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "never", + "kind": "keyword" + } + ] + }, + { + "name": "new", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "new", + "kind": "keyword" + } + ] + }, + { + "name": "null", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "null", + "kind": "keyword" + } + ] + }, + { + "name": "number", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "number", + "kind": "keyword" + } + ] + }, + { + "name": "Number", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Number", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Number", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "NumberConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers.", + "kind": "text" + } + ] + }, + { + "name": "object", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "object", + "kind": "keyword" + } + ] + }, + { + "name": "Object", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Object", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Object", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ObjectConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Provides functionality common to all JavaScript objects.", + "kind": "text" + } + ] + }, + { + "name": "package", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "package", + "kind": "keyword" + } + ] + }, + { + "name": "parseFloat", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "parseFloat", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Converts a string to a floating-point number.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string that contains a floating-point number.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "parseInt", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "parseInt", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "radix", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Converts a string to an integer.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string to convert into a number.", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "radix", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value between 2 and 36 that specifies the base of the number in `string`.\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\nAll other strings are considered decimal.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "RangeError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "readonly", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "readonly", + "kind": "keyword" + } + ] + }, + { + "name": "ReferenceError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "RegExp", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExp", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExp", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExpConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "return", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "return", + "kind": "keyword" + } + ] + }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, + { + "name": "string", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "string", + "kind": "keyword" + } + ] + }, + { + "name": "String", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "String", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "String", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "StringConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "kind": "text" + } + ] + }, + { + "name": "super", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "super", + "kind": "keyword" + } + ] + }, + { + "name": "switch", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "switch", + "kind": "keyword" + } + ] + }, + { + "name": "symbol", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "symbol", + "kind": "keyword" + } + ] + }, + { + "name": "SyntaxError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "this", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "this", + "kind": "keyword" + } + ] + }, + { + "name": "throw", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "throw", + "kind": "keyword" + } + ] + }, + { + "name": "true", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "true", + "kind": "keyword" + } + ] + }, + { + "name": "try", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "try", + "kind": "keyword" + } + ] + }, + { + "name": "type", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "type", + "kind": "keyword" + } + ] + }, + { + "name": "TypeError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "typeof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "typeof", + "kind": "keyword" + } + ] + }, + { + "name": "Uint16Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint8Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint8ClampedArray", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArray", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArray", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.\nIf the requested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "undefined", + "kind": "var", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "propertyName" + } + ], + "documentation": [] + }, + { + "name": "unique", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "unique", + "kind": "keyword" + } + ] + }, + { + "name": "unknown", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "unknown", + "kind": "keyword" + } + ] + }, + { + "name": "URIError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "var", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + } + ] + }, + { + "name": "void", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "void", + "kind": "keyword" + } + ] + }, + { + "name": "while", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "while", + "kind": "keyword" + } + ] + }, + { + "name": "with", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "with", + "kind": "keyword" + } + ] + }, + { + "name": "yield", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "yield", + "kind": "keyword" + } + ] + }, + { + "name": "escape", + "kind": "function", + "kindModifiers": "deprecated,declare", + "sortText": "z15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "escape", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.", + "kind": "text" + } + ], + "tags": [ + { + "name": "deprecated", + "text": [ + { + "text": "A legacy feature for browser compatibility", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string value", + "kind": "text" + } + ] + } + ] + }, + { + "name": "unescape", + "kind": "function", + "kindModifiers": "deprecated,declare", + "sortText": "z15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "unescape", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.", + "kind": "text" + } + ], + "tags": [ + { + "name": "deprecated", + "text": [ + { + "text": "A legacy feature for browser compatibility", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string value", + "kind": "text" + } + ] + } + ] + } + ] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/a.ts", + "position": 162, + "name": "5" + }, + "item": { + "flags": 0, + "isGlobalCompletion": false, + "isMemberCompletion": false, + "isNewIdentifierLocation": false, + "entries": [ + { + "name": "f", + "kind": "const", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "const", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "f", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [] + }, + { + "name": "that", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "that", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "thing", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "thing", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "those", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "those", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "abstract", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "abstract", + "kind": "keyword" + } + ] + }, + { + "name": "any", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "any", + "kind": "keyword" + } + ] + }, + { + "name": "Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "ArrayBuffer", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBufferConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Represents a raw buffer of binary data, which is used to store data for the\ndifferent typed arrays. ArrayBuffers cannot be read from or written to directly,\nbut can be passed to a typed array or DataView Object to interpret the raw\nbuffer as needed.", + "kind": "text" + } + ] + }, + { + "name": "as", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "as", + "kind": "keyword" + } + ] + }, + { + "name": "asserts", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "asserts", + "kind": "keyword" + } + ] + }, + { + "name": "async", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "async", + "kind": "keyword" + } + ] + }, + { + "name": "await", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "await", + "kind": "keyword" + } + ] + }, + { + "name": "bigint", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "bigint", + "kind": "keyword" + } + ] + }, + { + "name": "boolean", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "boolean", + "kind": "keyword" + } + ] + }, + { + "name": "Boolean", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Boolean", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Boolean", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "BooleanConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "break", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "break", + "kind": "keyword" + } + ] + }, + { + "name": "case", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "case", + "kind": "keyword" + } + ] + }, + { + "name": "catch", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "catch", + "kind": "keyword" + } + ] + }, + { + "name": "class", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "class", + "kind": "keyword" + } + ] + }, + { + "name": "const", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "const", + "kind": "keyword" + } + ] + }, + { + "name": "continue", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "continue", + "kind": "keyword" + } + ] + }, + { + "name": "DataView", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataView", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataView", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataViewConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "Date", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Date", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Date", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DateConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Enables basic storage and retrieval of dates and times.", + "kind": "text" + } + ] + }, + { + "name": "debugger", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "debugger", + "kind": "keyword" + } + ] + }, + { + "name": "declare", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "declare", + "kind": "keyword" + } + ] + }, + { + "name": "decodeURI", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "decodeURI", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "encodedURI", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Gets the unencoded version of an encoded Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "encodedURI", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an encoded URI.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "decodeURIComponent", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "decodeURIComponent", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "encodedURIComponent", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "encodedURIComponent", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an encoded URI component.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "default", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "default", + "kind": "keyword" + } + ] + }, + { + "name": "delete", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "delete", + "kind": "keyword" + } + ] + }, + { + "name": "do", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "do", + "kind": "keyword" + } + ] + }, + { + "name": "else", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "else", + "kind": "keyword" + } + ] + }, + { + "name": "encodeURI", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "encodeURI", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "uri", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Encodes a text string as a valid Uniform Resource Identifier (URI)", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "uri", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an unencoded URI.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "encodeURIComponent", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "encodeURIComponent", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "uriComponent", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Encodes a text string as a valid component of a Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "uriComponent", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an unencoded URI component.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "enum", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "enum", + "kind": "keyword" + } + ] + }, + { + "name": "Error", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Error", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Error", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "eval", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eval", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Evaluates JavaScript code and executes it.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "x", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A String value that contains valid JavaScript code.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "EvalError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "export", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "export", + "kind": "keyword" + } + ] + }, + { + "name": "extends", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "extends", + "kind": "keyword" + } + ] + }, + { + "name": "false", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "false", + "kind": "keyword" + } + ] + }, + { + "name": "finally", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "finally", + "kind": "keyword" + } + ] + }, + { + "name": "Float32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit float values. The contents are initialized to 0. If the requested number\nof bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Float64Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 64-bit float values. The contents are initialized to 0. If the requested\nnumber of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "for", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "for", + "kind": "keyword" + } + ] + }, + { + "name": "function", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + } + ] + }, + { + "name": "Function", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Function", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Function", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "FunctionConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Creates a new function.", + "kind": "text" + } + ] + }, + { + "name": "globalThis", + "kind": "module", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "module", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalThis", + "kind": "moduleName" + } + ], + "documentation": [] + }, + { + "name": "if", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "if", + "kind": "keyword" + } + ] + }, + { + "name": "implements", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "implements", + "kind": "keyword" + } + ] + }, + { + "name": "import", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + } + ] + }, + { + "name": "in", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "in", + "kind": "keyword" + } + ] + }, + { + "name": "infer", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "infer", + "kind": "keyword" + } + ] + }, + { + "name": "Infinity", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Infinity", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + }, + { + "name": "instanceof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "instanceof", + "kind": "keyword" + } + ] + }, + { + "name": "Int16Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 16-bit signed integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Int32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit signed integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Int8Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit integer values. The contents are initialized to 0. If the requested\nnumber of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "interface", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + } + ] + }, + { + "name": "Intl", + "kind": "module", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Intl", + "kind": "moduleName" + } + ], + "documentation": [] + }, + { + "name": "isFinite", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "isFinite", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Determines whether a supplied number is finite.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "number", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Any numeric value.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "isNaN", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "isNaN", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "number", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A numeric value.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "JSON", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + } + ], + "documentation": [ + { + "text": "An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.", + "kind": "text" + } + ] + }, + { + "name": "keyof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "keyof", + "kind": "keyword" + } + ] + }, + { + "name": "let", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "let", + "kind": "keyword" + } + ] + }, + { + "name": "Math", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + } + ], + "documentation": [ + { + "text": "An intrinsic object that provides basic mathematics functionality and constants.", + "kind": "text" + } + ] + }, + { + "name": "module", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "module", + "kind": "keyword" + } + ] + }, + { + "name": "namespace", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + } + ] + }, + { + "name": "NaN", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "NaN", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + }, + { + "name": "never", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "never", + "kind": "keyword" + } + ] + }, + { + "name": "new", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "new", + "kind": "keyword" + } + ] + }, + { + "name": "null", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "null", + "kind": "keyword" + } + ] + }, + { + "name": "number", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "number", + "kind": "keyword" + } + ] + }, + { + "name": "Number", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Number", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Number", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "NumberConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers.", + "kind": "text" + } + ] + }, + { + "name": "object", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "object", + "kind": "keyword" + } + ] + }, + { + "name": "Object", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Object", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Object", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ObjectConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Provides functionality common to all JavaScript objects.", + "kind": "text" + } + ] + }, + { + "name": "package", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "package", + "kind": "keyword" + } + ] + }, + { + "name": "parseFloat", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "parseFloat", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Converts a string to a floating-point number.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string that contains a floating-point number.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "parseInt", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "parseInt", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "radix", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Converts a string to an integer.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string to convert into a number.", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "radix", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value between 2 and 36 that specifies the base of the number in `string`.\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\nAll other strings are considered decimal.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "RangeError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "readonly", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "readonly", + "kind": "keyword" + } + ] + }, + { + "name": "ReferenceError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "RegExp", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExp", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExp", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExpConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "return", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "return", + "kind": "keyword" + } + ] + }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, + { + "name": "string", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "string", + "kind": "keyword" + } + ] + }, + { + "name": "String", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "String", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "String", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "StringConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "kind": "text" + } + ] + }, + { + "name": "super", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "super", + "kind": "keyword" + } + ] + }, + { + "name": "switch", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "switch", + "kind": "keyword" + } + ] + }, + { + "name": "symbol", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "symbol", + "kind": "keyword" + } + ] + }, + { + "name": "SyntaxError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "this", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "this", + "kind": "keyword" + } + ] + }, + { + "name": "throw", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "throw", + "kind": "keyword" + } + ] + }, + { + "name": "true", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "true", + "kind": "keyword" + } + ] + }, + { + "name": "try", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "try", + "kind": "keyword" + } + ] + }, + { + "name": "type", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "type", + "kind": "keyword" + } + ] + }, + { + "name": "TypeError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "typeof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "typeof", + "kind": "keyword" + } + ] + }, + { + "name": "Uint16Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint8Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint8ClampedArray", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArray", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArray", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.\nIf the requested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "undefined", + "kind": "var", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "propertyName" + } + ], + "documentation": [] + }, + { + "name": "unique", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "unique", + "kind": "keyword" + } + ] + }, + { + "name": "unknown", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "unknown", + "kind": "keyword" + } + ] + }, + { + "name": "URIError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "var", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + } + ] + }, + { + "name": "void", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "void", + "kind": "keyword" + } + ] + }, + { + "name": "while", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "while", + "kind": "keyword" + } + ] + }, + { + "name": "with", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "with", + "kind": "keyword" + } + ] + }, + { + "name": "yield", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "yield", + "kind": "keyword" + } + ] + }, + { + "name": "escape", + "kind": "function", + "kindModifiers": "deprecated,declare", + "sortText": "z15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "escape", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.", + "kind": "text" + } + ], + "tags": [ + { + "name": "deprecated", + "text": [ + { + "text": "A legacy feature for browser compatibility", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string value", + "kind": "text" + } + ] + } + ] + }, + { + "name": "unescape", + "kind": "function", + "kindModifiers": "deprecated,declare", + "sortText": "z15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "unescape", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.", + "kind": "text" + } + ], + "tags": [ + { + "name": "deprecated", + "text": [ + { + "text": "A legacy feature for browser compatibility", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string value", + "kind": "text" + } + ] + } + ] + } + ] + } + }, + { + "marker": { + "fileName": "/tests/cases/fourslash/b.js", + "position": 31, + "name": "js" + }, + "item": { + "flags": 0, + "isGlobalCompletion": true, + "isMemberCompletion": false, + "isNewIdentifierLocation": false, + "entries": [ + { + "name": "thing", + "kind": "alias", + "kindModifiers": "", + "sortText": "11", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "thing", + "kind": "aliasName" + } + ], + "documentation": [] + }, + { + "name": "Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "ArrayBuffer", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBuffer", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ArrayBufferConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Represents a raw buffer of binary data, which is used to store data for the\ndifferent typed arrays. ArrayBuffers cannot be read from or written to directly,\nbut can be passed to a typed array or DataView Object to interpret the raw\nbuffer as needed.", + "kind": "text" + } + ] + }, + { + "name": "as", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "as", + "kind": "keyword" + } + ] + }, + { + "name": "assert", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "assert", + "kind": "keyword" + } + ] + }, + { + "name": "asserts", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "asserts", + "kind": "keyword" + } + ] + }, + { + "name": "async", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "async", + "kind": "keyword" + } + ] + }, + { + "name": "await", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "await", + "kind": "keyword" + } + ] + }, + { + "name": "Boolean", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Boolean", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Boolean", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "BooleanConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "break", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "break", + "kind": "keyword" + } + ] + }, + { + "name": "case", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "case", + "kind": "keyword" + } + ] + }, + { + "name": "catch", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "catch", + "kind": "keyword" + } + ] + }, + { + "name": "class", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "class", + "kind": "keyword" + } + ] + }, + { + "name": "const", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "const", + "kind": "keyword" + } + ] + }, + { + "name": "continue", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "continue", + "kind": "keyword" + } + ] + }, + { + "name": "DataView", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataView", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataView", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DataViewConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "Date", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Date", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Date", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "DateConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Enables basic storage and retrieval of dates and times.", + "kind": "text" + } + ] + }, + { + "name": "debugger", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "debugger", + "kind": "keyword" + } + ] + }, + { + "name": "decodeURI", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "decodeURI", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "encodedURI", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Gets the unencoded version of an encoded Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "encodedURI", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an encoded URI.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "decodeURIComponent", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "decodeURIComponent", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "encodedURIComponent", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "encodedURIComponent", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an encoded URI component.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "default", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "default", + "kind": "keyword" + } + ] + }, + { + "name": "delete", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "delete", + "kind": "keyword" + } + ] + }, + { + "name": "do", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "do", + "kind": "keyword" + } + ] + }, + { + "name": "else", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "else", + "kind": "keyword" + } + ] + }, + { + "name": "encodeURI", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "encodeURI", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "uri", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Encodes a text string as a valid Uniform Resource Identifier (URI)", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "uri", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an unencoded URI.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "encodeURIComponent", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "encodeURIComponent", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "uriComponent", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Encodes a text string as a valid component of a Uniform Resource Identifier (URI).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "uriComponent", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value representing an unencoded URI component.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "Error", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Error", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Error", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "eval", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "eval", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "x", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "any", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Evaluates JavaScript code and executes it.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "x", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A String value that contains valid JavaScript code.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "EvalError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "EvalErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "export", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "export", + "kind": "keyword" + } + ] + }, + { + "name": "extends", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "extends", + "kind": "keyword" + } + ] + }, + { + "name": "false", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "false", + "kind": "keyword" + } + ] + }, + { + "name": "finally", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "finally", + "kind": "keyword" + } + ] + }, + { + "name": "Float32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit float values. The contents are initialized to 0. If the requested number\nof bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Float64Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Float64ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 64-bit float values. The contents are initialized to 0. If the requested\nnumber of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "for", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "for", + "kind": "keyword" + } + ] + }, + { + "name": "function", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + } + ] + }, + { + "name": "Function", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Function", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Function", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "FunctionConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Creates a new function.", + "kind": "text" + } + ] + }, + { + "name": "globalThis", + "kind": "module", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "module", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "globalThis", + "kind": "moduleName" + } + ], + "documentation": [] + }, + { + "name": "if", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "if", + "kind": "keyword" + } + ] + }, + { + "name": "import", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "import", + "kind": "keyword" + } + ] + }, + { + "name": "in", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "in", + "kind": "keyword" + } + ] + }, + { + "name": "Infinity", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Infinity", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + }, + { + "name": "instanceof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "instanceof", + "kind": "keyword" + } + ] + }, + { + "name": "Int16Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int16ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 16-bit signed integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Int32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit signed integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Int8Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Int8ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit integer values. The contents are initialized to 0. If the requested\nnumber of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Intl", + "kind": "module", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "namespace", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Intl", + "kind": "moduleName" + } + ], + "documentation": [] + }, + { + "name": "isFinite", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "isFinite", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Determines whether a supplied number is finite.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "number", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Any numeric value.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "isNaN", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "isNaN", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "number", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "number", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A numeric value.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "JSON", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "JSON", + "kind": "localName" + } + ], + "documentation": [ + { + "text": "An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.", + "kind": "text" + } + ] + }, + { + "name": "let", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "let", + "kind": "keyword" + } + ] + }, + { + "name": "Math", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Math", + "kind": "localName" + } + ], + "documentation": [ + { + "text": "An intrinsic object that provides basic mathematics functionality and constants.", + "kind": "text" + } + ] + }, + { + "name": "NaN", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "NaN", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + }, + { + "name": "new", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "new", + "kind": "keyword" + } + ] + }, + { + "name": "null", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "null", + "kind": "keyword" + } + ] + }, + { + "name": "Number", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Number", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Number", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "NumberConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers.", + "kind": "text" + } + ] + }, + { + "name": "Object", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Object", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Object", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ObjectConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Provides functionality common to all JavaScript objects.", + "kind": "text" + } + ] + }, + { + "name": "package", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "package", + "kind": "keyword" + } + ] + }, + { + "name": "parseFloat", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "parseFloat", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Converts a string to a floating-point number.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string that contains a floating-point number.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "parseInt", + "kind": "function", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "parseInt", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ",", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "radix", + "kind": "parameterName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Converts a string to an integer.", + "kind": "text" + } + ], + "tags": [ + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string to convert into a number.", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "radix", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A value between 2 and 36 that specifies the base of the number in `string`.\nIf this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\nAll other strings are considered decimal.", + "kind": "text" + } + ] + } + ] + }, + { + "name": "RangeError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RangeErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "ReferenceError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "ReferenceErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "RegExp", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExp", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExp", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "RegExpConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "return", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "return", + "kind": "keyword" + } + ] + }, + { + "name": "satisfies", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "satisfies", + "kind": "keyword" + } + ] + }, + { + "name": "String", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "String", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "String", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "StringConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "kind": "text" + } + ] + }, + { + "name": "super", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "super", + "kind": "keyword" + } + ] + }, + { + "name": "switch", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "switch", + "kind": "keyword" + } + ] + }, + { + "name": "SyntaxError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "SyntaxErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "this", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "this", + "kind": "keyword" + } + ] + }, + { + "name": "throw", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "throw", + "kind": "keyword" + } + ] + }, + { + "name": "true", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "true", + "kind": "keyword" + } + ] + }, + { + "name": "try", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "try", + "kind": "keyword" + } + ] + }, + { + "name": "TypeError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "TypeErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "typeof", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "typeof", + "kind": "keyword" + } + ] + }, + { + "name": "Uint16Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint16ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint32Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint32ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint8Array", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8Array", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8Array", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\nrequested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "Uint8ClampedArray", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArray", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArray", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Uint8ClampedArrayConstructor", + "kind": "interfaceName" + } + ], + "documentation": [ + { + "text": "A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.\nIf the requested number of bytes could not be allocated an exception is raised.", + "kind": "text" + } + ] + }, + { + "name": "undefined", + "kind": "var", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "undefined", + "kind": "propertyName" + } + ], + "documentation": [] + }, + { + "name": "URIError", + "kind": "var", + "kindModifiers": "declare", + "sortText": "15", + "displayParts": [ + { + "text": "interface", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIError", + "kind": "localName" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "var", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIError", + "kind": "localName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "URIErrorConstructor", + "kind": "interfaceName" + } + ], + "documentation": [] + }, + { + "name": "var", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "var", + "kind": "keyword" + } + ] + }, + { + "name": "void", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "void", + "kind": "keyword" + } + ] + }, + { + "name": "while", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "while", + "kind": "keyword" + } + ] + }, + { + "name": "with", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "with", + "kind": "keyword" + } + ] + }, + { + "name": "yield", + "kind": "keyword", + "kindModifiers": "", + "sortText": "15", + "displayParts": [ + { + "text": "yield", + "kind": "keyword" + } + ] + }, + { + "name": "escape", + "kind": "function", + "kindModifiers": "deprecated,declare", + "sortText": "z15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "escape", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.", + "kind": "text" + } + ], + "tags": [ + { + "name": "deprecated", + "text": [ + { + "text": "A legacy feature for browser compatibility", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string value", + "kind": "text" + } + ] + } + ] + }, + { + "name": "unescape", + "kind": "function", + "kindModifiers": "deprecated,declare", + "sortText": "z15", + "displayParts": [ + { + "text": "function", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "unescape", + "kind": "functionName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "string", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.", + "kind": "text" + } + ], + "tags": [ + { + "name": "deprecated", + "text": [ + { + "text": "A legacy feature for browser compatibility", + "kind": "text" + } + ] + }, + { + "name": "param", + "text": [ + { + "text": "string", + "kind": "parameterName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "A string value", + "kind": "text" + } + ] + } + ] + } + ] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/getOccurrencesNonStringImportAttributes.baseline.jsonc b/tests/baselines/reference/getOccurrencesNonStringImportAttributes.baseline.jsonc new file mode 100644 index 0000000000000..ef51a0b9d0682 --- /dev/null +++ b/tests/baselines/reference/getOccurrencesNonStringImportAttributes.baseline.jsonc @@ -0,0 +1,4 @@ +// === documentHighlights === +// === /tests/cases/fourslash/getOccurrencesNonStringImportAttributes.ts === +// import * as react from "react" with { cache: /*HIGHLIGHTS*/0 }; +// react.Children; \ No newline at end of file diff --git a/tests/baselines/reference/importAssertion1(module=commonjs).errors.txt b/tests/baselines/reference/importAssertion1(module=commonjs).errors.txt index d11e612746a0c..c937b51391439 100644 --- a/tests/baselines/reference/importAssertion1(module=commonjs).errors.txt +++ b/tests/baselines/reference/importAssertion1(module=commonjs).errors.txt @@ -8,7 +8,7 @@ 3.ts(4,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. 3.ts(5,26): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. 3.ts(7,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. -3.ts(8,11): message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments +3.ts(8,11): message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments 3.ts(9,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. 3.ts(10,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. 3.ts(10,52): error TS1009: Trailing comma not allowed. @@ -65,7 +65,7 @@ !!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. const f = import() ~~~~~~~~ -!!! message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments +!!! message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments const g = import('./0', {}, {}) ~~ !!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. diff --git a/tests/baselines/reference/importAssertion1(module=esnext).errors.txt b/tests/baselines/reference/importAssertion1(module=esnext).errors.txt index df0fc98859fa5..e8100730813c4 100644 --- a/tests/baselines/reference/importAssertion1(module=esnext).errors.txt +++ b/tests/baselines/reference/importAssertion1(module=esnext).errors.txt @@ -1,5 +1,5 @@ -3.ts(8,11): message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments -3.ts(9,11): message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments +3.ts(8,11): message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments +3.ts(9,11): message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments ==== 0.ts (0 errors) ==== @@ -33,10 +33,10 @@ const e = import('./0', foo()) const f = import() ~~~~~~~~ -!!! message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments +!!! message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments const g = import('./0', {}, {}) ~~~~~~~~~~~~~~~~~~~~~ -!!! message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments +!!! message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments const h = import('./0', { assert: { type: "json" }},) \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes1(module=commonjs).errors.txt b/tests/baselines/reference/importAttributes1(module=commonjs).errors.txt new file mode 100644 index 0000000000000..88b174f0b1ae4 --- /dev/null +++ b/tests/baselines/reference/importAttributes1(module=commonjs).errors.txt @@ -0,0 +1,75 @@ +1.ts(1,14): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +1.ts(3,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +3.ts(2,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. +3.ts(3,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. +3.ts(4,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. +3.ts(5,26): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. +3.ts(7,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. +3.ts(8,11): message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments +3.ts(9,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. +3.ts(10,25): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. +3.ts(10,50): error TS1009: Trailing comma not allowed. + + +==== 0.ts (0 errors) ==== + export const a = 1; + export const b = 2; + +==== 1.ts (3 errors) ==== + import './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + import { a, b } from './0' with { "type": "json" } + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + import * as foo from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + a; + b; + foo.a; + foo.b; +==== 2.ts (2 errors) ==== + import { a, b } from './0' with {} + ~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + a; + b; + c; + d; +==== 3.ts (9 errors) ==== + const a = import('./0') + const b = import('./0', { with: { type: "json" } }) + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. + const c = import('./0', { with: { type: "json", ttype: "typo" } }) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. + const d = import('./0', { with: {} }) + ~~~~~~~~~~~~ +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. + const dd = import('./0', {}) + ~~ +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. + declare function foo(): any; + const e = import('./0', foo()) + ~~~~~ +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. + const f = import() + ~~~~~~~~ +!!! message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments + const g = import('./0', {}, {}) + ~~ +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. + const h = import('./0', { with: { type: "json" }},) + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. + ~ +!!! error TS1009: Trailing comma not allowed. + \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes1(module=commonjs).js b/tests/baselines/reference/importAttributes1(module=commonjs).js new file mode 100644 index 0000000000000..efa8ccd637c10 --- /dev/null +++ b/tests/baselines/reference/importAttributes1(module=commonjs).js @@ -0,0 +1,89 @@ +//// [tests/cases/conformance/importAttributes/importAttributes1.ts] //// + +//// [0.ts] +export const a = 1; +export const b = 2; + +//// [1.ts] +import './0' with { type: "json" } +import { a, b } from './0' with { "type": "json" } +import * as foo from './0' with { type: "json" } +a; +b; +foo.a; +foo.b; +//// [2.ts] +import { a, b } from './0' with {} +import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } +a; +b; +c; +d; +//// [3.ts] +const a = import('./0') +const b = import('./0', { with: { type: "json" } }) +const c = import('./0', { with: { type: "json", ttype: "typo" } }) +const d = import('./0', { with: {} }) +const dd = import('./0', {}) +declare function foo(): any; +const e = import('./0', foo()) +const f = import() +const g = import('./0', {}, {}) +const h = import('./0', { with: { type: "json" }},) + + +//// [0.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = 1; +exports.b = 2; +//// [1.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +require("./0"); +const _0_1 = require("./0"); +const foo = require("./0"); +_0_1.a; +_0_1.b; +foo.a; +foo.b; +//// [2.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const _0_1 = require("./0"); +const _0_2 = require("./0"); +_0_1.a; +_0_1.b; +_0_2.a; +_0_2.b; +//// [3.js] +const a = Promise.resolve().then(() => require('./0')); +const b = Promise.resolve().then(() => require('./0')); +const c = Promise.resolve().then(() => require('./0')); +const d = Promise.resolve().then(() => require('./0')); +const dd = Promise.resolve().then(() => require('./0')); +const e = Promise.resolve().then(() => require('./0')); +const f = Promise.resolve().then(() => require()); +const g = Promise.resolve().then(() => require('./0')); +const h = Promise.resolve().then(() => require('./0')); + + +//// [0.d.ts] +export declare const a = 1; +export declare const b = 2; +//// [1.d.ts] +import './0'; +//// [2.d.ts] +export {}; +//// [3.d.ts] +declare const a: Promise; +declare const b: Promise; +declare const c: Promise; +declare const d: Promise; +declare const dd: Promise; +declare function foo(): any; +declare const e: Promise; +declare const f: Promise; +declare const g: Promise; +declare const h: Promise; diff --git a/tests/baselines/reference/importAttributes1(module=commonjs).symbols b/tests/baselines/reference/importAttributes1(module=commonjs).symbols new file mode 100644 index 0000000000000..65dc9f66362e7 --- /dev/null +++ b/tests/baselines/reference/importAttributes1(module=commonjs).symbols @@ -0,0 +1,105 @@ +//// [tests/cases/conformance/importAttributes/importAttributes1.ts] //// + +=== 0.ts === +export const a = 1; +>a : Symbol(a, Decl(0.ts, 0, 12)) + +export const b = 2; +>b : Symbol(b, Decl(0.ts, 1, 12)) + +=== 1.ts === +import './0' with { type: "json" } +import { a, b } from './0' with { "type": "json" } +>a : Symbol(a, Decl(1.ts, 1, 8)) +>b : Symbol(b, Decl(1.ts, 1, 11)) + +import * as foo from './0' with { type: "json" } +>foo : Symbol(foo, Decl(1.ts, 2, 6)) + +a; +>a : Symbol(a, Decl(1.ts, 1, 8)) + +b; +>b : Symbol(b, Decl(1.ts, 1, 11)) + +foo.a; +>foo.a : Symbol(a, Decl(0.ts, 0, 12)) +>foo : Symbol(foo, Decl(1.ts, 2, 6)) +>a : Symbol(a, Decl(0.ts, 0, 12)) + +foo.b; +>foo.b : Symbol(b, Decl(0.ts, 1, 12)) +>foo : Symbol(foo, Decl(1.ts, 2, 6)) +>b : Symbol(b, Decl(0.ts, 1, 12)) + +=== 2.ts === +import { a, b } from './0' with {} +>a : Symbol(a, Decl(2.ts, 0, 8)) +>b : Symbol(b, Decl(2.ts, 0, 11)) + +import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } +>a : Symbol(a, Decl(0.ts, 0, 12)) +>c : Symbol(c, Decl(2.ts, 1, 8)) +>b : Symbol(b, Decl(0.ts, 1, 12)) +>d : Symbol(d, Decl(2.ts, 1, 16)) + +a; +>a : Symbol(a, Decl(2.ts, 0, 8)) + +b; +>b : Symbol(b, Decl(2.ts, 0, 11)) + +c; +>c : Symbol(c, Decl(2.ts, 1, 8)) + +d; +>d : Symbol(d, Decl(2.ts, 1, 16)) + +=== 3.ts === +const a = import('./0') +>a : Symbol(a, Decl(3.ts, 0, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) + +const b = import('./0', { with: { type: "json" } }) +>b : Symbol(b, Decl(3.ts, 1, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) +>with : Symbol(with, Decl(3.ts, 1, 25)) +>type : Symbol(type, Decl(3.ts, 1, 33)) + +const c = import('./0', { with: { type: "json", ttype: "typo" } }) +>c : Symbol(c, Decl(3.ts, 2, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) +>with : Symbol(with, Decl(3.ts, 2, 25)) +>type : Symbol(type, Decl(3.ts, 2, 33)) +>ttype : Symbol(ttype, Decl(3.ts, 2, 47)) + +const d = import('./0', { with: {} }) +>d : Symbol(d, Decl(3.ts, 3, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) +>with : Symbol(with, Decl(3.ts, 3, 25)) + +const dd = import('./0', {}) +>dd : Symbol(dd, Decl(3.ts, 4, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) + +declare function foo(): any; +>foo : Symbol(foo, Decl(3.ts, 4, 28)) + +const e = import('./0', foo()) +>e : Symbol(e, Decl(3.ts, 6, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) +>foo : Symbol(foo, Decl(3.ts, 4, 28)) + +const f = import() +>f : Symbol(f, Decl(3.ts, 7, 5)) + +const g = import('./0', {}, {}) +>g : Symbol(g, Decl(3.ts, 8, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) + +const h = import('./0', { with: { type: "json" }},) +>h : Symbol(h, Decl(3.ts, 9, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) +>with : Symbol(with, Decl(3.ts, 9, 25)) +>type : Symbol(type, Decl(3.ts, 9, 33)) + diff --git a/tests/baselines/reference/importAttributes1(module=commonjs).types b/tests/baselines/reference/importAttributes1(module=commonjs).types new file mode 100644 index 0000000000000..fb1da06ede0e4 --- /dev/null +++ b/tests/baselines/reference/importAttributes1(module=commonjs).types @@ -0,0 +1,138 @@ +//// [tests/cases/conformance/importAttributes/importAttributes1.ts] //// + +=== 0.ts === +export const a = 1; +>a : 1 +>1 : 1 + +export const b = 2; +>b : 2 +>2 : 2 + +=== 1.ts === +import './0' with { type: "json" } +>type : any + +import { a, b } from './0' with { "type": "json" } +>a : 1 +>b : 2 + +import * as foo from './0' with { type: "json" } +>foo : typeof foo +>type : any + +a; +>a : 1 + +b; +>b : 2 + +foo.a; +>foo.a : 1 +>foo : typeof foo +>a : 1 + +foo.b; +>foo.b : 2 +>foo : typeof foo +>b : 2 + +=== 2.ts === +import { a, b } from './0' with {} +>a : 1 +>b : 2 + +import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } +>a : 1 +>c : 1 +>b : 2 +>d : 2 +>a : any +>b : any +>c : any + +a; +>a : 1 + +b; +>b : 2 + +c; +>c : 1 + +d; +>d : 2 + +=== 3.ts === +const a = import('./0') +>a : Promise +>import('./0') : Promise +>'./0' : "./0" + +const b = import('./0', { with: { type: "json" } }) +>b : Promise +>import('./0', { with: { type: "json" } }) : Promise +>'./0' : "./0" +>{ with: { type: "json" } } : { with: { type: string; }; } +>with : { type: string; } +>{ type: "json" } : { type: string; } +>type : string +>"json" : "json" + +const c = import('./0', { with: { type: "json", ttype: "typo" } }) +>c : Promise +>import('./0', { with: { type: "json", ttype: "typo" } }) : Promise +>'./0' : "./0" +>{ with: { type: "json", ttype: "typo" } } : { with: { type: string; ttype: string; }; } +>with : { type: string; ttype: string; } +>{ type: "json", ttype: "typo" } : { type: string; ttype: string; } +>type : string +>"json" : "json" +>ttype : string +>"typo" : "typo" + +const d = import('./0', { with: {} }) +>d : Promise +>import('./0', { with: {} }) : Promise +>'./0' : "./0" +>{ with: {} } : { with: {}; } +>with : {} +>{} : {} + +const dd = import('./0', {}) +>dd : Promise +>import('./0', {}) : Promise +>'./0' : "./0" +>{} : {} + +declare function foo(): any; +>foo : () => any + +const e = import('./0', foo()) +>e : Promise +>import('./0', foo()) : Promise +>'./0' : "./0" +>foo() : any +>foo : () => any + +const f = import() +>f : Promise +>import() : Promise + +const g = import('./0', {}, {}) +>g : Promise +>import('./0', {}, {}) : Promise +>'./0' : "./0" +>{} : {} +>{} : {} + +const h = import('./0', { with: { type: "json" }},) +>h : Promise +>import('./0', { with: { type: "json" }},) : Promise +>'./0' : "./0" +>{ with: { type: "json" }} : { with: { type: string; }; } +>with : { type: string; } +>{ type: "json" } : { type: string; } +>type : string +>"json" : "json" + diff --git a/tests/baselines/reference/importAttributes1(module=es2015).errors.txt b/tests/baselines/reference/importAttributes1(module=es2015).errors.txt new file mode 100644 index 0000000000000..e8259d6d21743 --- /dev/null +++ b/tests/baselines/reference/importAttributes1(module=es2015).errors.txt @@ -0,0 +1,75 @@ +1.ts(1,14): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +1.ts(3,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +3.ts(1,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +3.ts(2,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +3.ts(3,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +3.ts(4,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +3.ts(5,12): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +3.ts(7,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +3.ts(8,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +3.ts(9,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. +3.ts(10,11): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. + + +==== 0.ts (0 errors) ==== + export const a = 1; + export const b = 2; + +==== 1.ts (3 errors) ==== + import './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + import { a, b } from './0' with { "type": "json" } + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + import * as foo from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + a; + b; + foo.a; + foo.b; +==== 2.ts (2 errors) ==== + import { a, b } from './0' with {} + ~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + a; + b; + c; + d; +==== 3.ts (9 errors) ==== + const a = import('./0') + ~~~~~~~~~~~~~ +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. + const b = import('./0', { with: { type: "json" } }) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. + const c = import('./0', { with: { type: "json", ttype: "typo" } }) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. + const d = import('./0', { with: {} }) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. + const dd = import('./0', {}) + ~~~~~~~~~~~~~~~~~ +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. + declare function foo(): any; + const e = import('./0', foo()) + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. + const f = import() + ~~~~~~~~ +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. + const g = import('./0', {}, {}) + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. + const h = import('./0', { with: { type: "json" }},) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'. + \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes1(module=es2015).js b/tests/baselines/reference/importAttributes1(module=es2015).js new file mode 100644 index 0000000000000..6a3d38f34e0d4 --- /dev/null +++ b/tests/baselines/reference/importAttributes1(module=es2015).js @@ -0,0 +1,82 @@ +//// [tests/cases/conformance/importAttributes/importAttributes1.ts] //// + +//// [0.ts] +export const a = 1; +export const b = 2; + +//// [1.ts] +import './0' with { type: "json" } +import { a, b } from './0' with { "type": "json" } +import * as foo from './0' with { type: "json" } +a; +b; +foo.a; +foo.b; +//// [2.ts] +import { a, b } from './0' with {} +import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } +a; +b; +c; +d; +//// [3.ts] +const a = import('./0') +const b = import('./0', { with: { type: "json" } }) +const c = import('./0', { with: { type: "json", ttype: "typo" } }) +const d = import('./0', { with: {} }) +const dd = import('./0', {}) +declare function foo(): any; +const e = import('./0', foo()) +const f = import() +const g = import('./0', {}, {}) +const h = import('./0', { with: { type: "json" }},) + + +//// [0.js] +export const a = 1; +export const b = 2; +//// [1.js] +import './0' with { type: "json" }; +import { a, b } from './0' with { "type": "json" }; +import * as foo from './0' with { type: "json" }; +a; +b; +foo.a; +foo.b; +//// [2.js] +import { a, b } from './0' with {}; +import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" }; +a; +b; +c; +d; +//// [3.js] +const a = import('./0'); +const b = import('./0', { with: { type: "json" } }); +const c = import('./0', { with: { type: "json", ttype: "typo" } }); +const d = import('./0', { with: {} }); +const dd = import('./0', {}); +const e = import('./0', foo()); +const f = import(); +const g = import('./0', {}, {}); +const h = import('./0', { with: { type: "json" } }); + + +//// [0.d.ts] +export declare const a = 1; +export declare const b = 2; +//// [1.d.ts] +import './0'; +//// [2.d.ts] +export {}; +//// [3.d.ts] +declare const a: Promise; +declare const b: Promise; +declare const c: Promise; +declare const d: Promise; +declare const dd: Promise; +declare function foo(): any; +declare const e: Promise; +declare const f: Promise; +declare const g: Promise; +declare const h: Promise; diff --git a/tests/baselines/reference/importAttributes1(module=es2015).symbols b/tests/baselines/reference/importAttributes1(module=es2015).symbols new file mode 100644 index 0000000000000..65dc9f66362e7 --- /dev/null +++ b/tests/baselines/reference/importAttributes1(module=es2015).symbols @@ -0,0 +1,105 @@ +//// [tests/cases/conformance/importAttributes/importAttributes1.ts] //// + +=== 0.ts === +export const a = 1; +>a : Symbol(a, Decl(0.ts, 0, 12)) + +export const b = 2; +>b : Symbol(b, Decl(0.ts, 1, 12)) + +=== 1.ts === +import './0' with { type: "json" } +import { a, b } from './0' with { "type": "json" } +>a : Symbol(a, Decl(1.ts, 1, 8)) +>b : Symbol(b, Decl(1.ts, 1, 11)) + +import * as foo from './0' with { type: "json" } +>foo : Symbol(foo, Decl(1.ts, 2, 6)) + +a; +>a : Symbol(a, Decl(1.ts, 1, 8)) + +b; +>b : Symbol(b, Decl(1.ts, 1, 11)) + +foo.a; +>foo.a : Symbol(a, Decl(0.ts, 0, 12)) +>foo : Symbol(foo, Decl(1.ts, 2, 6)) +>a : Symbol(a, Decl(0.ts, 0, 12)) + +foo.b; +>foo.b : Symbol(b, Decl(0.ts, 1, 12)) +>foo : Symbol(foo, Decl(1.ts, 2, 6)) +>b : Symbol(b, Decl(0.ts, 1, 12)) + +=== 2.ts === +import { a, b } from './0' with {} +>a : Symbol(a, Decl(2.ts, 0, 8)) +>b : Symbol(b, Decl(2.ts, 0, 11)) + +import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } +>a : Symbol(a, Decl(0.ts, 0, 12)) +>c : Symbol(c, Decl(2.ts, 1, 8)) +>b : Symbol(b, Decl(0.ts, 1, 12)) +>d : Symbol(d, Decl(2.ts, 1, 16)) + +a; +>a : Symbol(a, Decl(2.ts, 0, 8)) + +b; +>b : Symbol(b, Decl(2.ts, 0, 11)) + +c; +>c : Symbol(c, Decl(2.ts, 1, 8)) + +d; +>d : Symbol(d, Decl(2.ts, 1, 16)) + +=== 3.ts === +const a = import('./0') +>a : Symbol(a, Decl(3.ts, 0, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) + +const b = import('./0', { with: { type: "json" } }) +>b : Symbol(b, Decl(3.ts, 1, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) +>with : Symbol(with, Decl(3.ts, 1, 25)) +>type : Symbol(type, Decl(3.ts, 1, 33)) + +const c = import('./0', { with: { type: "json", ttype: "typo" } }) +>c : Symbol(c, Decl(3.ts, 2, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) +>with : Symbol(with, Decl(3.ts, 2, 25)) +>type : Symbol(type, Decl(3.ts, 2, 33)) +>ttype : Symbol(ttype, Decl(3.ts, 2, 47)) + +const d = import('./0', { with: {} }) +>d : Symbol(d, Decl(3.ts, 3, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) +>with : Symbol(with, Decl(3.ts, 3, 25)) + +const dd = import('./0', {}) +>dd : Symbol(dd, Decl(3.ts, 4, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) + +declare function foo(): any; +>foo : Symbol(foo, Decl(3.ts, 4, 28)) + +const e = import('./0', foo()) +>e : Symbol(e, Decl(3.ts, 6, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) +>foo : Symbol(foo, Decl(3.ts, 4, 28)) + +const f = import() +>f : Symbol(f, Decl(3.ts, 7, 5)) + +const g = import('./0', {}, {}) +>g : Symbol(g, Decl(3.ts, 8, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) + +const h = import('./0', { with: { type: "json" }},) +>h : Symbol(h, Decl(3.ts, 9, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) +>with : Symbol(with, Decl(3.ts, 9, 25)) +>type : Symbol(type, Decl(3.ts, 9, 33)) + diff --git a/tests/baselines/reference/importAttributes1(module=es2015).types b/tests/baselines/reference/importAttributes1(module=es2015).types new file mode 100644 index 0000000000000..fb1da06ede0e4 --- /dev/null +++ b/tests/baselines/reference/importAttributes1(module=es2015).types @@ -0,0 +1,138 @@ +//// [tests/cases/conformance/importAttributes/importAttributes1.ts] //// + +=== 0.ts === +export const a = 1; +>a : 1 +>1 : 1 + +export const b = 2; +>b : 2 +>2 : 2 + +=== 1.ts === +import './0' with { type: "json" } +>type : any + +import { a, b } from './0' with { "type": "json" } +>a : 1 +>b : 2 + +import * as foo from './0' with { type: "json" } +>foo : typeof foo +>type : any + +a; +>a : 1 + +b; +>b : 2 + +foo.a; +>foo.a : 1 +>foo : typeof foo +>a : 1 + +foo.b; +>foo.b : 2 +>foo : typeof foo +>b : 2 + +=== 2.ts === +import { a, b } from './0' with {} +>a : 1 +>b : 2 + +import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } +>a : 1 +>c : 1 +>b : 2 +>d : 2 +>a : any +>b : any +>c : any + +a; +>a : 1 + +b; +>b : 2 + +c; +>c : 1 + +d; +>d : 2 + +=== 3.ts === +const a = import('./0') +>a : Promise +>import('./0') : Promise +>'./0' : "./0" + +const b = import('./0', { with: { type: "json" } }) +>b : Promise +>import('./0', { with: { type: "json" } }) : Promise +>'./0' : "./0" +>{ with: { type: "json" } } : { with: { type: string; }; } +>with : { type: string; } +>{ type: "json" } : { type: string; } +>type : string +>"json" : "json" + +const c = import('./0', { with: { type: "json", ttype: "typo" } }) +>c : Promise +>import('./0', { with: { type: "json", ttype: "typo" } }) : Promise +>'./0' : "./0" +>{ with: { type: "json", ttype: "typo" } } : { with: { type: string; ttype: string; }; } +>with : { type: string; ttype: string; } +>{ type: "json", ttype: "typo" } : { type: string; ttype: string; } +>type : string +>"json" : "json" +>ttype : string +>"typo" : "typo" + +const d = import('./0', { with: {} }) +>d : Promise +>import('./0', { with: {} }) : Promise +>'./0' : "./0" +>{ with: {} } : { with: {}; } +>with : {} +>{} : {} + +const dd = import('./0', {}) +>dd : Promise +>import('./0', {}) : Promise +>'./0' : "./0" +>{} : {} + +declare function foo(): any; +>foo : () => any + +const e = import('./0', foo()) +>e : Promise +>import('./0', foo()) : Promise +>'./0' : "./0" +>foo() : any +>foo : () => any + +const f = import() +>f : Promise +>import() : Promise + +const g = import('./0', {}, {}) +>g : Promise +>import('./0', {}, {}) : Promise +>'./0' : "./0" +>{} : {} +>{} : {} + +const h = import('./0', { with: { type: "json" }},) +>h : Promise +>import('./0', { with: { type: "json" }},) : Promise +>'./0' : "./0" +>{ with: { type: "json" }} : { with: { type: string; }; } +>with : { type: string; } +>{ type: "json" } : { type: string; } +>type : string +>"json" : "json" + diff --git a/tests/baselines/reference/importAttributes1(module=esnext).errors.txt b/tests/baselines/reference/importAttributes1(module=esnext).errors.txt new file mode 100644 index 0000000000000..95c52f3bcd235 --- /dev/null +++ b/tests/baselines/reference/importAttributes1(module=esnext).errors.txt @@ -0,0 +1,39 @@ +3.ts(8,11): message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments +3.ts(9,11): message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments + + +==== 0.ts (0 errors) ==== + export const a = 1; + export const b = 2; + +==== 1.ts (0 errors) ==== + import './0' with { type: "json" } + import { a, b } from './0' with { "type": "json" } + import * as foo from './0' with { type: "json" } + a; + b; + foo.a; + foo.b; +==== 2.ts (0 errors) ==== + import { a, b } from './0' with {} + import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } + a; + b; + c; + d; +==== 3.ts (2 errors) ==== + const a = import('./0') + const b = import('./0', { with: { type: "json" } }) + const c = import('./0', { with: { type: "json", ttype: "typo" } }) + const d = import('./0', { with: {} }) + const dd = import('./0', {}) + declare function foo(): any; + const e = import('./0', foo()) + const f = import() + ~~~~~~~~ +!!! message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments + const g = import('./0', {}, {}) + ~~~~~~~~~~~~~~~~~~~~~ +!!! message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments + const h = import('./0', { with: { type: "json" }},) + \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes1(module=esnext).js b/tests/baselines/reference/importAttributes1(module=esnext).js new file mode 100644 index 0000000000000..6a3d38f34e0d4 --- /dev/null +++ b/tests/baselines/reference/importAttributes1(module=esnext).js @@ -0,0 +1,82 @@ +//// [tests/cases/conformance/importAttributes/importAttributes1.ts] //// + +//// [0.ts] +export const a = 1; +export const b = 2; + +//// [1.ts] +import './0' with { type: "json" } +import { a, b } from './0' with { "type": "json" } +import * as foo from './0' with { type: "json" } +a; +b; +foo.a; +foo.b; +//// [2.ts] +import { a, b } from './0' with {} +import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } +a; +b; +c; +d; +//// [3.ts] +const a = import('./0') +const b = import('./0', { with: { type: "json" } }) +const c = import('./0', { with: { type: "json", ttype: "typo" } }) +const d = import('./0', { with: {} }) +const dd = import('./0', {}) +declare function foo(): any; +const e = import('./0', foo()) +const f = import() +const g = import('./0', {}, {}) +const h = import('./0', { with: { type: "json" }},) + + +//// [0.js] +export const a = 1; +export const b = 2; +//// [1.js] +import './0' with { type: "json" }; +import { a, b } from './0' with { "type": "json" }; +import * as foo from './0' with { type: "json" }; +a; +b; +foo.a; +foo.b; +//// [2.js] +import { a, b } from './0' with {}; +import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" }; +a; +b; +c; +d; +//// [3.js] +const a = import('./0'); +const b = import('./0', { with: { type: "json" } }); +const c = import('./0', { with: { type: "json", ttype: "typo" } }); +const d = import('./0', { with: {} }); +const dd = import('./0', {}); +const e = import('./0', foo()); +const f = import(); +const g = import('./0', {}, {}); +const h = import('./0', { with: { type: "json" } }); + + +//// [0.d.ts] +export declare const a = 1; +export declare const b = 2; +//// [1.d.ts] +import './0'; +//// [2.d.ts] +export {}; +//// [3.d.ts] +declare const a: Promise; +declare const b: Promise; +declare const c: Promise; +declare const d: Promise; +declare const dd: Promise; +declare function foo(): any; +declare const e: Promise; +declare const f: Promise; +declare const g: Promise; +declare const h: Promise; diff --git a/tests/baselines/reference/importAttributes1(module=esnext).symbols b/tests/baselines/reference/importAttributes1(module=esnext).symbols new file mode 100644 index 0000000000000..65dc9f66362e7 --- /dev/null +++ b/tests/baselines/reference/importAttributes1(module=esnext).symbols @@ -0,0 +1,105 @@ +//// [tests/cases/conformance/importAttributes/importAttributes1.ts] //// + +=== 0.ts === +export const a = 1; +>a : Symbol(a, Decl(0.ts, 0, 12)) + +export const b = 2; +>b : Symbol(b, Decl(0.ts, 1, 12)) + +=== 1.ts === +import './0' with { type: "json" } +import { a, b } from './0' with { "type": "json" } +>a : Symbol(a, Decl(1.ts, 1, 8)) +>b : Symbol(b, Decl(1.ts, 1, 11)) + +import * as foo from './0' with { type: "json" } +>foo : Symbol(foo, Decl(1.ts, 2, 6)) + +a; +>a : Symbol(a, Decl(1.ts, 1, 8)) + +b; +>b : Symbol(b, Decl(1.ts, 1, 11)) + +foo.a; +>foo.a : Symbol(a, Decl(0.ts, 0, 12)) +>foo : Symbol(foo, Decl(1.ts, 2, 6)) +>a : Symbol(a, Decl(0.ts, 0, 12)) + +foo.b; +>foo.b : Symbol(b, Decl(0.ts, 1, 12)) +>foo : Symbol(foo, Decl(1.ts, 2, 6)) +>b : Symbol(b, Decl(0.ts, 1, 12)) + +=== 2.ts === +import { a, b } from './0' with {} +>a : Symbol(a, Decl(2.ts, 0, 8)) +>b : Symbol(b, Decl(2.ts, 0, 11)) + +import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } +>a : Symbol(a, Decl(0.ts, 0, 12)) +>c : Symbol(c, Decl(2.ts, 1, 8)) +>b : Symbol(b, Decl(0.ts, 1, 12)) +>d : Symbol(d, Decl(2.ts, 1, 16)) + +a; +>a : Symbol(a, Decl(2.ts, 0, 8)) + +b; +>b : Symbol(b, Decl(2.ts, 0, 11)) + +c; +>c : Symbol(c, Decl(2.ts, 1, 8)) + +d; +>d : Symbol(d, Decl(2.ts, 1, 16)) + +=== 3.ts === +const a = import('./0') +>a : Symbol(a, Decl(3.ts, 0, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) + +const b = import('./0', { with: { type: "json" } }) +>b : Symbol(b, Decl(3.ts, 1, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) +>with : Symbol(with, Decl(3.ts, 1, 25)) +>type : Symbol(type, Decl(3.ts, 1, 33)) + +const c = import('./0', { with: { type: "json", ttype: "typo" } }) +>c : Symbol(c, Decl(3.ts, 2, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) +>with : Symbol(with, Decl(3.ts, 2, 25)) +>type : Symbol(type, Decl(3.ts, 2, 33)) +>ttype : Symbol(ttype, Decl(3.ts, 2, 47)) + +const d = import('./0', { with: {} }) +>d : Symbol(d, Decl(3.ts, 3, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) +>with : Symbol(with, Decl(3.ts, 3, 25)) + +const dd = import('./0', {}) +>dd : Symbol(dd, Decl(3.ts, 4, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) + +declare function foo(): any; +>foo : Symbol(foo, Decl(3.ts, 4, 28)) + +const e = import('./0', foo()) +>e : Symbol(e, Decl(3.ts, 6, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) +>foo : Symbol(foo, Decl(3.ts, 4, 28)) + +const f = import() +>f : Symbol(f, Decl(3.ts, 7, 5)) + +const g = import('./0', {}, {}) +>g : Symbol(g, Decl(3.ts, 8, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) + +const h = import('./0', { with: { type: "json" }},) +>h : Symbol(h, Decl(3.ts, 9, 5)) +>'./0' : Symbol("0", Decl(0.ts, 0, 0)) +>with : Symbol(with, Decl(3.ts, 9, 25)) +>type : Symbol(type, Decl(3.ts, 9, 33)) + diff --git a/tests/baselines/reference/importAttributes1(module=esnext).types b/tests/baselines/reference/importAttributes1(module=esnext).types new file mode 100644 index 0000000000000..fb1da06ede0e4 --- /dev/null +++ b/tests/baselines/reference/importAttributes1(module=esnext).types @@ -0,0 +1,138 @@ +//// [tests/cases/conformance/importAttributes/importAttributes1.ts] //// + +=== 0.ts === +export const a = 1; +>a : 1 +>1 : 1 + +export const b = 2; +>b : 2 +>2 : 2 + +=== 1.ts === +import './0' with { type: "json" } +>type : any + +import { a, b } from './0' with { "type": "json" } +>a : 1 +>b : 2 + +import * as foo from './0' with { type: "json" } +>foo : typeof foo +>type : any + +a; +>a : 1 + +b; +>b : 2 + +foo.a; +>foo.a : 1 +>foo : typeof foo +>a : 1 + +foo.b; +>foo.b : 2 +>foo : typeof foo +>b : 2 + +=== 2.ts === +import { a, b } from './0' with {} +>a : 1 +>b : 2 + +import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } +>a : 1 +>c : 1 +>b : 2 +>d : 2 +>a : any +>b : any +>c : any + +a; +>a : 1 + +b; +>b : 2 + +c; +>c : 1 + +d; +>d : 2 + +=== 3.ts === +const a = import('./0') +>a : Promise +>import('./0') : Promise +>'./0' : "./0" + +const b = import('./0', { with: { type: "json" } }) +>b : Promise +>import('./0', { with: { type: "json" } }) : Promise +>'./0' : "./0" +>{ with: { type: "json" } } : { with: { type: string; }; } +>with : { type: string; } +>{ type: "json" } : { type: string; } +>type : string +>"json" : "json" + +const c = import('./0', { with: { type: "json", ttype: "typo" } }) +>c : Promise +>import('./0', { with: { type: "json", ttype: "typo" } }) : Promise +>'./0' : "./0" +>{ with: { type: "json", ttype: "typo" } } : { with: { type: string; ttype: string; }; } +>with : { type: string; ttype: string; } +>{ type: "json", ttype: "typo" } : { type: string; ttype: string; } +>type : string +>"json" : "json" +>ttype : string +>"typo" : "typo" + +const d = import('./0', { with: {} }) +>d : Promise +>import('./0', { with: {} }) : Promise +>'./0' : "./0" +>{ with: {} } : { with: {}; } +>with : {} +>{} : {} + +const dd = import('./0', {}) +>dd : Promise +>import('./0', {}) : Promise +>'./0' : "./0" +>{} : {} + +declare function foo(): any; +>foo : () => any + +const e = import('./0', foo()) +>e : Promise +>import('./0', foo()) : Promise +>'./0' : "./0" +>foo() : any +>foo : () => any + +const f = import() +>f : Promise +>import() : Promise + +const g = import('./0', {}, {}) +>g : Promise +>import('./0', {}, {}) : Promise +>'./0' : "./0" +>{} : {} +>{} : {} + +const h = import('./0', { with: { type: "json" }},) +>h : Promise +>import('./0', { with: { type: "json" }},) : Promise +>'./0' : "./0" +>{ with: { type: "json" }} : { with: { type: string; }; } +>with : { type: string; } +>{ type: "json" } : { type: string; } +>type : string +>"json" : "json" + diff --git a/tests/baselines/reference/importAttributes2(module=commonjs).errors.txt b/tests/baselines/reference/importAttributes2(module=commonjs).errors.txt new file mode 100644 index 0000000000000..0d4945bf1e550 --- /dev/null +++ b/tests/baselines/reference/importAttributes2(module=commonjs).errors.txt @@ -0,0 +1,34 @@ +1.ts(1,22): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +1.ts(3,21): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +1.ts(4,27): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + + +==== 0.ts (0 errors) ==== + export const a = 1; + export const b = 2; + +==== 1.ts (4 errors) ==== + export {} from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + export { a, b } from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + export * from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + export * as ns from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + +==== 2.ts (2 errors) ==== + export { a, b } from './0' with {} + ~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + export { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes2(module=commonjs).js b/tests/baselines/reference/importAttributes2(module=commonjs).js new file mode 100644 index 0000000000000..98da1bd8edc06 --- /dev/null +++ b/tests/baselines/reference/importAttributes2(module=commonjs).js @@ -0,0 +1,69 @@ +//// [tests/cases/conformance/importAttributes/importAttributes2.ts] //// + +//// [0.ts] +export const a = 1; +export const b = 2; + +//// [1.ts] +export {} from './0' with { type: "json" } +export { a, b } from './0' with { type: "json" } +export * from './0' with { type: "json" } +export * as ns from './0' with { type: "json" } + +//// [2.ts] +export { a, b } from './0' with {} +export { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } + + +//// [0.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = 1; +exports.b = 2; +//// [1.js] +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ns = exports.b = exports.a = void 0; +var _0_1 = require("./0"); +Object.defineProperty(exports, "a", { enumerable: true, get: function () { return _0_1.a; } }); +Object.defineProperty(exports, "b", { enumerable: true, get: function () { return _0_1.b; } }); +__exportStar(require("./0"), exports); +exports.ns = require("./0"); +//// [2.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.d = exports.c = exports.b = exports.a = void 0; +var _0_1 = require("./0"); +Object.defineProperty(exports, "a", { enumerable: true, get: function () { return _0_1.a; } }); +Object.defineProperty(exports, "b", { enumerable: true, get: function () { return _0_1.b; } }); +var _0_2 = require("./0"); +Object.defineProperty(exports, "c", { enumerable: true, get: function () { return _0_2.a; } }); +Object.defineProperty(exports, "d", { enumerable: true, get: function () { return _0_2.b; } }); + + +//// [0.d.ts] +export declare const a = 1; +export declare const b = 2; +//// [1.d.ts] +export {} from './0'; +export { a, b } from './0'; +export * from './0'; +export * as ns from './0'; +//// [2.d.ts] +export { a, b } from './0'; +export { a as c, b as d } from './0'; diff --git a/tests/baselines/reference/importAttributes2(module=commonjs).symbols b/tests/baselines/reference/importAttributes2(module=commonjs).symbols new file mode 100644 index 0000000000000..78ea8b056c56c --- /dev/null +++ b/tests/baselines/reference/importAttributes2(module=commonjs).symbols @@ -0,0 +1,30 @@ +//// [tests/cases/conformance/importAttributes/importAttributes2.ts] //// + +=== 0.ts === +export const a = 1; +>a : Symbol(a, Decl(0.ts, 0, 12)) + +export const b = 2; +>b : Symbol(b, Decl(0.ts, 1, 12)) + +=== 1.ts === +export {} from './0' with { type: "json" } +export { a, b } from './0' with { type: "json" } +>a : Symbol(a, Decl(1.ts, 1, 8)) +>b : Symbol(b, Decl(1.ts, 1, 11)) + +export * from './0' with { type: "json" } +export * as ns from './0' with { type: "json" } +>ns : Symbol(ns, Decl(1.ts, 3, 6)) + +=== 2.ts === +export { a, b } from './0' with {} +>a : Symbol(a, Decl(2.ts, 0, 8)) +>b : Symbol(b, Decl(2.ts, 0, 11)) + +export { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } +>a : Symbol(a, Decl(0.ts, 0, 12)) +>c : Symbol(c, Decl(2.ts, 1, 8)) +>b : Symbol(b, Decl(0.ts, 1, 12)) +>d : Symbol(d, Decl(2.ts, 1, 16)) + diff --git a/tests/baselines/reference/importAttributes2(module=commonjs).types b/tests/baselines/reference/importAttributes2(module=commonjs).types new file mode 100644 index 0000000000000..33f423f35d07d --- /dev/null +++ b/tests/baselines/reference/importAttributes2(module=commonjs).types @@ -0,0 +1,41 @@ +//// [tests/cases/conformance/importAttributes/importAttributes2.ts] //// + +=== 0.ts === +export const a = 1; +>a : 1 +>1 : 1 + +export const b = 2; +>b : 2 +>2 : 2 + +=== 1.ts === +export {} from './0' with { type: "json" } +>type : any + +export { a, b } from './0' with { type: "json" } +>a : 1 +>b : 2 +>type : any + +export * from './0' with { type: "json" } +>type : any + +export * as ns from './0' with { type: "json" } +>ns : typeof import("0") +>type : any + +=== 2.ts === +export { a, b } from './0' with {} +>a : 1 +>b : 2 + +export { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } +>a : 1 +>c : 1 +>b : 2 +>d : 2 +>a : any +>b : any +>c : any + diff --git a/tests/baselines/reference/importAttributes2(module=es2015).errors.txt b/tests/baselines/reference/importAttributes2(module=es2015).errors.txt new file mode 100644 index 0000000000000..0d4945bf1e550 --- /dev/null +++ b/tests/baselines/reference/importAttributes2(module=es2015).errors.txt @@ -0,0 +1,34 @@ +1.ts(1,22): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +1.ts(2,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +1.ts(3,21): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +1.ts(4,27): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +2.ts(1,28): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +2.ts(2,38): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + + +==== 0.ts (0 errors) ==== + export const a = 1; + export const b = 2; + +==== 1.ts (4 errors) ==== + export {} from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + export { a, b } from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + export * from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + export * as ns from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + +==== 2.ts (2 errors) ==== + export { a, b } from './0' with {} + ~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + export { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes2(module=es2015).js b/tests/baselines/reference/importAttributes2(module=es2015).js new file mode 100644 index 0000000000000..b3105648f5715 --- /dev/null +++ b/tests/baselines/reference/importAttributes2(module=es2015).js @@ -0,0 +1,41 @@ +//// [tests/cases/conformance/importAttributes/importAttributes2.ts] //// + +//// [0.ts] +export const a = 1; +export const b = 2; + +//// [1.ts] +export {} from './0' with { type: "json" } +export { a, b } from './0' with { type: "json" } +export * from './0' with { type: "json" } +export * as ns from './0' with { type: "json" } + +//// [2.ts] +export { a, b } from './0' with {} +export { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } + + +//// [0.js] +export const a = 1; +export const b = 2; +//// [1.js] +export { a, b } from './0' with { type: "json" }; +export * from './0' with { type: "json" }; +import * as ns_1 from './0' with { type: "json" }; +export { ns_1 as ns }; +//// [2.js] +export { a, b } from './0' with {}; +export { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" }; + + +//// [0.d.ts] +export declare const a = 1; +export declare const b = 2; +//// [1.d.ts] +export {} from './0'; +export { a, b } from './0'; +export * from './0'; +export * as ns from './0'; +//// [2.d.ts] +export { a, b } from './0'; +export { a as c, b as d } from './0'; diff --git a/tests/baselines/reference/importAttributes2(module=es2015).symbols b/tests/baselines/reference/importAttributes2(module=es2015).symbols new file mode 100644 index 0000000000000..78ea8b056c56c --- /dev/null +++ b/tests/baselines/reference/importAttributes2(module=es2015).symbols @@ -0,0 +1,30 @@ +//// [tests/cases/conformance/importAttributes/importAttributes2.ts] //// + +=== 0.ts === +export const a = 1; +>a : Symbol(a, Decl(0.ts, 0, 12)) + +export const b = 2; +>b : Symbol(b, Decl(0.ts, 1, 12)) + +=== 1.ts === +export {} from './0' with { type: "json" } +export { a, b } from './0' with { type: "json" } +>a : Symbol(a, Decl(1.ts, 1, 8)) +>b : Symbol(b, Decl(1.ts, 1, 11)) + +export * from './0' with { type: "json" } +export * as ns from './0' with { type: "json" } +>ns : Symbol(ns, Decl(1.ts, 3, 6)) + +=== 2.ts === +export { a, b } from './0' with {} +>a : Symbol(a, Decl(2.ts, 0, 8)) +>b : Symbol(b, Decl(2.ts, 0, 11)) + +export { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } +>a : Symbol(a, Decl(0.ts, 0, 12)) +>c : Symbol(c, Decl(2.ts, 1, 8)) +>b : Symbol(b, Decl(0.ts, 1, 12)) +>d : Symbol(d, Decl(2.ts, 1, 16)) + diff --git a/tests/baselines/reference/importAttributes2(module=es2015).types b/tests/baselines/reference/importAttributes2(module=es2015).types new file mode 100644 index 0000000000000..33f423f35d07d --- /dev/null +++ b/tests/baselines/reference/importAttributes2(module=es2015).types @@ -0,0 +1,41 @@ +//// [tests/cases/conformance/importAttributes/importAttributes2.ts] //// + +=== 0.ts === +export const a = 1; +>a : 1 +>1 : 1 + +export const b = 2; +>b : 2 +>2 : 2 + +=== 1.ts === +export {} from './0' with { type: "json" } +>type : any + +export { a, b } from './0' with { type: "json" } +>a : 1 +>b : 2 +>type : any + +export * from './0' with { type: "json" } +>type : any + +export * as ns from './0' with { type: "json" } +>ns : typeof import("0") +>type : any + +=== 2.ts === +export { a, b } from './0' with {} +>a : 1 +>b : 2 + +export { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } +>a : 1 +>c : 1 +>b : 2 +>d : 2 +>a : any +>b : any +>c : any + diff --git a/tests/baselines/reference/importAttributes2(module=esnext).js b/tests/baselines/reference/importAttributes2(module=esnext).js new file mode 100644 index 0000000000000..954e66a8db191 --- /dev/null +++ b/tests/baselines/reference/importAttributes2(module=esnext).js @@ -0,0 +1,40 @@ +//// [tests/cases/conformance/importAttributes/importAttributes2.ts] //// + +//// [0.ts] +export const a = 1; +export const b = 2; + +//// [1.ts] +export {} from './0' with { type: "json" } +export { a, b } from './0' with { type: "json" } +export * from './0' with { type: "json" } +export * as ns from './0' with { type: "json" } + +//// [2.ts] +export { a, b } from './0' with {} +export { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } + + +//// [0.js] +export const a = 1; +export const b = 2; +//// [1.js] +export { a, b } from './0' with { type: "json" }; +export * from './0' with { type: "json" }; +export * as ns from './0' with { type: "json" }; +//// [2.js] +export { a, b } from './0' with {}; +export { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" }; + + +//// [0.d.ts] +export declare const a = 1; +export declare const b = 2; +//// [1.d.ts] +export {} from './0'; +export { a, b } from './0'; +export * from './0'; +export * as ns from './0'; +//// [2.d.ts] +export { a, b } from './0'; +export { a as c, b as d } from './0'; diff --git a/tests/baselines/reference/importAttributes2(module=esnext).symbols b/tests/baselines/reference/importAttributes2(module=esnext).symbols new file mode 100644 index 0000000000000..78ea8b056c56c --- /dev/null +++ b/tests/baselines/reference/importAttributes2(module=esnext).symbols @@ -0,0 +1,30 @@ +//// [tests/cases/conformance/importAttributes/importAttributes2.ts] //// + +=== 0.ts === +export const a = 1; +>a : Symbol(a, Decl(0.ts, 0, 12)) + +export const b = 2; +>b : Symbol(b, Decl(0.ts, 1, 12)) + +=== 1.ts === +export {} from './0' with { type: "json" } +export { a, b } from './0' with { type: "json" } +>a : Symbol(a, Decl(1.ts, 1, 8)) +>b : Symbol(b, Decl(1.ts, 1, 11)) + +export * from './0' with { type: "json" } +export * as ns from './0' with { type: "json" } +>ns : Symbol(ns, Decl(1.ts, 3, 6)) + +=== 2.ts === +export { a, b } from './0' with {} +>a : Symbol(a, Decl(2.ts, 0, 8)) +>b : Symbol(b, Decl(2.ts, 0, 11)) + +export { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } +>a : Symbol(a, Decl(0.ts, 0, 12)) +>c : Symbol(c, Decl(2.ts, 1, 8)) +>b : Symbol(b, Decl(0.ts, 1, 12)) +>d : Symbol(d, Decl(2.ts, 1, 16)) + diff --git a/tests/baselines/reference/importAttributes2(module=esnext).types b/tests/baselines/reference/importAttributes2(module=esnext).types new file mode 100644 index 0000000000000..45b7e6e2b47ea --- /dev/null +++ b/tests/baselines/reference/importAttributes2(module=esnext).types @@ -0,0 +1,41 @@ +//// [tests/cases/conformance/importAttributes/importAttributes2.ts] //// + +=== 0.ts === +export const a = 1; +>a : 1 +>1 : 1 + +export const b = 2; +>b : 2 +>2 : 2 + +=== 1.ts === +export {} from './0' with { type: "json" } +>type : error + +export { a, b } from './0' with { type: "json" } +>a : 1 +>b : 2 +>type : error + +export * from './0' with { type: "json" } +>type : error + +export * as ns from './0' with { type: "json" } +>ns : typeof import("0") +>type : error + +=== 2.ts === +export { a, b } from './0' with {} +>a : 1 +>b : 2 + +export { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } +>a : 1 +>c : 1 +>b : 2 +>d : 2 +>a : error +>b : error +>c : error + diff --git a/tests/baselines/reference/importAttributes3(module=es2015).errors.txt b/tests/baselines/reference/importAttributes3(module=es2015).errors.txt new file mode 100644 index 0000000000000..f34fea44998ec --- /dev/null +++ b/tests/baselines/reference/importAttributes3(module=es2015).errors.txt @@ -0,0 +1,25 @@ +1.ts(1,27): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +1.ts(2,30): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +2.ts(1,31): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +2.ts(2,33): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + + +==== 0.ts (0 errors) ==== + export interface I { } + +==== 1.ts (2 errors) ==== + export type {} from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + export type { I } from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + +==== 2.ts (2 errors) ==== + import type { I } from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + import type * as foo from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes3(module=es2015).js b/tests/baselines/reference/importAttributes3(module=es2015).js new file mode 100644 index 0000000000000..493e570835215 --- /dev/null +++ b/tests/baselines/reference/importAttributes3(module=es2015).js @@ -0,0 +1,30 @@ +//// [tests/cases/conformance/importAttributes/importAttributes3.ts] //// + +//// [0.ts] +export interface I { } + +//// [1.ts] +export type {} from './0' with { type: "json" } +export type { I } from './0' with { type: "json" } + +//// [2.ts] +import type { I } from './0' with { type: "json" } +import type * as foo from './0' with { type: "json" } + + +//// [0.js] +export {}; +//// [1.js] +export {}; +//// [2.js] +export {}; + + +//// [0.d.ts] +export interface I { +} +//// [1.d.ts] +export type {} from './0'; +export type { I } from './0'; +//// [2.d.ts] +export {}; diff --git a/tests/baselines/reference/importAttributes3(module=es2015).symbols b/tests/baselines/reference/importAttributes3(module=es2015).symbols new file mode 100644 index 0000000000000..92dcfb705744c --- /dev/null +++ b/tests/baselines/reference/importAttributes3(module=es2015).symbols @@ -0,0 +1,18 @@ +//// [tests/cases/conformance/importAttributes/importAttributes3.ts] //// + +=== 0.ts === +export interface I { } +>I : Symbol(I, Decl(0.ts, 0, 0)) + +=== 1.ts === +export type {} from './0' with { type: "json" } +export type { I } from './0' with { type: "json" } +>I : Symbol(I, Decl(1.ts, 1, 13)) + +=== 2.ts === +import type { I } from './0' with { type: "json" } +>I : Symbol(I, Decl(2.ts, 0, 13)) + +import type * as foo from './0' with { type: "json" } +>foo : Symbol(foo, Decl(2.ts, 1, 11)) + diff --git a/tests/baselines/reference/importAttributes3(module=es2015).types b/tests/baselines/reference/importAttributes3(module=es2015).types new file mode 100644 index 0000000000000..c0dc4e66342e5 --- /dev/null +++ b/tests/baselines/reference/importAttributes3(module=es2015).types @@ -0,0 +1,23 @@ +//// [tests/cases/conformance/importAttributes/importAttributes3.ts] //// + +=== 0.ts === + +export interface I { } + +=== 1.ts === +export type {} from './0' with { type: "json" } +>type : any + +export type { I } from './0' with { type: "json" } +>I : import("0").I +>type : any + +=== 2.ts === +import type { I } from './0' with { type: "json" } +>I : I +>type : any + +import type * as foo from './0' with { type: "json" } +>foo : typeof foo +>type : any + diff --git a/tests/baselines/reference/importAttributes3(module=esnext).errors.txt b/tests/baselines/reference/importAttributes3(module=esnext).errors.txt new file mode 100644 index 0000000000000..c6b8edc12f183 --- /dev/null +++ b/tests/baselines/reference/importAttributes3(module=esnext).errors.txt @@ -0,0 +1,25 @@ +1.ts(1,27): error TS2857: Import attributes cannot be used with type-only imports or exports. +1.ts(2,30): error TS2857: Import attributes cannot be used with type-only imports or exports. +2.ts(1,31): error TS2857: Import attributes cannot be used with type-only imports or exports. +2.ts(2,33): error TS2857: Import attributes cannot be used with type-only imports or exports. + + +==== 0.ts (0 errors) ==== + export interface I { } + +==== 1.ts (2 errors) ==== + export type {} from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2857: Import attributes cannot be used with type-only imports or exports. + export type { I } from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2857: Import attributes cannot be used with type-only imports or exports. + +==== 2.ts (2 errors) ==== + import type { I } from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2857: Import attributes cannot be used with type-only imports or exports. + import type * as foo from './0' with { type: "json" } + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2857: Import attributes cannot be used with type-only imports or exports. + \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes3(module=esnext).js b/tests/baselines/reference/importAttributes3(module=esnext).js new file mode 100644 index 0000000000000..493e570835215 --- /dev/null +++ b/tests/baselines/reference/importAttributes3(module=esnext).js @@ -0,0 +1,30 @@ +//// [tests/cases/conformance/importAttributes/importAttributes3.ts] //// + +//// [0.ts] +export interface I { } + +//// [1.ts] +export type {} from './0' with { type: "json" } +export type { I } from './0' with { type: "json" } + +//// [2.ts] +import type { I } from './0' with { type: "json" } +import type * as foo from './0' with { type: "json" } + + +//// [0.js] +export {}; +//// [1.js] +export {}; +//// [2.js] +export {}; + + +//// [0.d.ts] +export interface I { +} +//// [1.d.ts] +export type {} from './0'; +export type { I } from './0'; +//// [2.d.ts] +export {}; diff --git a/tests/baselines/reference/importAttributes3(module=esnext).symbols b/tests/baselines/reference/importAttributes3(module=esnext).symbols new file mode 100644 index 0000000000000..92dcfb705744c --- /dev/null +++ b/tests/baselines/reference/importAttributes3(module=esnext).symbols @@ -0,0 +1,18 @@ +//// [tests/cases/conformance/importAttributes/importAttributes3.ts] //// + +=== 0.ts === +export interface I { } +>I : Symbol(I, Decl(0.ts, 0, 0)) + +=== 1.ts === +export type {} from './0' with { type: "json" } +export type { I } from './0' with { type: "json" } +>I : Symbol(I, Decl(1.ts, 1, 13)) + +=== 2.ts === +import type { I } from './0' with { type: "json" } +>I : Symbol(I, Decl(2.ts, 0, 13)) + +import type * as foo from './0' with { type: "json" } +>foo : Symbol(foo, Decl(2.ts, 1, 11)) + diff --git a/tests/baselines/reference/importAttributes3(module=esnext).types b/tests/baselines/reference/importAttributes3(module=esnext).types new file mode 100644 index 0000000000000..c0dc4e66342e5 --- /dev/null +++ b/tests/baselines/reference/importAttributes3(module=esnext).types @@ -0,0 +1,23 @@ +//// [tests/cases/conformance/importAttributes/importAttributes3.ts] //// + +=== 0.ts === + +export interface I { } + +=== 1.ts === +export type {} from './0' with { type: "json" } +>type : any + +export type { I } from './0' with { type: "json" } +>I : import("0").I +>type : any + +=== 2.ts === +import type { I } from './0' with { type: "json" } +>I : I +>type : any + +import type * as foo from './0' with { type: "json" } +>foo : typeof foo +>type : any + diff --git a/tests/baselines/reference/importAttributes4.errors.txt b/tests/baselines/reference/importAttributes4.errors.txt new file mode 100644 index 0000000000000..8a3eb811f4300 --- /dev/null +++ b/tests/baselines/reference/importAttributes4.errors.txt @@ -0,0 +1,10 @@ +importAttributes4.ts(1,20): error TS2307: Cannot find module './first' or its corresponding type declarations. +importAttributes4.ts(1,34): error TS1005: '{' expected. + + +==== importAttributes4.ts (2 errors) ==== + import * as f from "./first" with + ~~~~~~~~~ +!!! error TS2307: Cannot find module './first' or its corresponding type declarations. + +!!! error TS1005: '{' expected. \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes4.js b/tests/baselines/reference/importAttributes4.js new file mode 100644 index 0000000000000..9b84ed6efd16e --- /dev/null +++ b/tests/baselines/reference/importAttributes4.js @@ -0,0 +1,8 @@ +//// [tests/cases/conformance/importAttributes/importAttributes4.ts] //// + +//// [importAttributes4.ts] +import * as f from "./first" with + +//// [importAttributes4.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/importAttributes4.symbols b/tests/baselines/reference/importAttributes4.symbols new file mode 100644 index 0000000000000..786bd1a86ccc6 --- /dev/null +++ b/tests/baselines/reference/importAttributes4.symbols @@ -0,0 +1,6 @@ +//// [tests/cases/conformance/importAttributes/importAttributes4.ts] //// + +=== importAttributes4.ts === +import * as f from "./first" with +>f : Symbol(f, Decl(importAttributes4.ts, 0, 6)) + diff --git a/tests/baselines/reference/importAttributes4.types b/tests/baselines/reference/importAttributes4.types new file mode 100644 index 0000000000000..d95e9509ee362 --- /dev/null +++ b/tests/baselines/reference/importAttributes4.types @@ -0,0 +1,6 @@ +//// [tests/cases/conformance/importAttributes/importAttributes4.ts] //// + +=== importAttributes4.ts === +import * as f from "./first" with +>f : any + diff --git a/tests/baselines/reference/importAttributes5.errors.txt b/tests/baselines/reference/importAttributes5.errors.txt new file mode 100644 index 0000000000000..8ad480f8b033c --- /dev/null +++ b/tests/baselines/reference/importAttributes5.errors.txt @@ -0,0 +1,11 @@ +importAttributes5.ts(1,20): error TS2307: Cannot find module './first' or its corresponding type declarations. +importAttributes5.ts(1,36): error TS1005: '}' expected. + + +==== importAttributes5.ts (2 errors) ==== + import * as f from "./first" with { + ~~~~~~~~~ +!!! error TS2307: Cannot find module './first' or its corresponding type declarations. + +!!! error TS1005: '}' expected. +!!! related TS1007 importAttributes5.ts:1:35: The parser expected to find a '}' to match the '{' token here. \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes5.js b/tests/baselines/reference/importAttributes5.js new file mode 100644 index 0000000000000..959d12d1cb3e6 --- /dev/null +++ b/tests/baselines/reference/importAttributes5.js @@ -0,0 +1,8 @@ +//// [tests/cases/conformance/importAttributes/importAttributes5.ts] //// + +//// [importAttributes5.ts] +import * as f from "./first" with { + +//// [importAttributes5.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/importAttributes5.symbols b/tests/baselines/reference/importAttributes5.symbols new file mode 100644 index 0000000000000..9fbc386805984 --- /dev/null +++ b/tests/baselines/reference/importAttributes5.symbols @@ -0,0 +1,6 @@ +//// [tests/cases/conformance/importAttributes/importAttributes5.ts] //// + +=== importAttributes5.ts === +import * as f from "./first" with { +>f : Symbol(f, Decl(importAttributes5.ts, 0, 6)) + diff --git a/tests/baselines/reference/importAttributes5.types b/tests/baselines/reference/importAttributes5.types new file mode 100644 index 0000000000000..edefbf59c0d88 --- /dev/null +++ b/tests/baselines/reference/importAttributes5.types @@ -0,0 +1,6 @@ +//// [tests/cases/conformance/importAttributes/importAttributes5.ts] //// + +=== importAttributes5.ts === +import * as f from "./first" with { +>f : any + diff --git a/tests/baselines/reference/importAttributes6.errors.txt b/tests/baselines/reference/importAttributes6.errors.txt new file mode 100644 index 0000000000000..18fa0ba6b693d --- /dev/null +++ b/tests/baselines/reference/importAttributes6.errors.txt @@ -0,0 +1,28 @@ +mod.mts(1,51): error TS2858: Import attribute values must be string literal expressions. +mod.mts(2,51): error TS2858: Import attribute values must be string literal expressions. +mod.mts(3,51): error TS2858: Import attribute values must be string literal expressions. +mod.mts(4,51): error TS2858: Import attribute values must be string literal expressions. +mod.mts(5,51): error TS2858: Import attribute values must be string literal expressions. +mod.mts(6,65): error TS2858: Import attribute values must be string literal expressions. + + +==== mod.mts (6 errors) ==== + import * as thing1 from "./mod.mjs" with { field: 0 }; + ~ +!!! error TS2858: Import attribute values must be string literal expressions. + import * as thing2 from "./mod.mjs" with { field: `a` }; + ~~~ +!!! error TS2858: Import attribute values must be string literal expressions. + import * as thing3 from "./mod.mjs" with { field: /a/g }; + ~~~~ +!!! error TS2858: Import attribute values must be string literal expressions. + import * as thing4 from "./mod.mjs" with { field: ["a"] }; + ~~~~~ +!!! error TS2858: Import attribute values must be string literal expressions. + import * as thing5 from "./mod.mjs" with { field: { a: 0 } }; + ~~~~~~~~ +!!! error TS2858: Import attribute values must be string literal expressions. + import * as thing6 from "./mod.mjs" with { type: "json", field: 0..toString() }; + ~~~~~~~~~~~~~ +!!! error TS2858: Import attribute values must be string literal expressions. + \ No newline at end of file diff --git a/tests/baselines/reference/importAttributes6.js b/tests/baselines/reference/importAttributes6.js new file mode 100644 index 0000000000000..6d346c55c8e5a --- /dev/null +++ b/tests/baselines/reference/importAttributes6.js @@ -0,0 +1,13 @@ +//// [tests/cases/conformance/importAttributes/importAttributes6.ts] //// + +//// [mod.mts] +import * as thing1 from "./mod.mjs" with { field: 0 }; +import * as thing2 from "./mod.mjs" with { field: `a` }; +import * as thing3 from "./mod.mjs" with { field: /a/g }; +import * as thing4 from "./mod.mjs" with { field: ["a"] }; +import * as thing5 from "./mod.mjs" with { field: { a: 0 } }; +import * as thing6 from "./mod.mjs" with { type: "json", field: 0..toString() }; + + +//// [mod.mjs] +export {}; diff --git a/tests/baselines/reference/importAttributes6.symbols b/tests/baselines/reference/importAttributes6.symbols new file mode 100644 index 0000000000000..b46ae41350e9a --- /dev/null +++ b/tests/baselines/reference/importAttributes6.symbols @@ -0,0 +1,24 @@ +//// [tests/cases/conformance/importAttributes/importAttributes6.ts] //// + +=== mod.mts === +import * as thing1 from "./mod.mjs" with { field: 0 }; +>thing1 : Symbol(thing1, Decl(mod.mts, 0, 6)) + +import * as thing2 from "./mod.mjs" with { field: `a` }; +>thing2 : Symbol(thing2, Decl(mod.mts, 1, 6)) + +import * as thing3 from "./mod.mjs" with { field: /a/g }; +>thing3 : Symbol(thing3, Decl(mod.mts, 2, 6)) + +import * as thing4 from "./mod.mjs" with { field: ["a"] }; +>thing4 : Symbol(thing4, Decl(mod.mts, 3, 6)) + +import * as thing5 from "./mod.mjs" with { field: { a: 0 } }; +>thing5 : Symbol(thing5, Decl(mod.mts, 4, 6)) +>a : Symbol(a, Decl(mod.mts, 4, 51)) + +import * as thing6 from "./mod.mjs" with { type: "json", field: 0..toString() }; +>thing6 : Symbol(thing6, Decl(mod.mts, 5, 6)) +>0..toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) + diff --git a/tests/baselines/reference/importAttributes6.types b/tests/baselines/reference/importAttributes6.types new file mode 100644 index 0000000000000..89fdd52c30d22 --- /dev/null +++ b/tests/baselines/reference/importAttributes6.types @@ -0,0 +1,38 @@ +//// [tests/cases/conformance/importAttributes/importAttributes6.ts] //// + +=== mod.mts === +import * as thing1 from "./mod.mjs" with { field: 0 }; +>thing1 : typeof thing1 +>field : any + +import * as thing2 from "./mod.mjs" with { field: `a` }; +>thing2 : typeof thing1 +>field : any + +import * as thing3 from "./mod.mjs" with { field: /a/g }; +>thing3 : typeof thing1 +>field : any +>/a/g : RegExp + +import * as thing4 from "./mod.mjs" with { field: ["a"] }; +>thing4 : typeof thing1 +>field : any +>["a"] : string[] +>"a" : "a" + +import * as thing5 from "./mod.mjs" with { field: { a: 0 } }; +>thing5 : typeof thing1 +>field : any +>{ a: 0 } : { a: number; } +>a : number +>0 : 0 + +import * as thing6 from "./mod.mjs" with { type: "json", field: 0..toString() }; +>thing6 : typeof thing1 +>type : any +>field : any +>0..toString() : string +>0..toString : (radix?: number) => string +>0. : 0 +>toString : (radix?: number) => string + diff --git a/tests/baselines/reference/importAttributes7.js b/tests/baselines/reference/importAttributes7.js new file mode 100644 index 0000000000000..66ff33e5bc507 --- /dev/null +++ b/tests/baselines/reference/importAttributes7.js @@ -0,0 +1,75 @@ +//// [tests/cases/conformance/importAttributes/importAttributes7.ts] //// + +//// [a.ts] +export default { + a: "a", + b: "b", + 1: "1", +} + +//// [b.ts] +import a from "./a" with { a: "a", "b": "b" }; + +export async function f() { + const a = import("./a", { + with: { a: "a", "b": "b" }, + }); + a; +} + + +//// [a.js] +export default { + a: "a", + b: "b", + 1: "1", +}; +//// [b.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +export function f() { + return __awaiter(this, void 0, void 0, function () { + var a; + return __generator(this, function (_a) { + a = import("./a", { + with: { a: "a", "b": "b" }, + }); + a; + return [2 /*return*/]; + }); + }); +} diff --git a/tests/baselines/reference/importAttributes7.symbols b/tests/baselines/reference/importAttributes7.symbols new file mode 100644 index 0000000000000..547b876bd1b1c --- /dev/null +++ b/tests/baselines/reference/importAttributes7.symbols @@ -0,0 +1,35 @@ +//// [tests/cases/conformance/importAttributes/importAttributes7.ts] //// + +=== /a.ts === +export default { + a: "a", +>a : Symbol(a, Decl(a.ts, 0, 16)) + + b: "b", +>b : Symbol(b, Decl(a.ts, 1, 11)) + + 1: "1", +>1 : Symbol(1, Decl(a.ts, 2, 11)) +} + +=== /b.ts === +import a from "./a" with { a: "a", "b": "b" }; +>a : Symbol(a, Decl(b.ts, 0, 6)) + +export async function f() { +>f : Symbol(f, Decl(b.ts, 0, 46)) + + const a = import("./a", { +>a : Symbol(a, Decl(b.ts, 3, 9)) +>"./a" : Symbol("/a", Decl(a.ts, 0, 0)) + + with: { a: "a", "b": "b" }, +>with : Symbol(with, Decl(b.ts, 3, 29)) +>a : Symbol(a, Decl(b.ts, 4, 15)) +>"b" : Symbol("b", Decl(b.ts, 4, 23)) + + }); + a; +>a : Symbol(a, Decl(b.ts, 3, 9)) +} + diff --git a/tests/baselines/reference/importAttributes7.types b/tests/baselines/reference/importAttributes7.types new file mode 100644 index 0000000000000..d4738ac844b60 --- /dev/null +++ b/tests/baselines/reference/importAttributes7.types @@ -0,0 +1,46 @@ +//// [tests/cases/conformance/importAttributes/importAttributes7.ts] //// + +=== /a.ts === +export default { +>{ a: "a", b: "b", 1: "1",} : { a: string; b: string; 1: string; } + + a: "a", +>a : string +>"a" : "a" + + b: "b", +>b : string +>"b" : "b" + + 1: "1", +>1 : string +>"1" : "1" +} + +=== /b.ts === +import a from "./a" with { a: "a", "b": "b" }; +>a : { a: string; b: string; 1: string; } +>a : error + +export async function f() { +>f : () => Promise + + const a = import("./a", { +>a : Promise +>import("./a", { with: { a: "a", "b": "b" }, }) : Promise +>"./a" : "./a" +>{ with: { a: "a", "b": "b" }, } : { with: { a: string; b: string; }; } + + with: { a: "a", "b": "b" }, +>with : { a: string; b: string; } +>{ a: "a", "b": "b" } : { a: string; b: string; } +>a : string +>"a" : "a" +>"b" : string +>"b" : "b" + + }); + a; +>a : Promise +} + diff --git a/tests/baselines/reference/importAttributes8.js b/tests/baselines/reference/importAttributes8.js new file mode 100644 index 0000000000000..37e87e1048cf0 --- /dev/null +++ b/tests/baselines/reference/importAttributes8.js @@ -0,0 +1,19 @@ +//// [tests/cases/conformance/importAttributes/importAttributes8.ts] //// + +//// [a.ts] +export default { + a: "a", + b: "b", +} + +//// [b.ts] +import a from "./a" with { a: "a", "b": "b" }; // ok + + +//// [a.js] +export default { + a: "a", + b: "b", +}; +//// [b.js] +export {}; diff --git a/tests/baselines/reference/importAttributes8.symbols b/tests/baselines/reference/importAttributes8.symbols new file mode 100644 index 0000000000000..230d3d4bc4f6c --- /dev/null +++ b/tests/baselines/reference/importAttributes8.symbols @@ -0,0 +1,15 @@ +//// [tests/cases/conformance/importAttributes/importAttributes8.ts] //// + +=== /a.ts === +export default { + a: "a", +>a : Symbol(a, Decl(a.ts, 0, 16)) + + b: "b", +>b : Symbol(b, Decl(a.ts, 1, 11)) +} + +=== /b.ts === +import a from "./a" with { a: "a", "b": "b" }; // ok +>a : Symbol(a, Decl(b.ts, 0, 6)) + diff --git a/tests/baselines/reference/importAttributes8.types b/tests/baselines/reference/importAttributes8.types new file mode 100644 index 0000000000000..1dc88f33b858c --- /dev/null +++ b/tests/baselines/reference/importAttributes8.types @@ -0,0 +1,20 @@ +//// [tests/cases/conformance/importAttributes/importAttributes8.ts] //// + +=== /a.ts === +export default { +>{ a: "a", b: "b",} : { a: string; b: string; } + + a: "a", +>a : string +>"a" : "a" + + b: "b", +>b : string +>"b" : "b" +} + +=== /b.ts === +import a from "./a" with { a: "a", "b": "b" }; // ok +>a : { a: string; b: string; } +>a : error + diff --git a/tests/baselines/reference/importCallExpressionGrammarError.errors.txt b/tests/baselines/reference/importCallExpressionGrammarError.errors.txt index 9c5f2c60daed7..a79891a2fc65a 100644 --- a/tests/baselines/reference/importCallExpressionGrammarError.errors.txt +++ b/tests/baselines/reference/importCallExpressionGrammarError.errors.txt @@ -1,6 +1,6 @@ importCallExpressionGrammarError.ts(5,8): error TS1325: Argument of dynamic import cannot be spread element. importCallExpressionGrammarError.ts(7,17): error TS1325: Argument of dynamic import cannot be spread element. -importCallExpressionGrammarError.ts(8,12): message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments +importCallExpressionGrammarError.ts(8,12): message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments importCallExpressionGrammarError.ts(9,19): error TS2307: Cannot find module 'pathToModule' or its corresponding type declarations. importCallExpressionGrammarError.ts(9,35): error TS1324: Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'. importCallExpressionGrammarError.ts(9,35): error TS2559: Type '"secondModule"' has no properties in common with type 'ImportCallOptions'. @@ -20,7 +20,7 @@ importCallExpressionGrammarError.ts(9,35): error TS2559: Type '"secondModule"' h !!! error TS1325: Argument of dynamic import cannot be spread element. const p2 = import(); ~~~~~~~~ -!!! message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments +!!! message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments const p4 = import("pathToModule", "secondModule"); ~~~~~~~~~~~~~~ !!! error TS2307: Cannot find module 'pathToModule' or its corresponding type declarations. diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.js b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.js index 6ea138c379ffc..9e56b828b58e0 100644 --- a/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.js +++ b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.js @@ -157,8 +157,8 @@ export declare const e: typeof import("inner/mjs"); export declare const a: Promise<{ default: typeof import("./index.cjs"); }>; -export declare const b: Promise; -export declare const c: Promise; +export declare const b: Promise; +export declare const c: Promise; export declare const f: Promise<{ default: typeof import("inner"); cjsMain: true; @@ -168,4 +168,4 @@ export declare const d: Promise<{ default: typeof import("inner/cjs"); cjsNonmain: true; }>; -export declare const e: Promise; +export declare const e: Promise; diff --git a/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.types b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.types index d04a2d2d7bcda..c4177bca3eb51 100644 --- a/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.types +++ b/tests/baselines/reference/nodeModulesDeclarationEmitDynamicImportWithPackageExports.types @@ -100,13 +100,13 @@ export const a = import("package/cjs"); >"package/cjs" : "package/cjs" export const b = import("package/mjs"); ->b : Promise ->import("package/mjs") : Promise +>b : Promise +>import("package/mjs") : Promise >"package/mjs" : "package/mjs" export const c = import("package"); ->c : Promise ->import("package") : Promise +>c : Promise +>import("package") : Promise >"package" : "package" export const f = import("inner"); @@ -122,8 +122,8 @@ export const d = import("inner/cjs"); >"inner/cjs" : "inner/cjs" export const e = import("inner/mjs"); ->e : Promise ->import("inner/mjs") : Promise +>e : Promise +>import("inner/mjs") : Promise >"inner/mjs" : "inner/mjs" === node_modules/inner/index.d.ts === diff --git a/tests/baselines/reference/nodeModulesImportAttributes(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportAttributes(module=node16).errors.txt new file mode 100644 index 0000000000000..eebc7c09c975c --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=node16).errors.txt @@ -0,0 +1,25 @@ +error TS2468: Cannot find global value 'Promise'. +index.ts(1,35): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +otherc.cts(1,35): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +otherc.cts(2,15): error TS2712: 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. + + +!!! error TS2468: Cannot find global value 'Promise'. +==== index.ts (1 errors) ==== + import json from "./package.json" with { type: "json" }; + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +==== otherc.cts (2 errors) ==== + import json from "./package.json" with { type: "json" }; // should error, cjs mode imports don't support attributes + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + const json2 = import("./package.json", { with: { type: "json" } }); // should be fine + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2712: 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. +==== package.json (0 errors) ==== + { + "name": "pkg", + "private": true, + "type": "module" + } + \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAttributes(module=node16).js b/tests/baselines/reference/nodeModulesImportAttributes(module=node16).js new file mode 100644 index 0000000000000..608fa65d70951 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=node16).js @@ -0,0 +1,21 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributes.ts] //// + +//// [index.ts] +import json from "./package.json" with { type: "json" }; +//// [otherc.cts] +import json from "./package.json" with { type: "json" }; // should error, cjs mode imports don't support attributes +const json2 = import("./package.json", { with: { type: "json" } }); // should be fine +//// [package.json] +{ + "name": "pkg", + "private": true, + "type": "module" +} + + +//// [index.js] +export {}; +//// [otherc.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var json2 = import("./package.json", { with: { type: "json" } }); // should be fine diff --git a/tests/baselines/reference/nodeModulesImportAttributes(module=node16).symbols b/tests/baselines/reference/nodeModulesImportAttributes(module=node16).symbols new file mode 100644 index 0000000000000..6666db3e5b459 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=node16).symbols @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributes.ts] //// + +=== index.ts === +import json from "./package.json" with { type: "json" }; +>json : Symbol(json, Decl(index.ts, 0, 6)) + +=== otherc.cts === +import json from "./package.json" with { type: "json" }; // should error, cjs mode imports don't support attributes +>json : Symbol(json, Decl(otherc.cts, 0, 6)) + +const json2 = import("./package.json", { with: { type: "json" } }); // should be fine +>json2 : Symbol(json2, Decl(otherc.cts, 1, 5)) +>"./package.json" : Symbol("package", Decl(package.json, 0, 0)) +>with : Symbol(with, Decl(otherc.cts, 1, 40)) +>type : Symbol(type, Decl(otherc.cts, 1, 48)) + +=== package.json === +{ + "name": "pkg", +>"name" : Symbol("name", Decl(package.json, 0, 1)) + + "private": true, +>"private" : Symbol("private", Decl(package.json, 1, 18)) + + "type": "module" +>"type" : Symbol("type", Decl(package.json, 2, 20)) +} + diff --git a/tests/baselines/reference/nodeModulesImportAttributes(module=node16).types b/tests/baselines/reference/nodeModulesImportAttributes(module=node16).types new file mode 100644 index 0000000000000..a6b4943e6debe --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=node16).types @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributes.ts] //// + +=== index.ts === +import json from "./package.json" with { type: "json" }; +>json : { name: string; private: boolean; type: string; } +>type : any + +=== otherc.cts === +import json from "./package.json" with { type: "json" }; // should error, cjs mode imports don't support attributes +>json : { name: string; private: boolean; type: string; } +>type : any + +const json2 = import("./package.json", { with: { type: "json" } }); // should be fine +>json2 : Promise<{ default: { name: string; private: boolean; type: string; }; }> +>import("./package.json", { with: { type: "json" } }) : Promise<{ default: { name: string; private: boolean; type: string; }; }> +>"./package.json" : "./package.json" +>{ with: { type: "json" } } : { with: { type: string; }; } +>with : { type: string; } +>{ type: "json" } : { type: string; } +>type : string +>"json" : "json" + +=== package.json === +{ +>{ "name": "pkg", "private": true, "type": "module"} : { name: string; private: boolean; type: string; } + + "name": "pkg", +>"name" : string +>"pkg" : "pkg" + + "private": true, +>"private" : boolean +>true : true + + "type": "module" +>"type" : string +>"module" : "module" +} + diff --git a/tests/baselines/reference/nodeModulesImportAttributes(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportAttributes(module=nodenext).errors.txt new file mode 100644 index 0000000000000..e2dcc518d7ceb --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=nodenext).errors.txt @@ -0,0 +1,22 @@ +error TS2468: Cannot find global value 'Promise'. +otherc.cts(1,35): error TS2856: Import attributes are not allowed on statements that transpile to CommonJS 'require' calls. +otherc.cts(2,15): error TS2712: 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. + + +!!! error TS2468: Cannot find global value 'Promise'. +==== index.ts (0 errors) ==== + import json from "./package.json" with { type: "json" }; +==== otherc.cts (2 errors) ==== + import json from "./package.json" with { type: "json" }; // should error, cjs mode imports don't support attributes + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2856: Import attributes are not allowed on statements that transpile to CommonJS 'require' calls. + const json2 = import("./package.json", { with: { type: "json" } }); // should be fine + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2712: 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. +==== package.json (0 errors) ==== + { + "name": "pkg", + "private": true, + "type": "module" + } + \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAttributes(module=nodenext).js b/tests/baselines/reference/nodeModulesImportAttributes(module=nodenext).js new file mode 100644 index 0000000000000..608fa65d70951 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=nodenext).js @@ -0,0 +1,21 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributes.ts] //// + +//// [index.ts] +import json from "./package.json" with { type: "json" }; +//// [otherc.cts] +import json from "./package.json" with { type: "json" }; // should error, cjs mode imports don't support attributes +const json2 = import("./package.json", { with: { type: "json" } }); // should be fine +//// [package.json] +{ + "name": "pkg", + "private": true, + "type": "module" +} + + +//// [index.js] +export {}; +//// [otherc.cjs] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var json2 = import("./package.json", { with: { type: "json" } }); // should be fine diff --git a/tests/baselines/reference/nodeModulesImportAttributes(module=nodenext).symbols b/tests/baselines/reference/nodeModulesImportAttributes(module=nodenext).symbols new file mode 100644 index 0000000000000..6666db3e5b459 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=nodenext).symbols @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributes.ts] //// + +=== index.ts === +import json from "./package.json" with { type: "json" }; +>json : Symbol(json, Decl(index.ts, 0, 6)) + +=== otherc.cts === +import json from "./package.json" with { type: "json" }; // should error, cjs mode imports don't support attributes +>json : Symbol(json, Decl(otherc.cts, 0, 6)) + +const json2 = import("./package.json", { with: { type: "json" } }); // should be fine +>json2 : Symbol(json2, Decl(otherc.cts, 1, 5)) +>"./package.json" : Symbol("package", Decl(package.json, 0, 0)) +>with : Symbol(with, Decl(otherc.cts, 1, 40)) +>type : Symbol(type, Decl(otherc.cts, 1, 48)) + +=== package.json === +{ + "name": "pkg", +>"name" : Symbol("name", Decl(package.json, 0, 1)) + + "private": true, +>"private" : Symbol("private", Decl(package.json, 1, 18)) + + "type": "module" +>"type" : Symbol("type", Decl(package.json, 2, 20)) +} + diff --git a/tests/baselines/reference/nodeModulesImportAttributes(module=nodenext).types b/tests/baselines/reference/nodeModulesImportAttributes(module=nodenext).types new file mode 100644 index 0000000000000..a6b4943e6debe --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributes(module=nodenext).types @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributes.ts] //// + +=== index.ts === +import json from "./package.json" with { type: "json" }; +>json : { name: string; private: boolean; type: string; } +>type : any + +=== otherc.cts === +import json from "./package.json" with { type: "json" }; // should error, cjs mode imports don't support attributes +>json : { name: string; private: boolean; type: string; } +>type : any + +const json2 = import("./package.json", { with: { type: "json" } }); // should be fine +>json2 : Promise<{ default: { name: string; private: boolean; type: string; }; }> +>import("./package.json", { with: { type: "json" } }) : Promise<{ default: { name: string; private: boolean; type: string; }; }> +>"./package.json" : "./package.json" +>{ with: { type: "json" } } : { with: { type: string; }; } +>with : { type: string; } +>{ type: "json" } : { type: string; } +>type : string +>"json" : "json" + +=== package.json === +{ +>{ "name": "pkg", "private": true, "type": "module"} : { name: string; private: boolean; type: string; } + + "name": "pkg", +>"name" : string +>"pkg" : "pkg" + + "private": true, +>"private" : boolean +>true : true + + "type": "module" +>"type" : string +>"module" : "module" +} + diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node16).errors.txt new file mode 100644 index 0000000000000..55c25456e5507 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node16).errors.txt @@ -0,0 +1,37 @@ +/index.ts(6,50): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +/index.ts(7,14): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. +/index.ts(7,49): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + + +==== /index.ts (3 errors) ==== + import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; + import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + + export interface LocalInterface extends RequireInterface, ImportInterface {} + + import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + export interface Loc extends Req, Imp {} + + export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; + export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node16).js b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node16).js new file mode 100644 index 0000000000000..7175dbf9479d7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node16).js @@ -0,0 +1,45 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [index.d.ts] +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +export interface LocalInterface extends RequireInterface, ImportInterface { +} +import { type RequireInterface as Req } from "pkg" with { "resolution-mode": "require" }; +import { type ImportInterface as Imp } from "pkg" with { "resolution-mode": "import" }; +export interface Loc extends Req, Imp { +} +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node16).symbols b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node16).symbols new file mode 100644 index 0000000000000..b2c93c67d55e4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node16).symbols @@ -0,0 +1,40 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts] //// + +=== /index.ts === +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) + +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +export interface LocalInterface extends RequireInterface, ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 1, 80)) +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) + +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export interface Loc extends Req, Imp {} +>Loc : Symbol(Loc, Decl(index.ts, 6, 85)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 9, 13)) + +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 10, 13)) + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node16).types b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node16).types new file mode 100644 index 0000000000000..cd1d81407b22a --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=node16).types @@ -0,0 +1,33 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts] //// + +=== /index.ts === +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : RequireInterface + +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : ImportInterface + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : any +>Req : any + +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : any +>Imp : any + +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : RequireInterface + +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : ImportInterface + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=nodenext).errors.txt new file mode 100644 index 0000000000000..fa85f6353ea68 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=nodenext).errors.txt @@ -0,0 +1,37 @@ +/index.ts(6,50): error TS2856: Import attributes are not allowed on statements that transpile to CommonJS 'require' calls. +/index.ts(7,14): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. +/index.ts(7,49): error TS2856: Import attributes are not allowed on statements that transpile to CommonJS 'require' calls. + + +==== /index.ts (3 errors) ==== + import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; + import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + + export interface LocalInterface extends RequireInterface, ImportInterface {} + + import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2856: Import attributes are not allowed on statements that transpile to CommonJS 'require' calls. + import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2856: Import attributes are not allowed on statements that transpile to CommonJS 'require' calls. + export interface Loc extends Req, Imp {} + + export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; + export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=nodenext).js b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=nodenext).js new file mode 100644 index 0000000000000..7175dbf9479d7 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=nodenext).js @@ -0,0 +1,45 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [index.d.ts] +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +export interface LocalInterface extends RequireInterface, ImportInterface { +} +import { type RequireInterface as Req } from "pkg" with { "resolution-mode": "require" }; +import { type ImportInterface as Imp } from "pkg" with { "resolution-mode": "import" }; +export interface Loc extends Req, Imp { +} +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=nodenext).symbols b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=nodenext).symbols new file mode 100644 index 0000000000000..b2c93c67d55e4 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=nodenext).symbols @@ -0,0 +1,40 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts] //// + +=== /index.ts === +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) + +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +export interface LocalInterface extends RequireInterface, ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 1, 80)) +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) + +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export interface Loc extends Req, Imp {} +>Loc : Symbol(Loc, Decl(index.ts, 6, 85)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 9, 13)) + +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 10, 13)) + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=nodenext).types b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=nodenext).types new file mode 100644 index 0000000000000..cd1d81407b22a --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit1(module=nodenext).types @@ -0,0 +1,33 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts] //// + +=== /index.ts === +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : RequireInterface + +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : ImportInterface + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : any +>Req : any + +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : any +>Imp : any + +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : RequireInterface + +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : ImportInterface + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node16).errors.txt new file mode 100644 index 0000000000000..8cb0099fe8ce0 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node16).errors.txt @@ -0,0 +1,42 @@ +/index.ts(6,14): error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. +/index.ts(6,50): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +/index.ts(7,49): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + + +==== /index.ts (3 errors) ==== + import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; + import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + + export interface LocalInterface extends RequireInterface, ImportInterface {} + + import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + export interface Loc extends Req, Imp {} + + export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; + export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} +==== /package.json (0 errors) ==== + { + "private": true, + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node16).js b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node16).js new file mode 100644 index 0000000000000..afe399f85b0ad --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node16).js @@ -0,0 +1,49 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [index.ts] +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + + +//// [index.js] +export {}; + + +//// [index.d.ts] +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +export interface LocalInterface extends RequireInterface, ImportInterface { +} +import { type RequireInterface as Req } from "pkg" with { "resolution-mode": "require" }; +import { type ImportInterface as Imp } from "pkg" with { "resolution-mode": "import" }; +export interface Loc extends Req, Imp { +} +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node16).symbols b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node16).symbols new file mode 100644 index 0000000000000..d76777ff60b36 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node16).symbols @@ -0,0 +1,40 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts] //// + +=== /index.ts === +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) + +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +export interface LocalInterface extends RequireInterface, ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 1, 80)) +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +>Req : Symbol(Req, Decl(index.ts, 5, 8)) + +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export interface Loc extends Req, Imp {} +>Loc : Symbol(Loc, Decl(index.ts, 6, 85)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 9, 13)) + +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 10, 13)) + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node16).types b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node16).types new file mode 100644 index 0000000000000..5981886e84805 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=node16).types @@ -0,0 +1,33 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts] //// + +=== /index.ts === +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : RequireInterface + +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : ImportInterface + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : any +>Req : any + +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : any +>Imp : any + +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : RequireInterface + +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : ImportInterface + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=nodenext).errors.txt new file mode 100644 index 0000000000000..5c93150f88f13 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=nodenext).errors.txt @@ -0,0 +1,42 @@ +/index.ts(6,14): error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. +/index.ts(6,50): error TS1454: `resolution-mode` can only be set for type-only imports. +/index.ts(7,49): error TS1454: `resolution-mode` can only be set for type-only imports. + + +==== /index.ts (3 errors) ==== + import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; + import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + + export interface LocalInterface extends RequireInterface, ImportInterface {} + + import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'RequireInterface'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1454: `resolution-mode` can only be set for type-only imports. + import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1454: `resolution-mode` can only be set for type-only imports. + export interface Loc extends Req, Imp {} + + export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; + export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} +==== /package.json (0 errors) ==== + { + "private": true, + "type": "module" + } \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=nodenext).js b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=nodenext).js new file mode 100644 index 0000000000000..afe399f85b0ad --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=nodenext).js @@ -0,0 +1,49 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [package.json] +{ + "private": true, + "type": "module" +} +//// [index.ts] +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + + +//// [index.js] +export {}; + + +//// [index.d.ts] +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +export interface LocalInterface extends RequireInterface, ImportInterface { +} +import { type RequireInterface as Req } from "pkg" with { "resolution-mode": "require" }; +import { type ImportInterface as Imp } from "pkg" with { "resolution-mode": "import" }; +export interface Loc extends Req, Imp { +} +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=nodenext).symbols b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=nodenext).symbols new file mode 100644 index 0000000000000..d76777ff60b36 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=nodenext).symbols @@ -0,0 +1,40 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts] //// + +=== /index.ts === +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) + +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +export interface LocalInterface extends RequireInterface, ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 1, 80)) +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 0, 13)) +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 1, 13)) + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +>Req : Symbol(Req, Decl(index.ts, 5, 8)) + +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export interface Loc extends Req, Imp {} +>Loc : Symbol(Loc, Decl(index.ts, 6, 85)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) +>Imp : Symbol(Imp, Decl(index.ts, 6, 8)) + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 9, 13)) + +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 10, 13)) + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=nodenext).types b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=nodenext).types new file mode 100644 index 0000000000000..5981886e84805 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmit2(module=nodenext).types @@ -0,0 +1,33 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts] //// + +=== /index.ts === +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : RequireInterface + +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : ImportInterface + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : any +>Req : any + +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : any +>Imp : any + +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : RequireInterface + +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : ImportInterface + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node16).errors.txt new file mode 100644 index 0000000000000..b7e3766635732 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node16).errors.txt @@ -0,0 +1,43 @@ +/index.ts(2,45): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +/index.ts(2,71): error TS1453: `resolution-mode` should be either `require` or `import`. +/index.ts(4,10): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. +/index.ts(4,39): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. +/index.ts(6,76): error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + + +==== /index.ts (5 errors) ==== + // incorrect mode + import type { RequireInterface } from "pkg" with { "resolution-mode": "foobar" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + ~~~~~~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + // not type-only + import { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + // not exclusively type-only + import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" with { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2823: Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'. + + export interface LocalInterface extends RequireInterface, ImportInterface {} + + + + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node16).js b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node16).js new file mode 100644 index 0000000000000..988072b042c93 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node16).js @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +// incorrect mode +import type { RequireInterface } from "pkg" with { "resolution-mode": "foobar" }; +// not type-only +import { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +// not exclusively type-only +import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" with { "resolution-mode": "require" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + + + + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [index.d.ts] +import type { RequireInterface } from "pkg"; +import { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +export interface LocalInterface extends RequireInterface, ImportInterface { +} diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node16).symbols b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node16).symbols new file mode 100644 index 0000000000000..33a5f17944412 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node16).symbols @@ -0,0 +1,30 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts] //// + +=== /index.ts === +// incorrect mode +import type { RequireInterface } from "pkg" with { "resolution-mode": "foobar" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 1, 13)) + +// not type-only +import { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 3, 8)) + +// not exclusively type-only +import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) +>Req2 : Symbol(Req2, Decl(index.ts, 5, 37)) + +export interface LocalInterface extends RequireInterface, ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 5, 113)) +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 1, 13)) +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 3, 8)) + + + + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node16).types b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node16).types new file mode 100644 index 0000000000000..4d528b8a63323 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=node16).types @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts] //// + +=== /index.ts === +// incorrect mode +import type { RequireInterface } from "pkg" with { "resolution-mode": "foobar" }; +>RequireInterface : RequireInterface + +// not type-only +import { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : any + +// not exclusively type-only +import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : any +>Req : any +>RequireInterface : any +>Req2 : any + +export interface LocalInterface extends RequireInterface, ImportInterface {} + + + + +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=nodenext).errors.txt new file mode 100644 index 0000000000000..7d8663cd444e5 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=nodenext).errors.txt @@ -0,0 +1,43 @@ +/index.ts(2,45): error TS2856: Import attributes are not allowed on statements that transpile to CommonJS 'require' calls. +/index.ts(2,71): error TS1453: `resolution-mode` should be either `require` or `import`. +/index.ts(4,10): error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. +/index.ts(4,39): error TS2856: Import attributes are not allowed on statements that transpile to CommonJS 'require' calls. +/index.ts(6,76): error TS2856: Import attributes are not allowed on statements that transpile to CommonJS 'require' calls. + + +==== /index.ts (5 errors) ==== + // incorrect mode + import type { RequireInterface } from "pkg" with { "resolution-mode": "foobar" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2856: Import attributes are not allowed on statements that transpile to CommonJS 'require' calls. + ~~~~~~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + // not type-only + import { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + ~~~~~~~~~~~~~~~ +!!! error TS2305: Module '"pkg"' has no exported member 'ImportInterface'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2856: Import attributes are not allowed on statements that transpile to CommonJS 'require' calls. + // not exclusively type-only + import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" with { "resolution-mode": "require" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2856: Import attributes are not allowed on statements that transpile to CommonJS 'require' calls. + + export interface LocalInterface extends RequireInterface, ImportInterface {} + + + + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=nodenext).js b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=nodenext).js new file mode 100644 index 0000000000000..988072b042c93 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=nodenext).js @@ -0,0 +1,39 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +// incorrect mode +import type { RequireInterface } from "pkg" with { "resolution-mode": "foobar" }; +// not type-only +import { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +// not exclusively type-only +import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" with { "resolution-mode": "require" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + + + + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [index.d.ts] +import type { RequireInterface } from "pkg"; +import { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +export interface LocalInterface extends RequireInterface, ImportInterface { +} diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=nodenext).symbols b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=nodenext).symbols new file mode 100644 index 0000000000000..33a5f17944412 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=nodenext).symbols @@ -0,0 +1,30 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts] //// + +=== /index.ts === +// incorrect mode +import type { RequireInterface } from "pkg" with { "resolution-mode": "foobar" }; +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 1, 13)) + +// not type-only +import { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 3, 8)) + +// not exclusively type-only +import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) +>Req : Symbol(Req, Decl(index.ts, 5, 8)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) +>Req2 : Symbol(Req2, Decl(index.ts, 5, 37)) + +export interface LocalInterface extends RequireInterface, ImportInterface {} +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 5, 113)) +>RequireInterface : Symbol(RequireInterface, Decl(index.ts, 1, 13)) +>ImportInterface : Symbol(ImportInterface, Decl(index.ts, 3, 8)) + + + + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=nodenext).types b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=nodenext).types new file mode 100644 index 0000000000000..4d528b8a63323 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesModeDeclarationEmitErrors(module=nodenext).types @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts] //// + +=== /index.ts === +// incorrect mode +import type { RequireInterface } from "pkg" with { "resolution-mode": "foobar" }; +>RequireInterface : RequireInterface + +// not type-only +import { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +>ImportInterface : any + +// not exclusively type-only +import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" with { "resolution-mode": "require" }; +>RequireInterface : any +>Req : any +>RequireInterface : any +>Req2 : any + +export interface LocalInterface extends RequireInterface, ImportInterface {} + + + + +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node16).js b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node16).js new file mode 100644 index 0000000000000..cca2ca8a8520a --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node16).js @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +export type LocalInterface = + & import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; + + +//// [index.d.ts] +export type LocalInterface = import("pkg", { with: { "resolution-mode": "require" } }).RequireInterface & import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; +export declare const a: import("pkg").RequireInterface; +export declare const b: import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node16).symbols b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node16).symbols new file mode 100644 index 0000000000000..1f0e1652f5505 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node16).symbols @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts] //// + +=== /index.ts === +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) + + & import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface); +>a : Symbol(a, Decl(index.ts, 4, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); +>b : Symbol(b, Decl(index.ts, 5, 12)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node16).types b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node16).types new file mode 100644 index 0000000000000..a37c0c3191a79 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=node16).types @@ -0,0 +1,27 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts] //// + +=== /index.ts === +export type LocalInterface = +>LocalInterface : import("/node_modules/pkg/require").RequireInterface & import("/node_modules/pkg/import").ImportInterface + + & import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +>(null as any as import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +>null as any as import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +>null as any : any + +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); +>b : import("/node_modules/pkg/import").ImportInterface +>(null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface) : import("/node_modules/pkg/import").ImportInterface +>null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface : import("/node_modules/pkg/import").ImportInterface +>null as any : any + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=nodenext).js b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=nodenext).js new file mode 100644 index 0000000000000..cca2ca8a8520a --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=nodenext).js @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} +//// [require.d.ts] +export interface RequireInterface {} +//// [index.ts] +export type LocalInterface = + & import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; + + +//// [index.d.ts] +export type LocalInterface = import("pkg", { with: { "resolution-mode": "require" } }).RequireInterface & import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; +export declare const a: import("pkg").RequireInterface; +export declare const b: import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=nodenext).symbols b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=nodenext).symbols new file mode 100644 index 0000000000000..1f0e1652f5505 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=nodenext).symbols @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts] //// + +=== /index.ts === +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) + + & import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface); +>a : Symbol(a, Decl(index.ts, 4, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); +>b : Symbol(b, Decl(index.ts, 5, 12)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=nodenext).types b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=nodenext).types new file mode 100644 index 0000000000000..a37c0c3191a79 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmit(module=nodenext).types @@ -0,0 +1,27 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts] //// + +=== /index.ts === +export type LocalInterface = +>LocalInterface : import("/node_modules/pkg/require").RequireInterface & import("/node_modules/pkg/import").ImportInterface + + & import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +>(null as any as import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +>null as any as import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +>null as any : any + +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); +>b : import("/node_modules/pkg/import").ImportInterface +>(null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface) : import("/node_modules/pkg/import").ImportInterface +>null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface : import("/node_modules/pkg/import").ImportInterface +>null as any : any + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node16).errors.txt new file mode 100644 index 0000000000000..340ef90ef8368 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node16).errors.txt @@ -0,0 +1,319 @@ +error TS2468: Cannot find global value 'Promise'. +/index.ts(2,49): error TS1453: `resolution-mode` should be either `require` or `import`. +/index.ts(5,76): error TS1453: `resolution-mode` should be either `require` or `import`. +/other.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other.ts(3,22): error TS1005: 'with' expected. +/other.ts(3,39): error TS1005: ';' expected. +/other.ts(3,50): error TS1128: Declaration or statement expected. +/other.ts(3,51): error TS1128: Declaration or statement expected. +/other.ts(3,52): error TS1128: Declaration or statement expected. +/other.ts(3,53): error TS2304: Cannot find name 'RequireInterface'. +/other.ts(4,7): error TS2712: 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. +/other.ts(4,22): error TS2353: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. +/other.ts(4,52): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. +/other.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other.ts(6,49): error TS1005: 'with' expected. +/other.ts(6,66): error TS1005: ';' expected. +/other.ts(6,77): error TS1128: Declaration or statement expected. +/other.ts(6,78): error TS1128: Declaration or statement expected. +/other.ts(6,79): error TS1128: Declaration or statement expected. +/other.ts(6,80): error TS1434: Unexpected keyword or identifier. +/other.ts(6,80): error TS2304: Cannot find name 'RequireInterface'. +/other.ts(6,96): error TS1128: Declaration or statement expected. +/other.ts(7,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other.ts(7,49): error TS1005: 'with' expected. +/other.ts(7,66): error TS1005: ';' expected. +/other.ts(7,76): error TS1128: Declaration or statement expected. +/other.ts(7,77): error TS1128: Declaration or statement expected. +/other.ts(7,78): error TS1128: Declaration or statement expected. +/other.ts(7,79): error TS1434: Unexpected keyword or identifier. +/other.ts(7,79): error TS2304: Cannot find name 'ImportInterface'. +/other.ts(7,94): error TS1128: Declaration or statement expected. +/other2.ts(3,30): error TS1463: 'resolution-mode' is the only valid key for type import attributes. +/other2.ts(4,30): error TS1463: 'resolution-mode' is the only valid key for type import attributes. +/other2.ts(4,50): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +/other2.ts(6,57): error TS1463: 'resolution-mode' is the only valid key for type import attributes. +/other2.ts(7,57): error TS1463: 'resolution-mode' is the only valid key for type import attributes. +/other2.ts(7,77): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +/other3.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other3.ts(3,21): error TS1005: '{' expected. +/other3.ts(3,23): error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. +/other3.ts(3,55): error TS1005: ';' expected. +/other3.ts(3,56): error TS1128: Declaration or statement expected. +/other3.ts(3,57): error TS2304: Cannot find name 'RequireInterface'. +/other3.ts(4,7): error TS2712: 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. +/other3.ts(4,21): error TS2559: Type '{ "resolution-mode": string; }[]' has no properties in common with type 'ImportCallOptions'. +/other3.ts(4,56): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. +/other3.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other3.ts(6,48): error TS1005: '{' expected. +/other3.ts(6,50): error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. +/other3.ts(6,100): error TS1005: ',' expected. +/other3.ts(7,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other3.ts(7,48): error TS1005: '{' expected. +/other3.ts(7,50): error TS2538: Type '{ "resolution-mode": "import"; }' cannot be used as an index type. +/other3.ts(7,98): error TS1005: ',' expected. +/other4.ts(6,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other4.ts(6,21): error TS1005: '{' expected. +/other4.ts(6,21): error TS2448: Block-scoped variable 'Attribute1' used before its declaration. +/other4.ts(6,31): error TS1128: Declaration or statement expected. +/other4.ts(6,32): error TS1128: Declaration or statement expected. +/other4.ts(6,33): error TS2448: Block-scoped variable 'RequireInterface' used before its declaration. +/other4.ts(7,7): error TS2712: 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. +/other4.ts(7,21): error TS2448: Block-scoped variable 'Attribute2' used before its declaration. +/other4.ts(7,33): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. +/other4.ts(9,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other4.ts(9,48): error TS1005: '{' expected. +/other4.ts(9,58): error TS1005: ',' expected. +/other4.ts(9,59): error TS1134: Variable declaration expected. +/other4.ts(9,76): error TS1005: ',' expected. +/other4.ts(10,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other4.ts(10,48): error TS1005: '{' expected. +/other4.ts(10,58): error TS1005: ',' expected. +/other4.ts(10,59): error TS1134: Variable declaration expected. +/other4.ts(10,75): error TS1005: ',' expected. +/other5.ts(2,29): error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. +/other5.ts(3,29): error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. +/other5.ts(3,35): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +/other5.ts(5,56): error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. +/other5.ts(6,56): error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. +/other5.ts(6,62): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + + +!!! error TS2468: Cannot find global value 'Promise'. +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} + +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} + +==== /index.ts (2 errors) ==== + export type LocalInterface = + & import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface + ~~~~~~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + + export const a = (null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface); + ~~~~~~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); + +==== /other.ts (28 errors) ==== + // missing with: + export type LocalInterface = + & import("pkg", {"resolution-mode": "require"}).RequireInterface + ~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~~~~~~~~ +!!! error TS1005: 'with' expected. +!!! related TS1007 /other.ts:3:21: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + & import("pkg", {"resolution-mode": "import"}).ImportInterface; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2712: 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. + ~~~~~~~~~~~~~~~~~ +!!! error TS2353: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. + + export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); + ~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~~~~~~~~ +!!! error TS1005: 'with' expected. +!!! related TS1007 /other.ts:6:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS1434: Unexpected keyword or identifier. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + ~ +!!! error TS1128: Declaration or statement expected. + export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); + ~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~~~~~~~~ +!!! error TS1005: 'with' expected. +!!! related TS1007 /other.ts:7:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~ +!!! error TS1434: Unexpected keyword or identifier. + ~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'ImportInterface'. + ~ +!!! error TS1128: Declaration or statement expected. + +==== /other2.ts (6 errors) ==== + // wrong attribute key + export type LocalInterface = + & import("pkg", { with: {"bad": "require"} }).RequireInterface + ~~~~~ +!!! error TS1463: 'resolution-mode' is the only valid key for type import attributes. + & import("pkg", { with: {"bad": "import"} }).ImportInterface; + ~~~~~ +!!! error TS1463: 'resolution-mode' is the only valid key for type import attributes. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + + export const a = (null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface); + ~~~~~ +!!! error TS1463: 'resolution-mode' is the only valid key for type import attributes. + export const b = (null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface); + ~~~~~ +!!! error TS1463: 'resolution-mode' is the only valid key for type import attributes. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + +==== /other3.ts (17 errors) ==== + // Array instead of object-y thing + export type LocalInterface = + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other3.ts:3:21: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2712: 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. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2559: Type '{ "resolution-mode": string; }[]' has no properties in common with type 'ImportCallOptions'. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. + + export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other3.ts:6:48: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. + ~ +!!! error TS1005: ',' expected. + export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other3.ts:7:48: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2538: Type '{ "resolution-mode": "import"; }' cannot be used as an index type. + ~ +!!! error TS1005: ',' expected. + +==== /other4.ts (19 errors) ==== + // Indirected attribute objecty-thing - not allowed + type Attribute1 = { with: {"resolution-mode": "require"} }; + type Attribute2 = { with: {"resolution-mode": "import"} }; + + export type LocalInterface = + & import("pkg", Attribute1).RequireInterface + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other4.ts:6:21: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~ +!!! error TS2448: Block-scoped variable 'Attribute1' used before its declaration. +!!! related TS2728 /other4.ts:9:48: 'Attribute1' is declared here. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS2448: Block-scoped variable 'RequireInterface' used before its declaration. +!!! related TS2728 /other4.ts:9:60: 'RequireInterface' is declared here. + & import("pkg", Attribute2).ImportInterface; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2712: 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. + ~~~~~~~~~~ +!!! error TS2448: Block-scoped variable 'Attribute2' used before its declaration. +!!! related TS2728 /other4.ts:10:48: 'Attribute2' is declared here. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. + + export const a = (null as any as import("pkg", Attribute1).RequireInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other4.ts:9:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1134: Variable declaration expected. + ~ +!!! error TS1005: ',' expected. + export const b = (null as any as import("pkg", Attribute2).ImportInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other4.ts:10:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1134: Variable declaration expected. + ~ +!!! error TS1005: ',' expected. + +==== /other5.ts (6 errors) ==== + export type LocalInterface = + & import("pkg", { with: {} }).RequireInterface + ~~ +!!! error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. + & import("pkg", { with: {} }).ImportInterface; + ~~ +!!! error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + + export const a = (null as any as import("pkg", { with: {} }).RequireInterface); + ~~ +!!! error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. + export const b = (null as any as import("pkg", { with: {} }).ImportInterface); + ~~ +!!! error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node16).js b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node16).js new file mode 100644 index 0000000000000..63b333fded12a --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node16).js @@ -0,0 +1,153 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} + +//// [require.d.ts] +export interface RequireInterface {} + +//// [index.ts] +export type LocalInterface = + & import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); + +//// [other.ts] +// missing with: +export type LocalInterface = + & import("pkg", {"resolution-mode": "require"}).RequireInterface + & import("pkg", {"resolution-mode": "import"}).ImportInterface; + +export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); +export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); + +//// [other2.ts] +// wrong attribute key +export type LocalInterface = + & import("pkg", { with: {"bad": "require"} }).RequireInterface + & import("pkg", { with: {"bad": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface); + +//// [other3.ts] +// Array instead of object-y thing +export type LocalInterface = + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; + +export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); +export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); + +//// [other4.ts] +// Indirected attribute objecty-thing - not allowed +type Attribute1 = { with: {"resolution-mode": "require"} }; +type Attribute2 = { with: {"resolution-mode": "import"} }; + +export type LocalInterface = + & import("pkg", Attribute1).RequireInterface + & import("pkg", Attribute2).ImportInterface; + +export const a = (null as any as import("pkg", Attribute1).RequireInterface); +export const b = (null as any as import("pkg", Attribute2).ImportInterface); + +//// [other5.ts] +export type LocalInterface = + & import("pkg", { with: {} }).RequireInterface + & import("pkg", { with: {} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {} }).ImportInterface); + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; +//// [other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +"resolution-mode"; +"require"; +RequireInterface + & import("pkg", { "resolution-mode": "import" }).ImportInterface; +exports.a = null; +"resolution-mode"; +"require"; +RequireInterface; +; +exports.b = null; +"resolution-mode"; +"import"; +ImportInterface; +; +//// [other2.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; +//// [other3.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +RequireInterface + & import("pkg", [{ "resolution-mode": "import" }]).ImportInterface; +exports.a = null.RequireInterface; +exports.b = null.ImportInterface; +//// [other4.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImportInterface = exports.Attribute2 = exports.b = exports.RequireInterface = exports.Attribute1 = exports.a = void 0; +exports.Attribute1; +exports.RequireInterface + & import("pkg", exports.Attribute2).ImportInterface; +exports.a = null; +exports.b = null; +//// [other5.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; + + +//// [index.d.ts] +export type LocalInterface = import("pkg", { with: { "resolution-mode": "foobar" } }).RequireInterface & import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; +export declare const a: import("pkg").RequireInterface; +export declare const b: import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; +//// [other.d.ts] +export type LocalInterface = import("pkg", { with: {} }); +export declare const a: any; +export declare const b: any; +//// [other2.d.ts] +export type LocalInterface = import("pkg", { with: { "bad": "require" } }).RequireInterface & import("pkg", { with: { "bad": "import" } }).ImportInterface; +export declare const a: import("pkg").RequireInterface; +export declare const b: any; +//// [other3.d.ts] +export type LocalInterface = import("pkg", { with: {} })[{ + "resolution-mode": "require"; +}]; +export declare const a: any; +export declare const b: any; +//// [other4.d.ts] +export type LocalInterface = import("pkg", { with: {} }); +export declare const a: any, Attribute1: any, RequireInterface: any; +export declare const b: any, Attribute2: any, ImportInterface: any; +//// [other5.d.ts] +export type LocalInterface = import("pkg", { with: {} }).RequireInterface & import("pkg", { with: {} }).ImportInterface; +export declare const a: import("pkg").RequireInterface; +export declare const b: any; diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node16).symbols b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node16).symbols new file mode 100644 index 0000000000000..8a23a85dd4673 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node16).symbols @@ -0,0 +1,130 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts] //// + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +=== /index.ts === +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) + + & import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface); +>a : Symbol(a, Decl(index.ts, 4, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); +>b : Symbol(b, Decl(index.ts, 5, 12)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /other.ts === +// missing with: +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other.ts, 0, 0)) + + & import("pkg", {"resolution-mode": "require"}).RequireInterface + & import("pkg", {"resolution-mode": "import"}).ImportInterface; +>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other.ts, 3, 21)) + +export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); +>a : Symbol(a, Decl(other.ts, 5, 12)) + +export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); +>b : Symbol(b, Decl(other.ts, 6, 12)) + +=== /other2.ts === +// wrong attribute key +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other2.ts, 0, 0)) + + & import("pkg", { with: {"bad": "require"} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { with: {"bad": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface); +>a : Symbol(a, Decl(other2.ts, 5, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface); +>b : Symbol(b, Decl(other2.ts, 6, 12)) + +=== /other3.ts === +// Array instead of object-y thing +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other3.ts, 0, 0)) + + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 2, 23)) + + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; +>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 3, 23)) + +export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); +>a : Symbol(a, Decl(other3.ts, 5, 12)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 5, 50)) + +export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); +>b : Symbol(b, Decl(other3.ts, 6, 12)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 6, 50)) + +=== /other4.ts === +// Indirected attribute objecty-thing - not allowed +type Attribute1 = { with: {"resolution-mode": "require"} }; +>Attribute1 : Symbol(Attribute1, Decl(other4.ts, 0, 0), Decl(other4.ts, 8, 46)) +>with : Symbol(with, Decl(other4.ts, 1, 19)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other4.ts, 1, 27)) + +type Attribute2 = { with: {"resolution-mode": "import"} }; +>Attribute2 : Symbol(Attribute2, Decl(other4.ts, 1, 59), Decl(other4.ts, 9, 46)) +>with : Symbol(with, Decl(other4.ts, 2, 19)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other4.ts, 2, 27)) + +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other4.ts, 2, 58)) + + & import("pkg", Attribute1).RequireInterface +>Attribute1 : Symbol(Attribute1, Decl(other4.ts, 8, 46)) +>RequireInterface : Symbol(RequireInterface, Decl(other4.ts, 8, 59)) + + & import("pkg", Attribute2).ImportInterface; +>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) +>Attribute2 : Symbol(Attribute2, Decl(other4.ts, 9, 46)) + +export const a = (null as any as import("pkg", Attribute1).RequireInterface); +>a : Symbol(a, Decl(other4.ts, 8, 12)) +>Attribute1 : Symbol(Attribute1, Decl(other4.ts, 8, 46)) +>RequireInterface : Symbol(RequireInterface, Decl(other4.ts, 8, 59)) + +export const b = (null as any as import("pkg", Attribute2).ImportInterface); +>b : Symbol(b, Decl(other4.ts, 9, 12)) +>Attribute2 : Symbol(Attribute2, Decl(other4.ts, 9, 46)) +>ImportInterface : Symbol(ImportInterface, Decl(other4.ts, 9, 59)) + +=== /other5.ts === +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other5.ts, 0, 0)) + + & import("pkg", { with: {} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { with: {} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {} }).RequireInterface); +>a : Symbol(a, Decl(other5.ts, 4, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { with: {} }).ImportInterface); +>b : Symbol(b, Decl(other5.ts, 5, 12)) + diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node16).types b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node16).types new file mode 100644 index 0000000000000..fb98c821d00cd --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=node16).types @@ -0,0 +1,187 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts] //// + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} + +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} + +=== /index.ts === +export type LocalInterface = +>LocalInterface : import("/node_modules/pkg/require").RequireInterface & import("/node_modules/pkg/import").ImportInterface + + & import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +>(null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +>null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +>null as any : any + +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); +>b : import("/node_modules/pkg/import").ImportInterface +>(null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface) : import("/node_modules/pkg/import").ImportInterface +>null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface : import("/node_modules/pkg/import").ImportInterface +>null as any : any + +=== /other.ts === +// missing with: +export type LocalInterface = +>LocalInterface : any + + & import("pkg", {"resolution-mode": "require"}).RequireInterface +>"resolution-mode" : "resolution-mode" +>"require" : "require" +>RequireInterface & import("pkg", {"resolution-mode": "import"}).ImportInterface : number +>RequireInterface : any + + & import("pkg", {"resolution-mode": "import"}).ImportInterface; +>import("pkg", {"resolution-mode": "import"}).ImportInterface : any +>import("pkg", {"resolution-mode": "import"}) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> +>"pkg" : "pkg" +>{"resolution-mode": "import"} : { "resolution-mode": string; } +>"resolution-mode" : string +>"import" : "import" +>ImportInterface : any + +export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); +>a : any +>(null as any as import("pkg", { : any +>null as any as import("pkg", { : any +>null as any : any +>"resolution-mode" : "resolution-mode" +>"require" : "require" +>RequireInterface : any + +export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); +>b : any +>(null as any as import("pkg", { : any +>null as any as import("pkg", { : any +>null as any : any +>"resolution-mode" : "resolution-mode" +>"import" : "import" +>ImportInterface : any + +=== /other2.ts === +// wrong attribute key +export type LocalInterface = +>LocalInterface : any + + & import("pkg", { with: {"bad": "require"} }).RequireInterface + & import("pkg", { with: {"bad": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +>(null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +>null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +>null as any : any + +export const b = (null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface); +>b : any +>(null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface) : any +>null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface : any +>null as any : any + +=== /other3.ts === +// Array instead of object-y thing +export type LocalInterface = +>LocalInterface : any + + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface +>"resolution-mode" : "require" +>RequireInterface & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : number +>RequireInterface : any + + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; +>import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : any +>import("pkg", [ {"resolution-mode": "import"} ]) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> +>"pkg" : "pkg" +>[ {"resolution-mode": "import"} ] : { "resolution-mode": string; }[] +>{"resolution-mode": "import"} : { "resolution-mode": string; } +>"resolution-mode" : string +>"import" : "import" +>ImportInterface : any + +export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); +>a : any +>(null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface : any +>(null as any as import("pkg", [ {"resolution-mode": "require"} ]) : any +>null as any as import("pkg", [ {"resolution-mode": "require"} ] : any +>null as any : any +>"resolution-mode" : "require" +>RequireInterface : any + +export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); +>b : any +>(null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : any +>(null as any as import("pkg", [ {"resolution-mode": "import"} ]) : any +>null as any as import("pkg", [ {"resolution-mode": "import"} ] : any +>null as any : any +>"resolution-mode" : "import" +>ImportInterface : any + +=== /other4.ts === +// Indirected attribute objecty-thing - not allowed +type Attribute1 = { with: {"resolution-mode": "require"} }; +>Attribute1 : { with: { "resolution-mode": "require";}; } +>with : { "resolution-mode": "require"; } +>"resolution-mode" : "require" + +type Attribute2 = { with: {"resolution-mode": "import"} }; +>Attribute2 : { with: { "resolution-mode": "import";}; } +>with : { "resolution-mode": "import"; } +>"resolution-mode" : "import" + +export type LocalInterface = +>LocalInterface : any + + & import("pkg", Attribute1).RequireInterface +>Attribute1 : any +>RequireInterface & import("pkg", Attribute2).ImportInterface : number +>RequireInterface : any + + & import("pkg", Attribute2).ImportInterface; +>import("pkg", Attribute2).ImportInterface : any +>import("pkg", Attribute2) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> +>"pkg" : "pkg" +>Attribute2 : any +>ImportInterface : any + +export const a = (null as any as import("pkg", Attribute1).RequireInterface); +>a : any +>(null as any as import("pkg", : any +>null as any as import("pkg", : any +>null as any : any +>Attribute1 : any +>RequireInterface : any + +export const b = (null as any as import("pkg", Attribute2).ImportInterface); +>b : any +>(null as any as import("pkg", : any +>null as any as import("pkg", : any +>null as any : any +>Attribute2 : any +>ImportInterface : any + +=== /other5.ts === +export type LocalInterface = +>LocalInterface : any + + & import("pkg", { with: {} }).RequireInterface + & import("pkg", { with: {} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +>(null as any as import("pkg", { with: {} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +>null as any as import("pkg", { with: {} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +>null as any : any + +export const b = (null as any as import("pkg", { with: {} }).ImportInterface); +>b : any +>(null as any as import("pkg", { with: {} }).ImportInterface) : any +>null as any as import("pkg", { with: {} }).ImportInterface : any +>null as any : any + diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=nodenext).errors.txt new file mode 100644 index 0000000000000..340ef90ef8368 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=nodenext).errors.txt @@ -0,0 +1,319 @@ +error TS2468: Cannot find global value 'Promise'. +/index.ts(2,49): error TS1453: `resolution-mode` should be either `require` or `import`. +/index.ts(5,76): error TS1453: `resolution-mode` should be either `require` or `import`. +/other.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other.ts(3,22): error TS1005: 'with' expected. +/other.ts(3,39): error TS1005: ';' expected. +/other.ts(3,50): error TS1128: Declaration or statement expected. +/other.ts(3,51): error TS1128: Declaration or statement expected. +/other.ts(3,52): error TS1128: Declaration or statement expected. +/other.ts(3,53): error TS2304: Cannot find name 'RequireInterface'. +/other.ts(4,7): error TS2712: 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. +/other.ts(4,22): error TS2353: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. +/other.ts(4,52): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. +/other.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other.ts(6,49): error TS1005: 'with' expected. +/other.ts(6,66): error TS1005: ';' expected. +/other.ts(6,77): error TS1128: Declaration or statement expected. +/other.ts(6,78): error TS1128: Declaration or statement expected. +/other.ts(6,79): error TS1128: Declaration or statement expected. +/other.ts(6,80): error TS1434: Unexpected keyword or identifier. +/other.ts(6,80): error TS2304: Cannot find name 'RequireInterface'. +/other.ts(6,96): error TS1128: Declaration or statement expected. +/other.ts(7,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other.ts(7,49): error TS1005: 'with' expected. +/other.ts(7,66): error TS1005: ';' expected. +/other.ts(7,76): error TS1128: Declaration or statement expected. +/other.ts(7,77): error TS1128: Declaration or statement expected. +/other.ts(7,78): error TS1128: Declaration or statement expected. +/other.ts(7,79): error TS1434: Unexpected keyword or identifier. +/other.ts(7,79): error TS2304: Cannot find name 'ImportInterface'. +/other.ts(7,94): error TS1128: Declaration or statement expected. +/other2.ts(3,30): error TS1463: 'resolution-mode' is the only valid key for type import attributes. +/other2.ts(4,30): error TS1463: 'resolution-mode' is the only valid key for type import attributes. +/other2.ts(4,50): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +/other2.ts(6,57): error TS1463: 'resolution-mode' is the only valid key for type import attributes. +/other2.ts(7,57): error TS1463: 'resolution-mode' is the only valid key for type import attributes. +/other2.ts(7,77): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +/other3.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other3.ts(3,21): error TS1005: '{' expected. +/other3.ts(3,23): error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. +/other3.ts(3,55): error TS1005: ';' expected. +/other3.ts(3,56): error TS1128: Declaration or statement expected. +/other3.ts(3,57): error TS2304: Cannot find name 'RequireInterface'. +/other3.ts(4,7): error TS2712: 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. +/other3.ts(4,21): error TS2559: Type '{ "resolution-mode": string; }[]' has no properties in common with type 'ImportCallOptions'. +/other3.ts(4,56): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. +/other3.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other3.ts(6,48): error TS1005: '{' expected. +/other3.ts(6,50): error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. +/other3.ts(6,100): error TS1005: ',' expected. +/other3.ts(7,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other3.ts(7,48): error TS1005: '{' expected. +/other3.ts(7,50): error TS2538: Type '{ "resolution-mode": "import"; }' cannot be used as an index type. +/other3.ts(7,98): error TS1005: ',' expected. +/other4.ts(6,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other4.ts(6,21): error TS1005: '{' expected. +/other4.ts(6,21): error TS2448: Block-scoped variable 'Attribute1' used before its declaration. +/other4.ts(6,31): error TS1128: Declaration or statement expected. +/other4.ts(6,32): error TS1128: Declaration or statement expected. +/other4.ts(6,33): error TS2448: Block-scoped variable 'RequireInterface' used before its declaration. +/other4.ts(7,7): error TS2712: 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. +/other4.ts(7,21): error TS2448: Block-scoped variable 'Attribute2' used before its declaration. +/other4.ts(7,33): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. +/other4.ts(9,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other4.ts(9,48): error TS1005: '{' expected. +/other4.ts(9,58): error TS1005: ',' expected. +/other4.ts(9,59): error TS1134: Variable declaration expected. +/other4.ts(9,76): error TS1005: ',' expected. +/other4.ts(10,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/other4.ts(10,48): error TS1005: '{' expected. +/other4.ts(10,58): error TS1005: ',' expected. +/other4.ts(10,59): error TS1134: Variable declaration expected. +/other4.ts(10,75): error TS1005: ',' expected. +/other5.ts(2,29): error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. +/other5.ts(3,29): error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. +/other5.ts(3,35): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. +/other5.ts(5,56): error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. +/other5.ts(6,56): error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. +/other5.ts(6,62): error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + + +!!! error TS2468: Cannot find global value 'Promise'. +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} + +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} + +==== /index.ts (2 errors) ==== + export type LocalInterface = + & import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface + ~~~~~~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + + export const a = (null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface); + ~~~~~~~~ +!!! error TS1453: `resolution-mode` should be either `require` or `import`. + export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); + +==== /other.ts (28 errors) ==== + // missing with: + export type LocalInterface = + & import("pkg", {"resolution-mode": "require"}).RequireInterface + ~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~~~~~~~~ +!!! error TS1005: 'with' expected. +!!! related TS1007 /other.ts:3:21: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + & import("pkg", {"resolution-mode": "import"}).ImportInterface; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2712: 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. + ~~~~~~~~~~~~~~~~~ +!!! error TS2353: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. + + export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); + ~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~~~~~~~~ +!!! error TS1005: 'with' expected. +!!! related TS1007 /other.ts:6:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS1434: Unexpected keyword or identifier. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + ~ +!!! error TS1128: Declaration or statement expected. + export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); + ~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~~~~~~~~ +!!! error TS1005: 'with' expected. +!!! related TS1007 /other.ts:7:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~ +!!! error TS1434: Unexpected keyword or identifier. + ~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'ImportInterface'. + ~ +!!! error TS1128: Declaration or statement expected. + +==== /other2.ts (6 errors) ==== + // wrong attribute key + export type LocalInterface = + & import("pkg", { with: {"bad": "require"} }).RequireInterface + ~~~~~ +!!! error TS1463: 'resolution-mode' is the only valid key for type import attributes. + & import("pkg", { with: {"bad": "import"} }).ImportInterface; + ~~~~~ +!!! error TS1463: 'resolution-mode' is the only valid key for type import attributes. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + + export const a = (null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface); + ~~~~~ +!!! error TS1463: 'resolution-mode' is the only valid key for type import attributes. + export const b = (null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface); + ~~~~~ +!!! error TS1463: 'resolution-mode' is the only valid key for type import attributes. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + +==== /other3.ts (17 errors) ==== + // Array instead of object-y thing + export type LocalInterface = + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other3.ts:3:21: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2712: 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. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2559: Type '{ "resolution-mode": string; }[]' has no properties in common with type 'ImportCallOptions'. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. + + export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other3.ts:6:48: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2538: Type '{ "resolution-mode": "require"; }' cannot be used as an index type. + ~ +!!! error TS1005: ',' expected. + export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other3.ts:7:48: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2538: Type '{ "resolution-mode": "import"; }' cannot be used as an index type. + ~ +!!! error TS1005: ',' expected. + +==== /other4.ts (19 errors) ==== + // Indirected attribute objecty-thing - not allowed + type Attribute1 = { with: {"resolution-mode": "require"} }; + type Attribute2 = { with: {"resolution-mode": "import"} }; + + export type LocalInterface = + & import("pkg", Attribute1).RequireInterface + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other4.ts:6:21: The parser expected to find a '}' to match the '{' token here. + ~~~~~~~~~~ +!!! error TS2448: Block-scoped variable 'Attribute1' used before its declaration. +!!! related TS2728 /other4.ts:9:48: 'Attribute1' is declared here. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS2448: Block-scoped variable 'RequireInterface' used before its declaration. +!!! related TS2728 /other4.ts:9:60: 'RequireInterface' is declared here. + & import("pkg", Attribute2).ImportInterface; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2712: 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. + ~~~~~~~~~~ +!!! error TS2448: Block-scoped variable 'Attribute2' used before its declaration. +!!! related TS2728 /other4.ts:10:48: 'Attribute2' is declared here. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. + + export const a = (null as any as import("pkg", Attribute1).RequireInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other4.ts:9:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1134: Variable declaration expected. + ~ +!!! error TS1005: ',' expected. + export const b = (null as any as import("pkg", Attribute2).ImportInterface); + ~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~~~~~~~ +!!! error TS1005: '{' expected. +!!! related TS1007 /other4.ts:10:48: The parser expected to find a '}' to match the '{' token here. + ~ +!!! error TS1005: ',' expected. + ~ +!!! error TS1134: Variable declaration expected. + ~ +!!! error TS1005: ',' expected. + +==== /other5.ts (6 errors) ==== + export type LocalInterface = + & import("pkg", { with: {} }).RequireInterface + ~~ +!!! error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. + & import("pkg", { with: {} }).ImportInterface; + ~~ +!!! error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. + + export const a = (null as any as import("pkg", { with: {} }).RequireInterface); + ~~ +!!! error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. + export const b = (null as any as import("pkg", { with: {} }).ImportInterface); + ~~ +!!! error TS1464: Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'. + ~~~~~~~~~~~~~~~ +!!! error TS2694: Namespace '"/node_modules/pkg/require"' has no exported member 'ImportInterface'. \ No newline at end of file diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=nodenext).js b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=nodenext).js new file mode 100644 index 0000000000000..63b333fded12a --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=nodenext).js @@ -0,0 +1,153 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +//// [import.d.ts] +export interface ImportInterface {} + +//// [require.d.ts] +export interface RequireInterface {} + +//// [index.ts] +export type LocalInterface = + & import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); + +//// [other.ts] +// missing with: +export type LocalInterface = + & import("pkg", {"resolution-mode": "require"}).RequireInterface + & import("pkg", {"resolution-mode": "import"}).ImportInterface; + +export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); +export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); + +//// [other2.ts] +// wrong attribute key +export type LocalInterface = + & import("pkg", { with: {"bad": "require"} }).RequireInterface + & import("pkg", { with: {"bad": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface); + +//// [other3.ts] +// Array instead of object-y thing +export type LocalInterface = + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; + +export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); +export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); + +//// [other4.ts] +// Indirected attribute objecty-thing - not allowed +type Attribute1 = { with: {"resolution-mode": "require"} }; +type Attribute2 = { with: {"resolution-mode": "import"} }; + +export type LocalInterface = + & import("pkg", Attribute1).RequireInterface + & import("pkg", Attribute2).ImportInterface; + +export const a = (null as any as import("pkg", Attribute1).RequireInterface); +export const b = (null as any as import("pkg", Attribute2).ImportInterface); + +//// [other5.ts] +export type LocalInterface = + & import("pkg", { with: {} }).RequireInterface + & import("pkg", { with: {} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {} }).ImportInterface); + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; +//// [other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +"resolution-mode"; +"require"; +RequireInterface + & import("pkg", { "resolution-mode": "import" }).ImportInterface; +exports.a = null; +"resolution-mode"; +"require"; +RequireInterface; +; +exports.b = null; +"resolution-mode"; +"import"; +ImportInterface; +; +//// [other2.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; +//// [other3.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +RequireInterface + & import("pkg", [{ "resolution-mode": "import" }]).ImportInterface; +exports.a = null.RequireInterface; +exports.b = null.ImportInterface; +//// [other4.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImportInterface = exports.Attribute2 = exports.b = exports.RequireInterface = exports.Attribute1 = exports.a = void 0; +exports.Attribute1; +exports.RequireInterface + & import("pkg", exports.Attribute2).ImportInterface; +exports.a = null; +exports.b = null; +//// [other5.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +exports.a = null; +exports.b = null; + + +//// [index.d.ts] +export type LocalInterface = import("pkg", { with: { "resolution-mode": "foobar" } }).RequireInterface & import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; +export declare const a: import("pkg").RequireInterface; +export declare const b: import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; +//// [other.d.ts] +export type LocalInterface = import("pkg", { with: {} }); +export declare const a: any; +export declare const b: any; +//// [other2.d.ts] +export type LocalInterface = import("pkg", { with: { "bad": "require" } }).RequireInterface & import("pkg", { with: { "bad": "import" } }).ImportInterface; +export declare const a: import("pkg").RequireInterface; +export declare const b: any; +//// [other3.d.ts] +export type LocalInterface = import("pkg", { with: {} })[{ + "resolution-mode": "require"; +}]; +export declare const a: any; +export declare const b: any; +//// [other4.d.ts] +export type LocalInterface = import("pkg", { with: {} }); +export declare const a: any, Attribute1: any, RequireInterface: any; +export declare const b: any, Attribute2: any, ImportInterface: any; +//// [other5.d.ts] +export type LocalInterface = import("pkg", { with: {} }).RequireInterface & import("pkg", { with: {} }).ImportInterface; +export declare const a: import("pkg").RequireInterface; +export declare const b: any; diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=nodenext).symbols b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=nodenext).symbols new file mode 100644 index 0000000000000..8a23a85dd4673 --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=nodenext).symbols @@ -0,0 +1,130 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts] //// + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +=== /index.ts === +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) + + & import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface); +>a : Symbol(a, Decl(index.ts, 4, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); +>b : Symbol(b, Decl(index.ts, 5, 12)) +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /other.ts === +// missing with: +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other.ts, 0, 0)) + + & import("pkg", {"resolution-mode": "require"}).RequireInterface + & import("pkg", {"resolution-mode": "import"}).ImportInterface; +>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other.ts, 3, 21)) + +export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); +>a : Symbol(a, Decl(other.ts, 5, 12)) + +export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); +>b : Symbol(b, Decl(other.ts, 6, 12)) + +=== /other2.ts === +// wrong attribute key +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other2.ts, 0, 0)) + + & import("pkg", { with: {"bad": "require"} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { with: {"bad": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface); +>a : Symbol(a, Decl(other2.ts, 5, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface); +>b : Symbol(b, Decl(other2.ts, 6, 12)) + +=== /other3.ts === +// Array instead of object-y thing +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other3.ts, 0, 0)) + + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 2, 23)) + + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; +>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 3, 23)) + +export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); +>a : Symbol(a, Decl(other3.ts, 5, 12)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 5, 50)) + +export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); +>b : Symbol(b, Decl(other3.ts, 6, 12)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other3.ts, 6, 50)) + +=== /other4.ts === +// Indirected attribute objecty-thing - not allowed +type Attribute1 = { with: {"resolution-mode": "require"} }; +>Attribute1 : Symbol(Attribute1, Decl(other4.ts, 0, 0), Decl(other4.ts, 8, 46)) +>with : Symbol(with, Decl(other4.ts, 1, 19)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other4.ts, 1, 27)) + +type Attribute2 = { with: {"resolution-mode": "import"} }; +>Attribute2 : Symbol(Attribute2, Decl(other4.ts, 1, 59), Decl(other4.ts, 9, 46)) +>with : Symbol(with, Decl(other4.ts, 2, 19)) +>"resolution-mode" : Symbol("resolution-mode", Decl(other4.ts, 2, 27)) + +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other4.ts, 2, 58)) + + & import("pkg", Attribute1).RequireInterface +>Attribute1 : Symbol(Attribute1, Decl(other4.ts, 8, 46)) +>RequireInterface : Symbol(RequireInterface, Decl(other4.ts, 8, 59)) + + & import("pkg", Attribute2).ImportInterface; +>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) +>Attribute2 : Symbol(Attribute2, Decl(other4.ts, 9, 46)) + +export const a = (null as any as import("pkg", Attribute1).RequireInterface); +>a : Symbol(a, Decl(other4.ts, 8, 12)) +>Attribute1 : Symbol(Attribute1, Decl(other4.ts, 8, 46)) +>RequireInterface : Symbol(RequireInterface, Decl(other4.ts, 8, 59)) + +export const b = (null as any as import("pkg", Attribute2).ImportInterface); +>b : Symbol(b, Decl(other4.ts, 9, 12)) +>Attribute2 : Symbol(Attribute2, Decl(other4.ts, 9, 46)) +>ImportInterface : Symbol(ImportInterface, Decl(other4.ts, 9, 59)) + +=== /other5.ts === +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(other5.ts, 0, 0)) + + & import("pkg", { with: {} }).RequireInterface +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + + & import("pkg", { with: {} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {} }).RequireInterface); +>a : Symbol(a, Decl(other5.ts, 4, 12)) +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + +export const b = (null as any as import("pkg", { with: {} }).ImportInterface); +>b : Symbol(b, Decl(other5.ts, 5, 12)) + diff --git a/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=nodenext).types b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=nodenext).types new file mode 100644 index 0000000000000..fb98c821d00cd --- /dev/null +++ b/tests/baselines/reference/nodeModulesImportAttributesTypeModeDeclarationEmitErrors(module=nodenext).types @@ -0,0 +1,187 @@ +//// [tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts] //// + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} + +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} + +=== /index.ts === +export type LocalInterface = +>LocalInterface : import("/node_modules/pkg/require").RequireInterface & import("/node_modules/pkg/import").ImportInterface + + & import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +>(null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +>null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +>null as any : any + +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); +>b : import("/node_modules/pkg/import").ImportInterface +>(null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface) : import("/node_modules/pkg/import").ImportInterface +>null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface : import("/node_modules/pkg/import").ImportInterface +>null as any : any + +=== /other.ts === +// missing with: +export type LocalInterface = +>LocalInterface : any + + & import("pkg", {"resolution-mode": "require"}).RequireInterface +>"resolution-mode" : "resolution-mode" +>"require" : "require" +>RequireInterface & import("pkg", {"resolution-mode": "import"}).ImportInterface : number +>RequireInterface : any + + & import("pkg", {"resolution-mode": "import"}).ImportInterface; +>import("pkg", {"resolution-mode": "import"}).ImportInterface : any +>import("pkg", {"resolution-mode": "import"}) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> +>"pkg" : "pkg" +>{"resolution-mode": "import"} : { "resolution-mode": string; } +>"resolution-mode" : string +>"import" : "import" +>ImportInterface : any + +export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); +>a : any +>(null as any as import("pkg", { : any +>null as any as import("pkg", { : any +>null as any : any +>"resolution-mode" : "resolution-mode" +>"require" : "require" +>RequireInterface : any + +export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); +>b : any +>(null as any as import("pkg", { : any +>null as any as import("pkg", { : any +>null as any : any +>"resolution-mode" : "resolution-mode" +>"import" : "import" +>ImportInterface : any + +=== /other2.ts === +// wrong attribute key +export type LocalInterface = +>LocalInterface : any + + & import("pkg", { with: {"bad": "require"} }).RequireInterface + & import("pkg", { with: {"bad": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +>(null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +>null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +>null as any : any + +export const b = (null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface); +>b : any +>(null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface) : any +>null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface : any +>null as any : any + +=== /other3.ts === +// Array instead of object-y thing +export type LocalInterface = +>LocalInterface : any + + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface +>"resolution-mode" : "require" +>RequireInterface & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : number +>RequireInterface : any + + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; +>import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : any +>import("pkg", [ {"resolution-mode": "import"} ]) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> +>"pkg" : "pkg" +>[ {"resolution-mode": "import"} ] : { "resolution-mode": string; }[] +>{"resolution-mode": "import"} : { "resolution-mode": string; } +>"resolution-mode" : string +>"import" : "import" +>ImportInterface : any + +export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); +>a : any +>(null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface : any +>(null as any as import("pkg", [ {"resolution-mode": "require"} ]) : any +>null as any as import("pkg", [ {"resolution-mode": "require"} ] : any +>null as any : any +>"resolution-mode" : "require" +>RequireInterface : any + +export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); +>b : any +>(null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface : any +>(null as any as import("pkg", [ {"resolution-mode": "import"} ]) : any +>null as any as import("pkg", [ {"resolution-mode": "import"} ] : any +>null as any : any +>"resolution-mode" : "import" +>ImportInterface : any + +=== /other4.ts === +// Indirected attribute objecty-thing - not allowed +type Attribute1 = { with: {"resolution-mode": "require"} }; +>Attribute1 : { with: { "resolution-mode": "require";}; } +>with : { "resolution-mode": "require"; } +>"resolution-mode" : "require" + +type Attribute2 = { with: {"resolution-mode": "import"} }; +>Attribute2 : { with: { "resolution-mode": "import";}; } +>with : { "resolution-mode": "import"; } +>"resolution-mode" : "import" + +export type LocalInterface = +>LocalInterface : any + + & import("pkg", Attribute1).RequireInterface +>Attribute1 : any +>RequireInterface & import("pkg", Attribute2).ImportInterface : number +>RequireInterface : any + + & import("pkg", Attribute2).ImportInterface; +>import("pkg", Attribute2).ImportInterface : any +>import("pkg", Attribute2) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> +>"pkg" : "pkg" +>Attribute2 : any +>ImportInterface : any + +export const a = (null as any as import("pkg", Attribute1).RequireInterface); +>a : any +>(null as any as import("pkg", : any +>null as any as import("pkg", : any +>null as any : any +>Attribute1 : any +>RequireInterface : any + +export const b = (null as any as import("pkg", Attribute2).ImportInterface); +>b : any +>(null as any as import("pkg", : any +>null as any as import("pkg", : any +>null as any : any +>Attribute2 : any +>ImportInterface : any + +=== /other5.ts === +export type LocalInterface = +>LocalInterface : any + + & import("pkg", { with: {} }).RequireInterface + & import("pkg", { with: {} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {} }).RequireInterface); +>a : import("/node_modules/pkg/require").RequireInterface +>(null as any as import("pkg", { with: {} }).RequireInterface) : import("/node_modules/pkg/require").RequireInterface +>null as any as import("pkg", { with: {} }).RequireInterface : import("/node_modules/pkg/require").RequireInterface +>null as any : any + +export const b = (null as any as import("pkg", { with: {} }).ImportInterface); +>b : any +>(null as any as import("pkg", { with: {} }).ImportInterface) : any +>null as any as import("pkg", { with: {} }).ImportInterface : any +>null as any : any + diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).js b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).js index 1b444aae0dfb3..6c0a3531fac79 100644 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).js +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=node16).js @@ -33,4 +33,4 @@ exports.b = null; //// [index.d.ts] export type LocalInterface = import("pkg", { assert: { "resolution-mode": "require" } }).RequireInterface & import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; export declare const a: import("pkg").RequireInterface; -export declare const b: import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; +export declare const b: import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=nodenext).js b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=nodenext).js index 1b444aae0dfb3..6c0a3531fac79 100644 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmit1(module=nodenext).js @@ -33,4 +33,4 @@ exports.b = null; //// [index.d.ts] export type LocalInterface = import("pkg", { assert: { "resolution-mode": "require" } }).RequireInterface & import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; export declare const a: import("pkg").RequireInterface; -export declare const b: import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; +export declare const b: import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).errors.txt b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).errors.txt index c4c4f758de70d..2909c72239162 100644 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).errors.txt +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).errors.txt @@ -2,7 +2,7 @@ error TS2468: Cannot find global value 'Promise'. /index.ts(2,51): error TS1453: `resolution-mode` should be either `require` or `import`. /index.ts(5,78): error TS1453: `resolution-mode` should be either `require` or `import`. /other.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? -/other.ts(3,22): error TS1005: 'assert' expected. +/other.ts(3,22): error TS1005: 'with' expected. /other.ts(3,39): error TS1005: ';' expected. /other.ts(3,50): error TS1128: Declaration or statement expected. /other.ts(3,51): error TS1128: Declaration or statement expected. @@ -12,7 +12,7 @@ error TS2468: Cannot find global value 'Promise'. /other.ts(4,22): error TS2353: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. /other.ts(4,52): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. /other.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? -/other.ts(6,49): error TS1005: 'assert' expected. +/other.ts(6,49): error TS1005: 'with' expected. /other.ts(6,66): error TS1005: ';' expected. /other.ts(6,77): error TS1128: Declaration or statement expected. /other.ts(6,78): error TS1128: Declaration or statement expected. @@ -21,7 +21,7 @@ error TS2468: Cannot find global value 'Promise'. /other.ts(6,80): error TS2304: Cannot find name 'RequireInterface'. /other.ts(6,96): error TS1128: Declaration or statement expected. /other.ts(7,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? -/other.ts(7,49): error TS1005: 'assert' expected. +/other.ts(7,49): error TS1005: 'with' expected. /other.ts(7,66): error TS1005: ';' expected. /other.ts(7,76): error TS1128: Declaration or statement expected. /other.ts(7,77): error TS1128: Declaration or statement expected. @@ -111,7 +111,7 @@ error TS2468: Cannot find global value 'Promise'. ~~~~~~~~~~~~~~~ !!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? ~~~~~~~~~~~~~~~~~ -!!! error TS1005: 'assert' expected. +!!! error TS1005: 'with' expected. !!! related TS1007 /other.ts:3:21: The parser expected to find a '}' to match the '{' token here. ~ !!! error TS1005: ';' expected. @@ -135,7 +135,7 @@ error TS2468: Cannot find global value 'Promise'. ~~~~~~~~~~~~~~~ !!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? ~~~~~~~~~~~~~~~~~ -!!! error TS1005: 'assert' expected. +!!! error TS1005: 'with' expected. !!! related TS1007 /other.ts:6:48: The parser expected to find a '}' to match the '{' token here. ~ !!! error TS1005: ';' expected. @@ -155,7 +155,7 @@ error TS2468: Cannot find global value 'Promise'. ~~~~~~~~~~~~~~~ !!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? ~~~~~~~~~~~~~~~~~ -!!! error TS1005: 'assert' expected. +!!! error TS1005: 'with' expected. !!! related TS1007 /other.ts:7:48: The parser expected to find a '}' to match the '{' token here. ~ !!! error TS1005: ';' expected. diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).js b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).js index 6b34fb98748ad..061f57d2e62c7 100644 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).js +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=node16).js @@ -122,9 +122,9 @@ exports.b = null; //// [index.d.ts] export type LocalInterface = import("pkg", { assert: { "resolution-mode": "foobar" } }).RequireInterface & import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; export declare const a: import("pkg").RequireInterface; -export declare const b: import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; +export declare const b: import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; //// [other.d.ts] -export type LocalInterface = import("pkg", { assert: {} }); +export type LocalInterface = import("pkg", { with: {} }); export declare const a: any; export declare const b: any; //// [other2.d.ts] @@ -132,13 +132,13 @@ export type LocalInterface = import("pkg", { assert: { "bad": "require" } }).Req export declare const a: import("pkg").RequireInterface; export declare const b: any; //// [other3.d.ts] -export type LocalInterface = import("pkg", { assert: {} })[{ +export type LocalInterface = import("pkg", { with: {} })[{ "resolution-mode": "require"; }]; export declare const a: any; export declare const b: any; //// [other4.d.ts] -export type LocalInterface = import("pkg", { assert: {} }); +export type LocalInterface = import("pkg", { with: {} }); export declare const a: any, Asserts1: any, RequireInterface: any; export declare const b: any, Asserts2: any, ImportInterface: any; //// [other5.d.ts] diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).errors.txt b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).errors.txt index c4c4f758de70d..2909c72239162 100644 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).errors.txt +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).errors.txt @@ -2,7 +2,7 @@ error TS2468: Cannot find global value 'Promise'. /index.ts(2,51): error TS1453: `resolution-mode` should be either `require` or `import`. /index.ts(5,78): error TS1453: `resolution-mode` should be either `require` or `import`. /other.ts(3,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? -/other.ts(3,22): error TS1005: 'assert' expected. +/other.ts(3,22): error TS1005: 'with' expected. /other.ts(3,39): error TS1005: ';' expected. /other.ts(3,50): error TS1128: Declaration or statement expected. /other.ts(3,51): error TS1128: Declaration or statement expected. @@ -12,7 +12,7 @@ error TS2468: Cannot find global value 'Promise'. /other.ts(4,22): error TS2353: Object literal may only specify known properties, and '"resolution-mode"' does not exist in type 'ImportCallOptions'. /other.ts(4,52): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. /other.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? -/other.ts(6,49): error TS1005: 'assert' expected. +/other.ts(6,49): error TS1005: 'with' expected. /other.ts(6,66): error TS1005: ';' expected. /other.ts(6,77): error TS1128: Declaration or statement expected. /other.ts(6,78): error TS1128: Declaration or statement expected. @@ -21,7 +21,7 @@ error TS2468: Cannot find global value 'Promise'. /other.ts(6,80): error TS2304: Cannot find name 'RequireInterface'. /other.ts(6,96): error TS1128: Declaration or statement expected. /other.ts(7,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? -/other.ts(7,49): error TS1005: 'assert' expected. +/other.ts(7,49): error TS1005: 'with' expected. /other.ts(7,66): error TS1005: ';' expected. /other.ts(7,76): error TS1128: Declaration or statement expected. /other.ts(7,77): error TS1128: Declaration or statement expected. @@ -111,7 +111,7 @@ error TS2468: Cannot find global value 'Promise'. ~~~~~~~~~~~~~~~ !!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? ~~~~~~~~~~~~~~~~~ -!!! error TS1005: 'assert' expected. +!!! error TS1005: 'with' expected. !!! related TS1007 /other.ts:3:21: The parser expected to find a '}' to match the '{' token here. ~ !!! error TS1005: ';' expected. @@ -135,7 +135,7 @@ error TS2468: Cannot find global value 'Promise'. ~~~~~~~~~~~~~~~ !!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? ~~~~~~~~~~~~~~~~~ -!!! error TS1005: 'assert' expected. +!!! error TS1005: 'with' expected. !!! related TS1007 /other.ts:6:48: The parser expected to find a '}' to match the '{' token here. ~ !!! error TS1005: ';' expected. @@ -155,7 +155,7 @@ error TS2468: Cannot find global value 'Promise'. ~~~~~~~~~~~~~~~ !!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? ~~~~~~~~~~~~~~~~~ -!!! error TS1005: 'assert' expected. +!!! error TS1005: 'with' expected. !!! related TS1007 /other.ts:7:48: The parser expected to find a '}' to match the '{' token here. ~ !!! error TS1005: ';' expected. diff --git a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).js b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).js index 6b34fb98748ad..061f57d2e62c7 100644 --- a/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).js +++ b/tests/baselines/reference/nodeModulesImportTypeModeDeclarationEmitErrors1(module=nodenext).js @@ -122,9 +122,9 @@ exports.b = null; //// [index.d.ts] export type LocalInterface = import("pkg", { assert: { "resolution-mode": "foobar" } }).RequireInterface & import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; export declare const a: import("pkg").RequireInterface; -export declare const b: import("pkg", { assert: { "resolution-mode": "import" } }).ImportInterface; +export declare const b: import("pkg", { with: { "resolution-mode": "import" } }).ImportInterface; //// [other.d.ts] -export type LocalInterface = import("pkg", { assert: {} }); +export type LocalInterface = import("pkg", { with: {} }); export declare const a: any; export declare const b: any; //// [other2.d.ts] @@ -132,13 +132,13 @@ export type LocalInterface = import("pkg", { assert: { "bad": "require" } }).Req export declare const a: import("pkg").RequireInterface; export declare const b: any; //// [other3.d.ts] -export type LocalInterface = import("pkg", { assert: {} })[{ +export type LocalInterface = import("pkg", { with: {} })[{ "resolution-mode": "require"; }]; export declare const a: any; export declare const b: any; //// [other4.d.ts] -export type LocalInterface = import("pkg", { assert: {} }); +export type LocalInterface = import("pkg", { with: {} }); export declare const a: any, Asserts1: any, RequireInterface: any; export declare const b: any, Asserts2: any, ImportInterface: any; //// [other5.d.ts] diff --git a/tests/baselines/reference/parseImportAttributesError.errors.txt b/tests/baselines/reference/parseImportAttributesError.errors.txt new file mode 100644 index 0000000000000..55a242afe77e4 --- /dev/null +++ b/tests/baselines/reference/parseImportAttributesError.errors.txt @@ -0,0 +1,130 @@ +error TS2468: Cannot find global value 'Promise'. +/index.ts(2,7): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/index.ts(2,30): error TS1478: Identifier or string literal expected. +/index.ts(2,30): error TS2695: Left side of comma operator is unused and has no side effects. +/index.ts(2,53): error TS1005: ';' expected. +/index.ts(2,64): error TS1128: Declaration or statement expected. +/index.ts(2,66): error TS1128: Declaration or statement expected. +/index.ts(2,67): error TS1128: Declaration or statement expected. +/index.ts(2,68): error TS1128: Declaration or statement expected. +/index.ts(2,69): error TS2304: Cannot find name 'RequireInterface'. +/index.ts(3,7): error TS2712: 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. +/index.ts(3,34): error TS1005: ':' expected. +/index.ts(3,68): error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. +/index.ts(5,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/index.ts(5,57): error TS1478: Identifier or string literal expected. +/index.ts(5,57): error TS2695: Left side of comma operator is unused and has no side effects. +/index.ts(5,80): error TS1005: ';' expected. +/index.ts(5,91): error TS1128: Declaration or statement expected. +/index.ts(5,93): error TS1128: Declaration or statement expected. +/index.ts(5,94): error TS1128: Declaration or statement expected. +/index.ts(5,95): error TS1128: Declaration or statement expected. +/index.ts(5,96): error TS1434: Unexpected keyword or identifier. +/index.ts(5,96): error TS2304: Cannot find name 'RequireInterface'. +/index.ts(5,112): error TS1128: Declaration or statement expected. +/index.ts(6,34): error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? +/index.ts(6,57): error TS1478: Identifier or string literal expected. +/index.ts(6,57): error TS2695: Left side of comma operator is unused and has no side effects. +/index.ts(6,80): error TS1005: ';' expected. +/index.ts(6,90): error TS1128: Declaration or statement expected. +/index.ts(6,92): error TS1128: Declaration or statement expected. +/index.ts(6,93): error TS1128: Declaration or statement expected. +/index.ts(6,94): error TS1128: Declaration or statement expected. +/index.ts(6,95): error TS1434: Unexpected keyword or identifier. +/index.ts(6,95): error TS2304: Cannot find name 'ImportInterface'. +/index.ts(6,110): error TS1128: Declaration or statement expected. + + +!!! error TS2468: Cannot find global value 'Promise'. +==== /index.ts (34 errors) ==== + export type LocalInterface = + & import("pkg", { with: {1234, "resolution-mode": "require"} }).RequireInterface + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~ +!!! error TS1478: Identifier or string literal expected. + ~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + & import("pkg", { with: {1234, "resolution-mode": "import"} }).ImportInterface; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2712: 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. + ~ +!!! error TS1005: ':' expected. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'ImportInterface' does not exist on type 'Promise<{ default: typeof import("/node_modules/pkg/import"); }>'. + + export const a = (null as any as import("pkg", { with: {1234, "resolution-mode": "require"} }).RequireInterface); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~ +!!! error TS1478: Identifier or string literal expected. + ~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~~ +!!! error TS1434: Unexpected keyword or identifier. + ~~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'RequireInterface'. + ~ +!!! error TS1128: Declaration or statement expected. + export const b = (null as any as import("pkg", { with: {1234, "resolution-mode": "import"} }).ImportInterface); + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1340: Module 'pkg' does not refer to a type, but is used as a type here. Did you mean 'typeof import('pkg')'? + ~~~~ +!!! error TS1478: Identifier or string literal expected. + ~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS1005: ';' expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~ +!!! error TS1128: Declaration or statement expected. + ~~~~~~~~~~~~~~~ +!!! error TS1434: Unexpected keyword or identifier. + ~~~~~~~~~~~~~~~ +!!! error TS2304: Cannot find name 'ImportInterface'. + ~ +!!! error TS1128: Declaration or statement expected. + +==== /node_modules/pkg/package.json (0 errors) ==== + { + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } + } + +==== /node_modules/pkg/import.d.ts (0 errors) ==== + export interface ImportInterface {} + +==== /node_modules/pkg/require.d.ts (0 errors) ==== + export interface RequireInterface {} + \ No newline at end of file diff --git a/tests/baselines/reference/parseImportAttributesError.js b/tests/baselines/reference/parseImportAttributesError.js new file mode 100644 index 0000000000000..d2de9a505d022 --- /dev/null +++ b/tests/baselines/reference/parseImportAttributesError.js @@ -0,0 +1,51 @@ +//// [tests/cases/compiler/parseImportAttributesError.ts] //// + +//// [package.json] +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} + +//// [import.d.ts] +export interface ImportInterface {} + +//// [require.d.ts] +export interface RequireInterface {} + +//// [index.ts] +export type LocalInterface = + & import("pkg", { with: {1234, "resolution-mode": "require"} }).RequireInterface + & import("pkg", { with: {1234, "resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {1234, "resolution-mode": "require"} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {1234, "resolution-mode": "import"} }).ImportInterface); + + +//// [index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = exports.a = void 0; +1234, "resolution-mode"; +"require"; +RequireInterface + & import("pkg", { with: { 1234: , "resolution-mode": "import" } }).ImportInterface; +exports.a = null; +1234, "resolution-mode"; +"require"; +RequireInterface; +; +exports.b = null; +1234, "resolution-mode"; +"import"; +ImportInterface; +; + + +//// [index.d.ts] +export type LocalInterface = import("pkg", { with: {} }); +export declare const a: any; +export declare const b: any; diff --git a/tests/baselines/reference/parseImportAttributesError.symbols b/tests/baselines/reference/parseImportAttributesError.symbols new file mode 100644 index 0000000000000..c5717d367b5c2 --- /dev/null +++ b/tests/baselines/reference/parseImportAttributesError.symbols @@ -0,0 +1,27 @@ +//// [tests/cases/compiler/parseImportAttributesError.ts] //// + +=== /index.ts === +export type LocalInterface = +>LocalInterface : Symbol(LocalInterface, Decl(index.ts, 0, 0)) + + & import("pkg", { with: {1234, "resolution-mode": "require"} }).RequireInterface + & import("pkg", { with: {1234, "resolution-mode": "import"} }).ImportInterface; +>"pkg" : Symbol("/node_modules/pkg/import", Decl(import.d.ts, 0, 0)) +>with : Symbol(with, Decl(index.ts, 2, 21)) +>1234 : Symbol(1234, Decl(index.ts, 2, 29)) +>"resolution-mode" : Symbol("resolution-mode", Decl(index.ts, 2, 34)) + +export const a = (null as any as import("pkg", { with: {1234, "resolution-mode": "require"} }).RequireInterface); +>a : Symbol(a, Decl(index.ts, 4, 12)) + +export const b = (null as any as import("pkg", { with: {1234, "resolution-mode": "import"} }).ImportInterface); +>b : Symbol(b, Decl(index.ts, 5, 12)) + +=== /node_modules/pkg/import.d.ts === +export interface ImportInterface {} +>ImportInterface : Symbol(ImportInterface, Decl(import.d.ts, 0, 0)) + +=== /node_modules/pkg/require.d.ts === +export interface RequireInterface {} +>RequireInterface : Symbol(RequireInterface, Decl(require.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/parseImportAttributesError.types b/tests/baselines/reference/parseImportAttributesError.types new file mode 100644 index 0000000000000..60ba390c491ee --- /dev/null +++ b/tests/baselines/reference/parseImportAttributesError.types @@ -0,0 +1,57 @@ +//// [tests/cases/compiler/parseImportAttributesError.ts] //// + +=== /index.ts === +export type LocalInterface = +>LocalInterface : any + + & import("pkg", { with: {1234, "resolution-mode": "require"} }).RequireInterface +>1234, "resolution-mode" : "resolution-mode" +>1234 : 1234 +>"resolution-mode" : "resolution-mode" +>"require" : "require" +>RequireInterface & import("pkg", { with: {1234, "resolution-mode": "import"} }).ImportInterface : number +>RequireInterface : any + + & import("pkg", { with: {1234, "resolution-mode": "import"} }).ImportInterface; +>import("pkg", { with: {1234, "resolution-mode": "import"} }).ImportInterface : any +>import("pkg", { with: {1234, "resolution-mode": "import"} }) : Promise<{ default: typeof import("/node_modules/pkg/import"); }> +>"pkg" : "pkg" +>{ with: {1234, "resolution-mode": "import"} } : { with: { 1234: any; "resolution-mode": string; }; } +>with : { 1234: any; "resolution-mode": string; } +>{1234, "resolution-mode": "import"} : { 1234: any; "resolution-mode": string; } +>1234 : any +> : any +>"resolution-mode" : string +>"import" : "import" +>ImportInterface : any + +export const a = (null as any as import("pkg", { with: {1234, "resolution-mode": "require"} }).RequireInterface); +>a : any +>(null as any as import("pkg", { with: { : any +>null as any as import("pkg", { with: { : any +>null as any : any +>1234, "resolution-mode" : "resolution-mode" +>1234 : 1234 +>"resolution-mode" : "resolution-mode" +>"require" : "require" +>RequireInterface : any + +export const b = (null as any as import("pkg", { with: {1234, "resolution-mode": "import"} }).ImportInterface); +>b : any +>(null as any as import("pkg", { with: { : any +>null as any as import("pkg", { with: { : any +>null as any : any +>1234, "resolution-mode" : "resolution-mode" +>1234 : 1234 +>"resolution-mode" : "resolution-mode" +>"import" : "import" +>ImportInterface : any + +=== /node_modules/pkg/import.d.ts === + +export interface ImportInterface {} + +=== /node_modules/pkg/require.d.ts === + +export interface RequireInterface {} + diff --git a/tests/baselines/reference/plainJSGrammarErrors.errors.txt b/tests/baselines/reference/plainJSGrammarErrors.errors.txt index 8b015217e305f..b92bd5df1b8ba 100644 --- a/tests/baselines/reference/plainJSGrammarErrors.errors.txt +++ b/tests/baselines/reference/plainJSGrammarErrors.errors.txt @@ -97,8 +97,8 @@ plainJSGrammarErrors.js(197,1): error TS1105: A 'break' statement can only be us plainJSGrammarErrors.js(198,1): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement. plainJSGrammarErrors.js(201,28): error TS17012: 'metal' is not a valid meta-property for keyword 'import'. Did you mean 'meta'? plainJSGrammarErrors.js(202,22): error TS17012: 'targe' is not a valid meta-property for keyword 'new'. Did you mean 'target'? -plainJSGrammarErrors.js(203,30): message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments -plainJSGrammarErrors.js(204,30): message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments +plainJSGrammarErrors.js(203,30): message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments +plainJSGrammarErrors.js(204,30): message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments plainJSGrammarErrors.js(205,36): error TS1325: Argument of dynamic import cannot be spread element. @@ -505,10 +505,10 @@ plainJSGrammarErrors.js(205,36): error TS1325: Argument of dynamic import cannot !!! error TS17012: 'targe' is not a valid meta-property for keyword 'new'. Did you mean 'target'? const nullaryDynamicImport = import() ~~~~~~~~ -!!! message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments +!!! message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments const trinaryDynamicImport = import('1', '2', '3') ~~~~~~~~~~~~~~~~~~~~~ -!!! message TS1450: Dynamic imports can only accept a module specifier and an optional assertion as arguments +!!! message TS1450: Dynamic imports can only accept a module specifier and an optional set of attributes as arguments const spreadDynamicImport = import(...[]) ~~~~~ !!! error TS1325: Argument of dynamic import cannot be spread element. diff --git a/tests/baselines/reference/tscWatch/moduleResolution/module-resolutions-from-files-with-partially-used-import-attributes.js b/tests/baselines/reference/tscWatch/moduleResolution/module-resolutions-from-files-with-partially-used-import-attributes.js new file mode 100644 index 0000000000000..3315ea948b505 --- /dev/null +++ b/tests/baselines/reference/tscWatch/moduleResolution/module-resolutions-from-files-with-partially-used-import-attributes.js @@ -0,0 +1,302 @@ +currentDirectory:: /user/username/projects/myproject useCaseSensitiveFileNames: false +Input:: +//// [/user/username/projects/myproject/tsconfig.json] +{"compilerOptions":{"moduleResolution":"node16"}} + +//// [/user/username/projects/myproject/index.ts] +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +import type { RequireInterface } from "pkg1" with { "resolution-mode": "require" }; +import {x} from "./a"; + + +//// [/user/username/projects/myproject/a.ts] +export const x = 10; + + +//// [/user/username/projects/myproject/node_modules/pkg/package.json] +{"name":"pkg","version":"0.0.1","exports":{"import":"./import.js","require":"./require.js"}} + +//// [/user/username/projects/myproject/node_modules/pkg/import.d.ts] +export interface ImportInterface {} + +//// [/user/username/projects/myproject/node_modules/pkg/require.d.ts] +export interface RequireInterface {} + +//// [/user/username/projects/myproject/node_modules/pkg1/package.json] +{"name":"pkg1","version":"0.0.1","exports":{"import":"./import.js","require":"./require.js"}} + +//// [/user/username/projects/myproject/node_modules/pkg1/import.d.ts] +export interface ImportInterface {} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } + + +/a/lib/tsc.js -w --traceResolution +Output:: +>> Screen clear +[12:00:39 AM] Starting compilation in watch mode... + +File '/user/username/projects/myproject/package.json' does not exist. +File '/user/username/projects/package.json' does not exist. +File '/user/username/package.json' does not exist. +File '/user/package.json' does not exist. +File '/package.json' does not exist. +File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +File '/user/username/package.json' does not exist according to earlier cached lookups. +File '/user/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +======== Resolving module 'pkg' from '/user/username/projects/myproject/index.ts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +File '/user/username/package.json' does not exist according to earlier cached lookups. +File '/user/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'pkg' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg/package.json'. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './import.js'. +File name '/user/username/projects/myproject/node_modules/pkg/import.js' has a '.js' extension - stripping it. +File '/user/username/projects/myproject/node_modules/pkg/import.ts' does not exist. +File '/user/username/projects/myproject/node_modules/pkg/import.tsx' does not exist. +File '/user/username/projects/myproject/node_modules/pkg/import.d.ts' exists - use it as a name resolution result. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/user/username/projects/myproject/node_modules/pkg/import.d.ts', result '/user/username/projects/myproject/node_modules/pkg/import.d.ts'. +======== Module name 'pkg' was successfully resolved to '/user/username/projects/myproject/node_modules/pkg/import.d.ts' with Package ID 'pkg/import.d.ts@0.0.1'. ======== +======== Resolving module 'pkg1' from '/user/username/projects/myproject/index.ts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +File '/user/username/package.json' does not exist according to earlier cached lookups. +File '/user/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'pkg1' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +Found 'package.json' at '/user/username/projects/myproject/node_modules/pkg1/package.json'. +Entering conditional exports. +Saw non-matching condition 'import'. +Matched 'exports' condition 'require'. +Using 'exports' subpath '.' with target './require.js'. +File name '/user/username/projects/myproject/node_modules/pkg1/require.js' has a '.js' extension - stripping it. +File '/user/username/projects/myproject/node_modules/pkg1/require.ts' does not exist. +File '/user/username/projects/myproject/node_modules/pkg1/require.tsx' does not exist. +File '/user/username/projects/myproject/node_modules/pkg1/require.d.ts' does not exist. +Failed to resolve under condition 'require'. +Exiting conditional exports. +Directory '/user/username/projects/myproject/node_modules/@types' does not exist, skipping all lookups in it. +Directory '/user/username/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/user/username/node_modules' does not exist, skipping all lookups in it. +Directory '/user/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +Searching all ancestor node_modules directories for fallback extensions: JavaScript. +File '/user/username/projects/myproject/node_modules/pkg1/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Saw non-matching condition 'import'. +Matched 'exports' condition 'require'. +Using 'exports' subpath '.' with target './require.js'. +File name '/user/username/projects/myproject/node_modules/pkg1/require.js' has a '.js' extension - stripping it. +File '/user/username/projects/myproject/node_modules/pkg1/require.js' does not exist. +File '/user/username/projects/myproject/node_modules/pkg1/require.jsx' does not exist. +Failed to resolve under condition 'require'. +Exiting conditional exports. +Directory '/user/username/projects/node_modules' does not exist, skipping all lookups in it. +Directory '/user/username/node_modules' does not exist, skipping all lookups in it. +Directory '/user/node_modules' does not exist, skipping all lookups in it. +Directory '/node_modules' does not exist, skipping all lookups in it. +======== Module name 'pkg1' was not resolved. ======== +======== Resolving module './a' from '/user/username/projects/myproject/index.ts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in CJS mode with conditions 'require', 'types', 'node'. +Loading module as file / folder, candidate module location '/user/username/projects/myproject/a', target file types: TypeScript, JavaScript, Declaration. +File '/user/username/projects/myproject/a.ts' exists - use it as a name resolution result. +======== Module name './a' was successfully resolved to '/user/username/projects/myproject/a.ts'. ======== +File '/user/username/projects/myproject/node_modules/pkg/package.json' exists according to earlier cached lookups. +File '/a/lib/package.json' does not exist. +File '/a/package.json' does not exist. +File '/package.json' does not exist according to earlier cached lookups. +error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. + +[12:00:44 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/index.ts"] +Program options: {"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/node_modules/pkg/import.d.ts +/user/username/projects/myproject/index.ts + +No cached semantic diagnostics in the builder:: + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/myproject/a.ts (used version) +/user/username/projects/myproject/node_modules/pkg/import.d.ts (used version) +/user/username/projects/myproject/index.ts (used version) + +PolledWatches:: +/user/username/projects/myproject/node_modules/@types: *new* + {"pollingInterval":500} +/user/username/projects/myproject/package.json: *new* + {"pollingInterval":2000} +/user/username/projects/node_modules: *new* + {"pollingInterval":500} +/user/username/projects/node_modules/@types: *new* + {"pollingInterval":500} +/user/username/projects/package.json: *new* + {"pollingInterval":2000} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/user/username/projects: *new* + {} +/user/username/projects/myproject: *new* + {} +/user/username/projects/myproject/a.ts: *new* + {} +/user/username/projects/myproject/index.ts: *new* + {} +/user/username/projects/myproject/node_modules/pkg/import.d.ts: *new* + {} +/user/username/projects/myproject/node_modules/pkg/package.json: *new* + {} +/user/username/projects/myproject/node_modules/pkg1/package.json: *new* + {} +/user/username/projects/myproject/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/user/username/projects/myproject: *new* + {} +/user/username/projects/myproject/node_modules: *new* + {} + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.x = void 0; +exports.x = 10; + + +//// [/user/username/projects/myproject/index.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + + +Change:: modify aFile by adding import + +Input:: +//// [/user/username/projects/myproject/a.ts] +export const x = 10; +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" } + + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[12:00:47 AM] File change detected. Starting incremental compilation... + +File '/a/lib/package.json' does not exist according to earlier cached lookups. +File '/a/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +File '/user/username/package.json' does not exist according to earlier cached lookups. +File '/user/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/myproject/node_modules/pkg/package.json' exists according to earlier cached lookups. +File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +File '/user/username/package.json' does not exist according to earlier cached lookups. +File '/user/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +File '/user/username/package.json' does not exist according to earlier cached lookups. +File '/user/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +======== Resolving module 'pkg' from '/user/username/projects/myproject/a.ts'. ======== +Explicitly specified module resolution kind: 'Node16'. +Resolving in ESM mode with conditions 'import', 'types', 'node'. +File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +File '/user/username/package.json' does not exist according to earlier cached lookups. +File '/user/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Loading module 'pkg' from 'node_modules' folder, target file types: TypeScript, JavaScript, Declaration. +Searching all ancestor node_modules directories for preferred extensions: TypeScript, Declaration. +File '/user/username/projects/myproject/node_modules/pkg/package.json' exists according to earlier cached lookups. +Entering conditional exports. +Matched 'exports' condition 'import'. +Using 'exports' subpath '.' with target './import.js'. +File name '/user/username/projects/myproject/node_modules/pkg/import.js' has a '.js' extension - stripping it. +File '/user/username/projects/myproject/node_modules/pkg/import.ts' does not exist. +File '/user/username/projects/myproject/node_modules/pkg/import.tsx' does not exist. +File '/user/username/projects/myproject/node_modules/pkg/import.d.ts' exists - use it as a name resolution result. +Resolved under condition 'import'. +Exiting conditional exports. +Resolving real path for '/user/username/projects/myproject/node_modules/pkg/import.d.ts', result '/user/username/projects/myproject/node_modules/pkg/import.d.ts'. +======== Module name 'pkg' was successfully resolved to '/user/username/projects/myproject/node_modules/pkg/import.d.ts' with Package ID 'pkg/import.d.ts@0.0.1'. ======== +File '/user/username/projects/myproject/node_modules/pkg/package.json' exists according to earlier cached lookups. +File '/user/username/projects/myproject/package.json' does not exist according to earlier cached lookups. +File '/user/username/projects/package.json' does not exist according to earlier cached lookups. +File '/user/username/package.json' does not exist according to earlier cached lookups. +File '/user/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +Reusing resolution of module 'pkg' from '/user/username/projects/myproject/index.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/node_modules/pkg/import.d.ts' with Package ID 'pkg/import.d.ts@0.0.1'. +Reusing resolution of module './a' from '/user/username/projects/myproject/index.ts' of old program, it was successfully resolved to '/user/username/projects/myproject/a.ts'. +Reusing resolution of module 'pkg1' from '/user/username/projects/myproject/index.ts' of old program, it was not resolved. +File '/a/lib/package.json' does not exist according to earlier cached lookups. +File '/a/package.json' does not exist according to earlier cached lookups. +File '/package.json' does not exist according to earlier cached lookups. +error TS5110: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'. + +[12:00:54 AM] Found 1 error. Watching for file changes. + + + +Program root files: ["/user/username/projects/myproject/a.ts","/user/username/projects/myproject/index.ts"] +Program options: {"moduleResolution":3,"watch":true,"traceResolution":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} +Program structureReused: SafeModules +Program files:: +/a/lib/lib.d.ts +/user/username/projects/myproject/node_modules/pkg/import.d.ts +/user/username/projects/myproject/a.ts +/user/username/projects/myproject/index.ts + +No cached semantic diagnostics in the builder:: + +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/a.ts (computed .d.ts) +/user/username/projects/myproject/index.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +//// [/user/username/projects/myproject/a.js] file written with same contents +//// [/user/username/projects/myproject/index.js] file written with same contents diff --git a/tests/cases/compiler/parseImportAttributesError.ts b/tests/cases/compiler/parseImportAttributesError.ts new file mode 100644 index 0000000000000..df87a0ed1a9be --- /dev/null +++ b/tests/cases/compiler/parseImportAttributesError.ts @@ -0,0 +1,27 @@ +// @noImplicitReferences: true +// @module: nodenext +// @declaration: true +// @outDir: out +// @filename: /node_modules/pkg/package.json +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} + +// @filename: /node_modules/pkg/import.d.ts +export interface ImportInterface {} + +// @filename: /node_modules/pkg/require.d.ts +export interface RequireInterface {} + +// @filename: /index.ts +export type LocalInterface = + & import("pkg", { with: {1234, "resolution-mode": "require"} }).RequireInterface + & import("pkg", { with: {1234, "resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {1234, "resolution-mode": "require"} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {1234, "resolution-mode": "import"} }).ImportInterface); diff --git a/tests/cases/conformance/importAttributes/importAttributes1.ts b/tests/cases/conformance/importAttributes/importAttributes1.ts new file mode 100644 index 0000000000000..20912d73c62d4 --- /dev/null +++ b/tests/cases/conformance/importAttributes/importAttributes1.ts @@ -0,0 +1,34 @@ +// @declaration: true +// @target: es2015 +// @module: es2015, commonjs, esnext + +// @filename: 0.ts +export const a = 1; +export const b = 2; + +// @filename: 1.ts +import './0' with { type: "json" } +import { a, b } from './0' with { "type": "json" } +import * as foo from './0' with { type: "json" } +a; +b; +foo.a; +foo.b; +// @filename: 2.ts +import { a, b } from './0' with {} +import { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } +a; +b; +c; +d; +// @filename: 3.ts +const a = import('./0') +const b = import('./0', { with: { type: "json" } }) +const c = import('./0', { with: { type: "json", ttype: "typo" } }) +const d = import('./0', { with: {} }) +const dd = import('./0', {}) +declare function foo(): any; +const e = import('./0', foo()) +const f = import() +const g = import('./0', {}, {}) +const h = import('./0', { with: { type: "json" }},) diff --git a/tests/cases/conformance/importAttributes/importAttributes2.ts b/tests/cases/conformance/importAttributes/importAttributes2.ts new file mode 100644 index 0000000000000..5852a4eb21f53 --- /dev/null +++ b/tests/cases/conformance/importAttributes/importAttributes2.ts @@ -0,0 +1,17 @@ +// @declaration: true +// @target: es2015 +// @module: es2015, commonjs, esnext + +// @filename: 0.ts +export const a = 1; +export const b = 2; + +// @filename: 1.ts +export {} from './0' with { type: "json" } +export { a, b } from './0' with { type: "json" } +export * from './0' with { type: "json" } +export * as ns from './0' with { type: "json" } + +// @filename: 2.ts +export { a, b } from './0' with {} +export { a as c, b as d } from './0' with { a: "a", b: "b", c: "c" } diff --git a/tests/cases/conformance/importAttributes/importAttributes3.ts b/tests/cases/conformance/importAttributes/importAttributes3.ts new file mode 100644 index 0000000000000..e51f08322930c --- /dev/null +++ b/tests/cases/conformance/importAttributes/importAttributes3.ts @@ -0,0 +1,14 @@ +// @declaration: true +// @target: es2015 +// @module: es2015, esnext + +// @filename: 0.ts +export interface I { } + +// @filename: 1.ts +export type {} from './0' with { type: "json" } +export type { I } from './0' with { type: "json" } + +// @filename: 2.ts +import type { I } from './0' with { type: "json" } +import type * as foo from './0' with { type: "json" } diff --git a/tests/cases/conformance/importAttributes/importAttributes4.ts b/tests/cases/conformance/importAttributes/importAttributes4.ts new file mode 100644 index 0000000000000..e52b6b1167eab --- /dev/null +++ b/tests/cases/conformance/importAttributes/importAttributes4.ts @@ -0,0 +1 @@ +import * as f from "./first" with \ No newline at end of file diff --git a/tests/cases/conformance/importAttributes/importAttributes5.ts b/tests/cases/conformance/importAttributes/importAttributes5.ts new file mode 100644 index 0000000000000..12d141e2a30a3 --- /dev/null +++ b/tests/cases/conformance/importAttributes/importAttributes5.ts @@ -0,0 +1 @@ +import * as f from "./first" with { \ No newline at end of file diff --git a/tests/cases/conformance/importAttributes/importAttributes6.ts b/tests/cases/conformance/importAttributes/importAttributes6.ts new file mode 100644 index 0000000000000..c23f2ef5a27e9 --- /dev/null +++ b/tests/cases/conformance/importAttributes/importAttributes6.ts @@ -0,0 +1,8 @@ +// @module: nodenext +// @filename: mod.mts +import * as thing1 from "./mod.mjs" with { field: 0 }; +import * as thing2 from "./mod.mjs" with { field: `a` }; +import * as thing3 from "./mod.mjs" with { field: /a/g }; +import * as thing4 from "./mod.mjs" with { field: ["a"] }; +import * as thing5 from "./mod.mjs" with { field: { a: 0 } }; +import * as thing6 from "./mod.mjs" with { type: "json", field: 0..toString() }; diff --git a/tests/cases/conformance/importAttributes/importAttributes7.ts b/tests/cases/conformance/importAttributes/importAttributes7.ts new file mode 100644 index 0000000000000..fe5a2950770df --- /dev/null +++ b/tests/cases/conformance/importAttributes/importAttributes7.ts @@ -0,0 +1,19 @@ +// @module: esnext +// @lib: es2015 + +// @filename: /a.ts +export default { + a: "a", + b: "b", + 1: "1", +} + +// @filename: /b.ts +import a from "./a" with { a: "a", "b": "b" }; + +export async function f() { + const a = import("./a", { + with: { a: "a", "b": "b" }, + }); + a; +} diff --git a/tests/cases/conformance/importAttributes/importAttributes8.ts b/tests/cases/conformance/importAttributes/importAttributes8.ts new file mode 100644 index 0000000000000..ae2b2b56a2f91 --- /dev/null +++ b/tests/cases/conformance/importAttributes/importAttributes8.ts @@ -0,0 +1,11 @@ +// @module: esnext +// @lib: es2015 + +// @filename: /a.ts +export default { + a: "a", + b: "b", +} + +// @filename: /b.ts +import a from "./a" with { a: "a", "b": "b" }; // ok diff --git a/tests/cases/conformance/node/nodeModulesImportAttributes.ts b/tests/cases/conformance/node/nodeModulesImportAttributes.ts new file mode 100644 index 0000000000000..9e2a3271c0218 --- /dev/null +++ b/tests/cases/conformance/node/nodeModulesImportAttributes.ts @@ -0,0 +1,13 @@ +// @module: node16,nodenext +// @resolveJsonModule: true +// @filename: index.ts +import json from "./package.json" with { type: "json" }; +// @filename: otherc.cts +import json from "./package.json" with { type: "json" }; // should error, cjs mode imports don't support attributes +const json2 = import("./package.json", { with: { type: "json" } }); // should be fine +// @filename: package.json +{ + "name": "pkg", + "private": true, + "type": "module" +} diff --git a/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts b/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts new file mode 100644 index 0000000000000..181853d1fa02d --- /dev/null +++ b/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit1.ts @@ -0,0 +1,29 @@ +// @noImplicitReferences: true +// @module: node16,nodenext +// @declaration: true +// @outDir: out +// @filename: /node_modules/pkg/package.json +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +// @filename: /node_modules/pkg/import.d.ts +export interface ImportInterface {} +// @filename: /node_modules/pkg/require.d.ts +export interface RequireInterface {} +// @filename: /index.ts +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; diff --git a/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts b/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts new file mode 100644 index 0000000000000..b8cc7f112fda3 --- /dev/null +++ b/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmit2.ts @@ -0,0 +1,34 @@ +// @noImplicitReferences: true +// @module: node16,nodenext +// @declaration: true +// @outDir: out +// @filename: /node_modules/pkg/package.json +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +// @filename: /node_modules/pkg/import.d.ts +export interface ImportInterface {} +// @filename: /node_modules/pkg/require.d.ts +export interface RequireInterface {} +// @filename: /package.json +{ + "private": true, + "type": "module" +} +// @filename: /index.ts +import type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +import type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + +import {type RequireInterface as Req} from "pkg" with { "resolution-mode": "require" }; +import {type ImportInterface as Imp} from "pkg" with { "resolution-mode": "import" }; +export interface Loc extends Req, Imp {} + +export type { RequireInterface } from "pkg" with { "resolution-mode": "require" }; +export type { ImportInterface } from "pkg" with { "resolution-mode": "import" }; diff --git a/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts b/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts new file mode 100644 index 0000000000000..2aee1dfac573a --- /dev/null +++ b/tests/cases/conformance/node/nodeModulesImportAttributesModeDeclarationEmitErrors.ts @@ -0,0 +1,29 @@ +// @noImplicitReferences: true +// @module: node16,nodenext +// @declaration: true +// @outDir: out +// @filename: /node_modules/pkg/package.json +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +// @filename: /node_modules/pkg/import.d.ts +export interface ImportInterface {} +// @filename: /node_modules/pkg/require.d.ts +export interface RequireInterface {} +// @filename: /index.ts +// incorrect mode +import type { RequireInterface } from "pkg" with { "resolution-mode": "foobar" }; +// not type-only +import { ImportInterface } from "pkg" with { "resolution-mode": "import" }; +// not exclusively type-only +import {type RequireInterface as Req, RequireInterface as Req2} from "pkg" with { "resolution-mode": "require" }; + +export interface LocalInterface extends RequireInterface, ImportInterface {} + + + diff --git a/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts b/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts new file mode 100644 index 0000000000000..45bf0f409e569 --- /dev/null +++ b/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmit.ts @@ -0,0 +1,24 @@ +// @noImplicitReferences: true +// @module: node16,nodenext +// @declaration: true +// @outDir: out +// @filename: /node_modules/pkg/package.json +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +// @filename: /node_modules/pkg/import.d.ts +export interface ImportInterface {} +// @filename: /node_modules/pkg/require.d.ts +export interface RequireInterface {} +// @filename: /index.ts +export type LocalInterface = + & import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "require"} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); diff --git a/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts b/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts new file mode 100644 index 0000000000000..e5c7c1420f314 --- /dev/null +++ b/tests/cases/conformance/node/nodeModulesImportAttributesTypeModeDeclarationEmitErrors.ts @@ -0,0 +1,72 @@ +// @module: node16,nodenext +// @declaration: true +// @outDir: out +// @filename: /node_modules/pkg/package.json +{ + "name": "pkg", + "version": "0.0.1", + "exports": { + "import": "./import.js", + "require": "./require.js" + } +} +// @filename: /node_modules/pkg/import.d.ts +export interface ImportInterface {} + +// @filename: /node_modules/pkg/require.d.ts +export interface RequireInterface {} + +// @filename: /index.ts +export type LocalInterface = + & import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface + & import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"resolution-mode": "foobar"} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {"resolution-mode": "import"} }).ImportInterface); + +// @filename: /other.ts +// missing with: +export type LocalInterface = + & import("pkg", {"resolution-mode": "require"}).RequireInterface + & import("pkg", {"resolution-mode": "import"}).ImportInterface; + +export const a = (null as any as import("pkg", {"resolution-mode": "require"}).RequireInterface); +export const b = (null as any as import("pkg", {"resolution-mode": "import"}).ImportInterface); + +// @filename: /other2.ts +// wrong attribute key +export type LocalInterface = + & import("pkg", { with: {"bad": "require"} }).RequireInterface + & import("pkg", { with: {"bad": "import"} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {"bad": "require"} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {"bad": "import"} }).ImportInterface); + +// @filename: /other3.ts +// Array instead of object-y thing +export type LocalInterface = + & import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface + & import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface; + +export const a = (null as any as import("pkg", [ {"resolution-mode": "require"} ]).RequireInterface); +export const b = (null as any as import("pkg", [ {"resolution-mode": "import"} ]).ImportInterface); + +// @filename: /other4.ts +// Indirected attribute objecty-thing - not allowed +type Attribute1 = { with: {"resolution-mode": "require"} }; +type Attribute2 = { with: {"resolution-mode": "import"} }; + +export type LocalInterface = + & import("pkg", Attribute1).RequireInterface + & import("pkg", Attribute2).ImportInterface; + +export const a = (null as any as import("pkg", Attribute1).RequireInterface); +export const b = (null as any as import("pkg", Attribute2).ImportInterface); + +// @filename: /other5.ts +export type LocalInterface = + & import("pkg", { with: {} }).RequireInterface + & import("pkg", { with: {} }).ImportInterface; + +export const a = (null as any as import("pkg", { with: {} }).RequireInterface); +export const b = (null as any as import("pkg", { with: {} }).ImportInterface); \ No newline at end of file diff --git a/tests/cases/fourslash/completionImportAttributes.ts b/tests/cases/fourslash/completionImportAttributes.ts new file mode 100644 index 0000000000000..3a578e66122ba --- /dev/null +++ b/tests/cases/fourslash/completionImportAttributes.ts @@ -0,0 +1,13 @@ +/// + +// @target: esnext +// @module: esnext + +// @filename: main.ts +////import("./other.json", {/*0*/}); +////import("./other.json", { wi/*1*/}); + +// @filename: other.json +////{} + +verify.baselineCompletions(); diff --git a/tests/cases/fourslash/completionsImportWithKeyword.ts b/tests/cases/fourslash/completionsImportWithKeyword.ts new file mode 100644 index 0000000000000..4c4016bf5494e --- /dev/null +++ b/tests/cases/fourslash/completionsImportWithKeyword.ts @@ -0,0 +1,19 @@ +/// + +// @allowJs: true +// @Filename: a.ts +//// const f = { +//// a: 1 +////}; +//// import * as thing from "thing" /*0*/ +//// export { foo } from "foo" /*1*/ +//// import "foo" as /*2*/ +//// import "foo" w/*3*/ +//// import * as that from "that" +//// /*4*/ +//// import * /*5*/ as those from "those" + +// @Filename: b.js +//// import * as thing from "thing" /*js*/; + +verify.baselineCompletions(); diff --git a/tests/cases/fourslash/getOccurrencesNonStringImportAttributes.ts b/tests/cases/fourslash/getOccurrencesNonStringImportAttributes.ts new file mode 100644 index 0000000000000..48611e02ee5f3 --- /dev/null +++ b/tests/cases/fourslash/getOccurrencesNonStringImportAttributes.ts @@ -0,0 +1,7 @@ +/// + +// @module: nodenext +////import * as react from "react" with { cache: /**/0 }; +////react.Children; + +verify.baselineDocumentHighlights(""); diff --git a/tests/cases/fourslash/outliningSpansForImportAndExportAttributes.ts b/tests/cases/fourslash/outliningSpansForImportAndExportAttributes.ts new file mode 100644 index 0000000000000..52a3266b38cb6 --- /dev/null +++ b/tests/cases/fourslash/outliningSpansForImportAndExportAttributes.ts @@ -0,0 +1,48 @@ +/// + +//// import { a1, a2 } from "a"; +//// ; +//// import { +//// } from "a"; +//// ; +//// import [|{ +//// b1, +//// b2, +//// }|] from "b"; +//// ; +//// import j1 from "./j" with { type: "json" }; +//// ; +//// import j2 from "./j" with { +//// }; +//// ; +//// import j3 from "./j" with [|{ +//// type: "json" +//// }|]; +//// ; +//// [|import { a5, a6 } from "a"; +//// import [|{ +//// a7, +//// a8, +//// }|] from "a";|] +//// export { a1, a2 }; +//// ; +//// export { a3, a4 } from "a"; +//// ; +//// export { +//// }; +//// ; +//// export [|{ +//// b1, +//// b2, +//// }|]; +//// ; +//// export { +//// } from "b"; +//// ; +//// export [|{ +//// b3, +//// b4, +//// }|] from "b"; +//// ; + +verify.outliningSpansInCurrentFile(test.ranges());