diff --git a/.mailmap b/.mailmap index 79e90f32785..5b591eb4615 100644 --- a/.mailmap +++ b/.mailmap @@ -358,3 +358,4 @@ Vyacheslav Pukhanov dangoo # Daniel Gooss krk # Kerem Kat micnic # Nicu Micleușanu +rflorian # @rflorian diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1d11db2f87b..81ffe06e8e2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,7 +61,7 @@ Design changes will not be accepted at this time. If you have a design change pr You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright. -Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to . Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request. +Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement ([Microsoft Contribution License Agreement.pdf](https://opensource.microsoft.com/pdf/microsoft-contribution-license-agreement.pdf)), sign, scan, and email it back to . Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request. ## Housekeeping diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 4ab044d52ba..927b31403e0 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -2072,7 +2072,10 @@ namespace ts { if (isSpecialPropertyDeclaration(node as PropertyAccessExpression)) { bindSpecialPropertyDeclaration(node as PropertyAccessExpression); } - if (isInJavaScriptFile(node) && isModuleExportsPropertyAccessExpression(node as PropertyAccessExpression)) { + if (isInJavaScriptFile(node) && + file.commonJsModuleIndicator && + isModuleExportsPropertyAccessExpression(node as PropertyAccessExpression) && + !lookupSymbolForNameWorker(container, "module" as __String)) { declareSymbol(container.locals!, /*parent*/ undefined, (node as PropertyAccessExpression).expression as Identifier, SymbolFlags.FunctionScopedVariable | SymbolFlags.ModuleExports, SymbolFlags.FunctionScopedVariableExcludes); } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 441de3a4253..dbd0b9f531e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -198,13 +198,10 @@ namespace ts { }, isContextSensitive, getFullyQualifiedName, - getResolvedSignature: (nodeIn, candidatesOutArray, theArgumentCount) => { - const node = getParseTreeNode(nodeIn, isCallLikeExpression); - apparentArgumentCount = theArgumentCount; - const res = node ? getResolvedSignature(node, candidatesOutArray) : undefined; - apparentArgumentCount = undefined; - return res; - }, + getResolvedSignature: (node, candidatesOutArray, agumentCount) => + getResolvedSignatureWorker(node, candidatesOutArray, agumentCount, /*isForSignatureHelp*/ false), + getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, agumentCount) => + getResolvedSignatureWorker(node, candidatesOutArray, agumentCount, /*isForSignatureHelp*/ true), getConstantValue: nodeIn => { const node = getParseTreeNode(nodeIn, canHaveConstantValue); return node ? getConstantValue(node) : undefined; @@ -354,6 +351,14 @@ namespace ts { } }; + function getResolvedSignatureWorker(nodeIn: CallLikeExpression, candidatesOutArray: Signature[] | undefined, argumentCount: number | undefined, isForSignatureHelp: boolean): Signature | undefined { + const node = getParseTreeNode(nodeIn, isCallLikeExpression); + apparentArgumentCount = argumentCount; + const res = node ? getResolvedSignature(node, candidatesOutArray, isForSignatureHelp) : undefined; + apparentArgumentCount = undefined; + return res; + } + const tupleTypes = createMap(); const unionTypes = createMap(); const intersectionTypes = createMap(); @@ -1834,7 +1839,7 @@ namespace ts { if (symbol.flags & SymbolFlags.Variable) { const typeAnnotation = (symbol.valueDeclaration).type; if (typeAnnotation) { - return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name)); // TODO: GH#18217 + return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name)); } } } @@ -3883,14 +3888,15 @@ namespace ts { const links = getSymbolLinks(symbol); let specifier = links.specifierCache && links.specifierCache.get(contextFile.path); if (!specifier) { - specifier = flatten(moduleSpecifiers.getModuleSpecifiers( + specifier = moduleSpecifiers.getModuleSpecifierForDeclarationFile( symbol, compilerOptions, contextFile, context.tracker.moduleResolverHost, context.tracker.moduleResolverHost.getSourceFiles!(), // TODO: GH#18217 - { importModuleSpecifierPreference: "non-relative" } - ))[0]; + { importModuleSpecifierPreference: "non-relative" }, + host.redirectTargetsMap, + ); links.specifierCache = links.specifierCache || createMap(); links.specifierCache.set(contextFile.path, specifier); } @@ -4988,86 +4994,87 @@ namespace ts { function getTypeOfVariableOrParameterOrProperty(symbol: Symbol): Type { const links = getSymbolLinks(symbol); - if (!links.type) { - // Handle prototype property - if (symbol.flags & SymbolFlags.Prototype) { - return links.type = getTypeOfPrototypeProperty(symbol); - } - // CommonsJS require and module both have type any. - if (symbol === requireSymbol) { - return links.type = anyType; - } - if (symbol.flags & SymbolFlags.ModuleExports) { - const fileSymbol = getSymbolOfNode(getSourceFileOfNode(symbol.valueDeclaration)); - const members = createSymbolTable(); - members.set("exports" as __String, fileSymbol); - return links.type = createAnonymousType(symbol, members, emptyArray, emptyArray, undefined, undefined); - } - // Handle catch clause variables - const declaration = symbol.valueDeclaration; - if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) { - return links.type = anyType; - } - // Handle export default expressions - if (isSourceFile(declaration)) { - const jsonSourceFile = cast(declaration, isJsonSourceFile); - return links.type = jsonSourceFile.statements.length ? checkExpression(jsonSourceFile.statements[0].expression) : emptyObjectType; - } - if (declaration.kind === SyntaxKind.ExportAssignment) { - return links.type = checkExpression((declaration).expression); - } - // Handle variable, parameter or property - if (!pushTypeResolution(symbol, TypeSystemPropertyName.Type)) { - return errorType; - } - - let type = getJSSpecialType(symbol, declaration); - if (!type) { - if (isJSDocPropertyLikeTag(declaration) - || isPropertyAccessExpression(declaration) - || isIdentifier(declaration) - || isClassDeclaration(declaration) - || isFunctionDeclaration(declaration) - || (isMethodDeclaration(declaration) && !isObjectLiteralMethod(declaration)) - || isMethodSignature(declaration)) { - // Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty` - if (symbol.flags & (SymbolFlags.Function | SymbolFlags.Method | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)) { - return getTypeOfFuncClassEnumModule(symbol); - } - type = tryGetTypeFromEffectiveTypeNode(declaration) || anyType; - } - else if (isPropertyAssignment(declaration)) { - type = tryGetTypeFromEffectiveTypeNode(declaration) || checkPropertyAssignment(declaration); - } - else if (isJsxAttribute(declaration)) { - type = tryGetTypeFromEffectiveTypeNode(declaration) || checkJsxAttribute(declaration); - } - else if (isShorthandPropertyAssignment(declaration)) { - type = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation(declaration.name, CheckMode.Normal); - } - else if (isObjectLiteralMethod(declaration)) { - type = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod(declaration, CheckMode.Normal); - } - else if (isParameter(declaration) - || isPropertyDeclaration(declaration) - || isPropertySignature(declaration) - || isVariableDeclaration(declaration) - || isBindingElement(declaration)) { - type = getWidenedTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true); - } - else { - return Debug.fail("Unhandled declaration kind! " + Debug.showSyntaxKind(declaration) + " for " + Debug.showSymbol(symbol)); - } - } - - if (!popTypeResolution()) { - type = reportCircularityError(symbol); - } - links.type = type; - } - return links.type; + return links.type || (links.type = getTypeOfVariableOrParameterOrPropertyWorker(symbol)); } + function getTypeOfVariableOrParameterOrPropertyWorker(symbol: Symbol) { + // Handle prototype property + if (symbol.flags & SymbolFlags.Prototype) { + return getTypeOfPrototypeProperty(symbol); + } + // CommonsJS require and module both have type any. + if (symbol === requireSymbol) { + return anyType; + } + if (symbol.flags & SymbolFlags.ModuleExports) { + const fileSymbol = getSymbolOfNode(getSourceFileOfNode(symbol.valueDeclaration)); + const members = createSymbolTable(); + members.set("exports" as __String, fileSymbol); + return createAnonymousType(symbol, members, emptyArray, emptyArray, undefined, undefined); + } + // Handle catch clause variables + const declaration = symbol.valueDeclaration; + if (isCatchClauseVariableDeclarationOrBindingElement(declaration)) { + return anyType; + } + // Handle export default expressions + if (isSourceFile(declaration)) { + const jsonSourceFile = cast(declaration, isJsonSourceFile); + return jsonSourceFile.statements.length ? checkExpression(jsonSourceFile.statements[0].expression) : emptyObjectType; + } + if (declaration.kind === SyntaxKind.ExportAssignment) { + return checkExpression((declaration).expression); + } + + // Handle variable, parameter or property + if (!pushTypeResolution(symbol, TypeSystemPropertyName.Type)) { + return errorType; + } + let type = getJSSpecialType(symbol, declaration); + if (!type) { + if (isJSDocPropertyLikeTag(declaration) + || isPropertyAccessExpression(declaration) + || isIdentifier(declaration) + || isClassDeclaration(declaration) + || isFunctionDeclaration(declaration) + || (isMethodDeclaration(declaration) && !isObjectLiteralMethod(declaration)) + || isMethodSignature(declaration)) { + // Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty` + if (symbol.flags & (SymbolFlags.Function | SymbolFlags.Method | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)) { + return getTypeOfFuncClassEnumModule(symbol); + } + type = tryGetTypeFromEffectiveTypeNode(declaration) || anyType; + } + else if (isPropertyAssignment(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkPropertyAssignment(declaration); + } + else if (isJsxAttribute(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkJsxAttribute(declaration); + } + else if (isShorthandPropertyAssignment(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation(declaration.name, CheckMode.Normal); + } + else if (isObjectLiteralMethod(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod(declaration, CheckMode.Normal); + } + else if (isParameter(declaration) + || isPropertyDeclaration(declaration) + || isPropertySignature(declaration) + || isVariableDeclaration(declaration) + || isBindingElement(declaration)) { + type = getWidenedTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true); + } + else { + return Debug.fail("Unhandled declaration kind! " + Debug.showSyntaxKind(declaration) + " for " + Debug.showSymbol(symbol)); + } + } + + if (!popTypeResolution()) { + type = reportCircularityError(symbol); + } + return type; + } + function getJSSpecialType(symbol: Symbol, decl: Declaration): Type | undefined { if (!isInJavaScriptFile(decl)) { return undefined; @@ -5118,20 +5125,25 @@ namespace ts { } } - function getAnnotatedAccessorType(accessor: AccessorDeclaration | undefined): Type | undefined { + function getAnnotatedAccessorTypeNode(accessor: AccessorDeclaration | undefined): TypeNode | undefined { if (accessor) { if (accessor.kind === SyntaxKind.GetAccessor) { const getterTypeAnnotation = getEffectiveReturnTypeNode(accessor); - return getterTypeAnnotation && getTypeFromTypeNode(getterTypeAnnotation); + return getterTypeAnnotation; } else { const setterTypeAnnotation = getEffectiveSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); + return setterTypeAnnotation; } } return undefined; } + function getAnnotatedAccessorType(accessor: AccessorDeclaration | undefined): Type | undefined { + const node = getAnnotatedAccessorTypeNode(accessor); + return node && getTypeFromTypeNode(node); + } + function getAnnotatedAccessorThisParameter(accessor: AccessorDeclaration): Symbol | undefined { const parameter = getAccessorThisParameter(accessor); return parameter && parameter.symbol; @@ -5143,64 +5155,65 @@ namespace ts { function getTypeOfAccessors(symbol: Symbol): Type { const links = getSymbolLinks(symbol); - if (!links.type) { - const getter = getDeclarationOfKind(symbol, SyntaxKind.GetAccessor); - const setter = getDeclarationOfKind(symbol, SyntaxKind.SetAccessor); + return links.type || (links.type = getTypeOfAccessorsWorker(symbol)); + } - if (getter && isInJavaScriptFile(getter)) { - const jsDocType = getTypeForDeclarationFromJSDocComment(getter); - if (jsDocType) { - return links.type = jsDocType; - } + function getTypeOfAccessorsWorker(symbol: Symbol): Type { + const getter = getDeclarationOfKind(symbol, SyntaxKind.GetAccessor); + const setter = getDeclarationOfKind(symbol, SyntaxKind.SetAccessor); + + if (getter && isInJavaScriptFile(getter)) { + const jsDocType = getTypeForDeclarationFromJSDocComment(getter); + if (jsDocType) { + return jsDocType; } + } - if (!pushTypeResolution(symbol, TypeSystemPropertyName.Type)) { - return errorType; - } + if (!pushTypeResolution(symbol, TypeSystemPropertyName.Type)) { + return errorType; + } - let type: Type; + let type: Type; - // First try to see if the user specified a return type on the get-accessor. - const getterReturnType = getAnnotatedAccessorType(getter); - if (getterReturnType) { - type = getterReturnType; + // First try to see if the user specified a return type on the get-accessor. + const getterReturnType = getAnnotatedAccessorType(getter); + if (getterReturnType) { + type = getterReturnType; + } + else { + // If the user didn't specify a return type, try to use the set-accessor's parameter type. + const setterParameterType = getAnnotatedAccessorType(setter); + if (setterParameterType) { + type = setterParameterType; } else { - // If the user didn't specify a return type, try to use the set-accessor's parameter type. - const setterParameterType = getAnnotatedAccessorType(setter); - if (setterParameterType) { - type = setterParameterType; + // If there are no specified types, try to infer it from the body of the get accessor if it exists. + if (getter && getter.body) { + type = getReturnTypeFromBody(getter); } + // Otherwise, fall back to 'any'. else { - // If there are no specified types, try to infer it from the body of the get accessor if it exists. - if (getter && getter.body) { - type = getReturnTypeFromBody(getter); - } - // Otherwise, fall back to 'any'. - else { - if (noImplicitAny) { - if (setter) { - error(setter, Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol)); - } - else { - Debug.assert(!!getter, "there must existed getter as we are current checking either setter or getter in this function"); - error(getter, Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation, symbolToString(symbol)); - } + if (noImplicitAny) { + if (setter) { + error(setter, Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol)); + } + else { + Debug.assert(!!getter, "there must existed getter as we are current checking either setter or getter in this function"); + error(getter, Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation, symbolToString(symbol)); } - type = anyType; } + type = anyType; } } - if (!popTypeResolution()) { - type = anyType; - if (noImplicitAny) { - const getter = getDeclarationOfKind(symbol, SyntaxKind.GetAccessor); - error(getter, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); - } - } - links.type = type; } - return links.type; + if (!popTypeResolution()) { + type = anyType; + if (noImplicitAny) { + const getter = getDeclarationOfKind(symbol, SyntaxKind.GetAccessor); + error(getter, Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); + } + } + return type; } function getBaseTypeVariableOfClass(symbol: Symbol) { @@ -5210,6 +5223,7 @@ namespace ts { function getTypeOfFuncClassEnumModule(symbol: Symbol): Type { let links = getSymbolLinks(symbol); + const originalLinks = links; if (!links.type) { const jsDeclaration = getDeclarationOfJSInitializer(symbol.valueDeclaration); if (jsDeclaration) { @@ -5228,48 +5242,47 @@ namespace ts { } } } - if (symbol.flags & SymbolFlags.Module && isShorthandAmbientModuleSymbol(symbol)) { - links.type = anyType; - } - else if (symbol.valueDeclaration.kind === SyntaxKind.BinaryExpression || - symbol.valueDeclaration.kind === SyntaxKind.PropertyAccessExpression && symbol.valueDeclaration.parent.kind === SyntaxKind.BinaryExpression) { - links.type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol); - } - else { - if (symbol.flags & SymbolFlags.ValueModule && symbol.valueDeclaration && isSourceFile(symbol.valueDeclaration) && symbol.valueDeclaration.commonJsModuleIndicator) { - if (!pushTypeResolution(symbol, TypeSystemPropertyName.Type)) { - return errorType; - } - const resolvedModule = resolveExternalModuleSymbol(symbol); - if (resolvedModule !== symbol) { - const exportEquals = getMergedSymbol(symbol.exports!.get(InternalSymbolName.ExportEquals)!); - links.type = getWidenedTypeFromJSSpecialPropertyDeclarations(exportEquals, exportEquals === resolvedModule ? undefined : resolvedModule); - } - if (!popTypeResolution()) { - links.type = reportCircularityError(symbol); - } - } - if (!links.type) { - const type = createObjectType(ObjectFlags.Anonymous, symbol); - if (symbol.flags & SymbolFlags.Class) { - const baseTypeVariable = getBaseTypeVariableOfClass(symbol); - links.type = baseTypeVariable ? getIntersectionType([type, baseTypeVariable]) : type; - } - else { - links.type = strictNullChecks && symbol.flags & SymbolFlags.Optional ? getOptionalType(type) : type; - } - } - } + originalLinks.type = links.type = getTypeOfFuncClassEnumModuleWorker(symbol); } return links.type; } + function getTypeOfFuncClassEnumModuleWorker(symbol: Symbol): Type { + const declaration = symbol.valueDeclaration; + if (symbol.flags & SymbolFlags.Module && isShorthandAmbientModuleSymbol(symbol)) { + return anyType; + } + else if (declaration.kind === SyntaxKind.BinaryExpression || + declaration.kind === SyntaxKind.PropertyAccessExpression && declaration.parent.kind === SyntaxKind.BinaryExpression) { + return getWidenedTypeFromJSSpecialPropertyDeclarations(symbol); + } + else if (symbol.flags & SymbolFlags.ValueModule && declaration && isSourceFile(declaration) && declaration.commonJsModuleIndicator) { + const resolvedModule = resolveExternalModuleSymbol(symbol); + if (resolvedModule !== symbol) { + if (!pushTypeResolution(symbol, TypeSystemPropertyName.Type)) { + return errorType; + } + const exportEquals = getMergedSymbol(symbol.exports!.get(InternalSymbolName.ExportEquals)!); + const type = getWidenedTypeFromJSSpecialPropertyDeclarations(exportEquals, exportEquals === resolvedModule ? undefined : resolvedModule); + if (!popTypeResolution()) { + return reportCircularityError(symbol); + } + return type; + } + } + const type = createObjectType(ObjectFlags.Anonymous, symbol); + if (symbol.flags & SymbolFlags.Class) { + const baseTypeVariable = getBaseTypeVariableOfClass(symbol); + return baseTypeVariable ? getIntersectionType([type, baseTypeVariable]) : type; + } + else { + return strictNullChecks && symbol.flags & SymbolFlags.Optional ? getOptionalType(type) : type; + } + } + function getTypeOfEnumMember(symbol: Symbol): Type { const links = getSymbolLinks(symbol); - if (!links.type) { - links.type = getDeclaredTypeOfEnumMember(symbol); - } - return links.type; + return links.type || (links.type = getDeclaredTypeOfEnumMember(symbol)); } function getTypeOfAlias(symbol: Symbol): Type { @@ -5298,7 +5311,7 @@ namespace ts { } else { if (!pushTypeResolution(symbol, TypeSystemPropertyName.Type)) { - return errorType; + return links.type = errorType; } symbolInstantiationDepth++; let type = instantiateType(getTypeOfSymbol(links.target!), links.mapper!); @@ -6853,11 +6866,7 @@ namespace ts { return obj.properties.some(property => { const name = property.name && getTextOfPropertyName(property.name); const expected = name === undefined ? undefined : getTypeOfPropertyOfType(contextualType, name); - if (expected && typeIsLiteralType(expected)) { - const actual = getTypeOfNode(property); - return !!actual && !isTypeIdenticalTo(actual, expected); - } - return false; + return !!expected && typeIsLiteralType(expected) && !isTypeIdenticalTo(getTypeOfNode(property), expected); }); } @@ -8128,6 +8137,10 @@ namespace ts { // TODO: GH#18217 (should the `|| assignedType` be at a lower precedence?) return (referenceType && assignedType ? getIntersectionType([assignedType, referenceType]) : referenceType || assignedType)!; } + const enumTag = getJSDocEnumTag(symbol.valueDeclaration); + if (enumTag && enumTag.typeExpression) { + return getTypeFromTypeNode(enumTag.typeExpression); + } } function getTypeReferenceTypeWorker(node: NodeWithTypeArguments, symbol: Symbol, typeArguments: Type[] | undefined): Type | undefined { @@ -8185,7 +8198,7 @@ namespace ts { } function isJSDocTypeReference(node: Node): node is TypeReferenceNode { - return !!(node.flags & NodeFlags.JSDoc) && node.kind === SyntaxKind.TypeReference; + return !!(node.flags & NodeFlags.JSDoc) && (node.kind === SyntaxKind.TypeReference || node.kind === SyntaxKind.ImportType); } function checkNoTypeArguments(node: NodeWithTypeArguments, symbol?: Symbol) { @@ -8432,6 +8445,10 @@ namespace ts { return createTypeFromGenericGlobalType(globalArrayType, [elementType]); } + function createReadonlyArrayType(elementType: Type): ObjectType { + return createTypeFromGenericGlobalType(globalReadonlyArrayType, [elementType]); + } + function getTypeFromArrayTypeNode(node: ArrayTypeNode): Type { const links = getNodeLinks(node); if (!links.resolvedType) { @@ -9454,7 +9471,7 @@ namespace ts { links.resolvedSymbol = unknownSymbol; return links.resolvedType = errorType; } - const targetMeaning = node.isTypeOf ? SymbolFlags.Value : SymbolFlags.Type; + const targetMeaning = node.isTypeOf ? SymbolFlags.Value : node.flags & NodeFlags.JSDoc ? SymbolFlags.Value | SymbolFlags.Type : SymbolFlags.Type; // TODO: Future work: support unions/generics/whatever via a deferred import-type const innerModuleSymbol = resolveExternalModuleName(node, node.argument.literal); if (!innerModuleSymbol) { @@ -9821,7 +9838,7 @@ namespace ts { case SyntaxKind.Identifier: case SyntaxKind.QualifiedName: const symbol = getSymbolAtLocation(node); - return (symbol && getDeclaredTypeOfSymbol(symbol))!; // TODO: GH#18217 + return symbol ? getDeclaredTypeOfSymbol(symbol) : errorType; default: return errorType; } @@ -10087,11 +10104,16 @@ namespace ts { } function instantiateMappedType(type: MappedType, mapper: TypeMapper): Type { - // Check if we have a homomorphic mapped type, i.e. a type of the form { [P in keyof T]: X } for some - // type variable T. If so, the mapped type is distributive over a union type and when T is instantiated - // to a union type A | B, we produce { [P in keyof A]: X } | { [P in keyof B]: X }. Furthermore, for - // homomorphic mapped types we leave primitive types alone. For example, when T is instantiated to a - // union type A | undefined, we produce { [P in keyof A]: X } | undefined. + // For a momomorphic mapped type { [P in keyof T]: X }, where T is some type variable, the mapping + // operation depends on T as follows: + // * If T is a primitive type no mapping is performed and the result is simply T. + // * If T is a union type we distribute the mapped type over the union. + // * If T is an array we map to an array where the element type has been transformed. + // * If T is a tuple we map to a tuple where the element types have been transformed. + // * Otherwise we map to an object type where the type of each property has been transformed. + // For example, when T is instantiated to a union type A | B, we produce { [P in keyof A]: X } | + // { [P in keyof B]: X }, and when when T is instantiated to a union type A | undefined, we produce + // { [P in keyof A]: X } | undefined. const constraintType = getConstraintTypeFromMappedType(type); if (constraintType.flags & TypeFlags.Index) { const typeVariable = (constraintType).type; @@ -10100,7 +10122,11 @@ namespace ts { if (typeVariable !== mappedTypeVariable) { return mapType(mappedTypeVariable, t => { if (isMappableType(t)) { - return instantiateAnonymousType(type, createReplacementMapper(typeVariable, t, mapper)); + const replacementMapper = createReplacementMapper(typeVariable, t, mapper); + return isArrayType(t) ? createArrayType(instantiateMappedTypeTemplate(type, numberType, /*isOptional*/ true, replacementMapper)) : + isReadonlyArrayType(t) ? createReadonlyArrayType(instantiateMappedTypeTemplate(type, numberType, /*isOptional*/ true, replacementMapper)) : + isTupleType(t) ? instantiateMappedTupleType(t, type, replacementMapper) : + instantiateAnonymousType(type, replacementMapper); } return t; }); @@ -10114,6 +10140,26 @@ namespace ts { return type.flags & (TypeFlags.AnyOrUnknown | TypeFlags.InstantiableNonPrimitive | TypeFlags.Object | TypeFlags.Intersection); } + function instantiateMappedTupleType(tupleType: TupleTypeReference, mappedType: MappedType, mapper: TypeMapper) { + const minLength = tupleType.target.minLength; + const elementTypes = map(tupleType.typeArguments || emptyArray, (_, i) => + instantiateMappedTypeTemplate(mappedType, getLiteralType("" + i), i >= minLength, mapper)); + const modifiers = getMappedTypeModifiers(mappedType); + const newMinLength = modifiers & MappedTypeModifiers.IncludeOptional ? 0 : + modifiers & MappedTypeModifiers.ExcludeOptional ? getTypeReferenceArity(tupleType) - (tupleType.target.hasRestElement ? 1 : 0) : + minLength; + return createTupleType(elementTypes, newMinLength, tupleType.target.hasRestElement, tupleType.target.associatedNames); + } + + function instantiateMappedTypeTemplate(type: MappedType, key: Type, isOptional: boolean, mapper: TypeMapper) { + const templateMapper = combineTypeMappers(mapper, createTypeMapper([getTypeParameterFromMappedType(type)], [key])); + const propType = instantiateType(getTemplateTypeFromMappedType(type.target || type), templateMapper); + const modifiers = getMappedTypeModifiers(type); + return strictNullChecks && modifiers & MappedTypeModifiers.IncludeOptional && !isTypeAssignableTo(undefinedType, propType) ? getOptionalType(propType) : + strictNullChecks && modifiers & MappedTypeModifiers.ExcludeOptional && isOptional ? getTypeWithFacts(propType, TypeFacts.NEUndefined) : + propType; + } + function instantiateAnonymousType(type: AnonymousType, mapper: TypeMapper): AnonymousType { const result = createObjectType(type.objectFlags | ObjectFlags.Instantiated, type.symbol); if (type.objectFlags & ObjectFlags.Mapped) { @@ -12441,6 +12487,10 @@ namespace ts { return !!(getObjectFlags(type) & ObjectFlags.Reference) && (type).target === globalArrayType; } + function isReadonlyArrayType(type: Type): boolean { + return !!(getObjectFlags(type) & ObjectFlags.Reference) && (type).target === globalReadonlyArrayType; + } + function isArrayLikeType(type: Type): boolean { // A type is array-like if it is a reference to the global Array or global ReadonlyArray type, // or if it is not the undefined or null type and if it is assignable to ReadonlyArray @@ -12996,6 +13046,22 @@ namespace ts { return undefined; } } + // For arrays and tuples we infer new arrays and tuples where the reverse mapping has been + // applied to the element type(s). + if (isArrayType(source)) { + return createArrayType(inferReverseMappedType((source).typeArguments![0], target)); + } + if (isReadonlyArrayType(source)) { + return createReadonlyArrayType(inferReverseMappedType((source).typeArguments![0], target)); + } + if (isTupleType(source)) { + const elementTypes = map(source.typeArguments || emptyArray, t => inferReverseMappedType(t, target)); + const minLength = getMappedTypeModifiers(target) & MappedTypeModifiers.IncludeOptional ? + getTypeReferenceArity(source) - (source.target.hasRestElement ? 1 : 0) : source.target.minLength; + return createTupleType(elementTypes, minLength, source.target.hasRestElement, source.target.associatedNames); + } + // For all other object types we infer a new object type where the reverse mapping has been + // applied to the type of each property. const reversed = createObjectType(ObjectFlags.ReverseMapped | ObjectFlags.Anonymous, /*symbol*/ undefined) as ReverseMappedType; reversed.source = source; reversed.mappedType = target; @@ -15340,8 +15406,8 @@ namespace ts { (!isInParameterInitializerBeforeContainingFunction(node) || getThisParameter(container))) { // Note: a parameter initializer should refer to class-this unless function-this is explicitly annotated. - // If this is a function in a JS file, it might be a class method. Check if it's the RHS - // of a x.prototype.y = function [name]() { .... } + // If this is a function in a JS file, it might be a class method. + // Check if it's the RHS of a x.prototype.y = function [name]() { .... } if (container.kind === SyntaxKind.FunctionExpression && container.parent.kind === SyntaxKind.BinaryExpression && getSpecialPropertyAssignmentKind(container.parent as BinaryExpression) === SpecialPropertyAssignmentKind.PrototypeProperty) { @@ -15355,6 +15421,17 @@ namespace ts { return getFlowTypeOfReference(node, getInferredClassType(classSymbol)); } } + // Check if it's a constructor definition, can be either a variable decl or function decl + // i.e. + // * /** @constructor */ function [name]() { ... } + // * /** @constructor */ var x = function() { ... } + else if ((container.kind === SyntaxKind.FunctionExpression || container.kind === SyntaxKind.FunctionDeclaration) && + getJSDocClassTag(container)) { + const classType = getJavaScriptClassType(container.symbol); + if (classType) { + return getFlowTypeOfReference(node, classType); + } + } const thisType = getThisTypeOfDeclaration(container) || getContextualThisParameterType(container); if (thisType) { @@ -16563,7 +16640,8 @@ namespace ts { const contextualTypeHasPattern = contextualType && contextualType.pattern && (contextualType.pattern.kind === SyntaxKind.ObjectBindingPattern || contextualType.pattern.kind === SyntaxKind.ObjectLiteralExpression); const isInJSFile = isInJavaScriptFile(node) && !isInJsonFile(node); - const isJSObjectLiteral = !contextualType && isInJSFile; + const enumTag = getJSDocEnumTag(node); + const isJSObjectLiteral = !contextualType && isInJSFile && !enumTag; let typeFlags: TypeFlags = 0; let patternWithComputedProperties = false; let hasComputedStringProperty = false; @@ -16588,6 +16666,9 @@ namespace ts { checkTypeAssignableTo(type, jsDocType, memberDecl); type = jsDocType; } + else if (enumTag && enumTag.typeExpression) { + checkTypeAssignableTo(type, getTypeFromTypeNode(enumTag.typeExpression), memberDecl); + } } typeFlags |= type.flags; const nameType = computedNameType && computedNameType.flags & TypeFlags.StringOrNumberLiteralOrUnique ? @@ -16622,6 +16703,7 @@ namespace ts { symbolToString(member), typeToString(contextualType!)); } } + prop.declarations = member.declarations; prop.parent = member.parent; if (member.valueDeclaration) { @@ -17132,7 +17214,7 @@ namespace ts { const jsxStatelessElementType = getJsxStatelessElementTypeAt(openingLikeElement); if (jsxStatelessElementType) { // We don't call getResolvedSignature here because we have already resolve the type of JSX Element. - const callSignature = getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, /*candidatesOutArray*/ undefined); + const callSignature = getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, /*candidatesOutArray*/ undefined, /*isForSignatureHelp*/ false); if (callSignature !== unknownSignature) { const callReturnType = callSignature && getReturnTypeOfSignature(callSignature); let paramType = callReturnType && (callSignature!.parameters.length === 0 ? emptyObjectType : getTypeOfSymbol(callSignature!.parameters[0])); @@ -17169,7 +17251,7 @@ namespace ts { if (jsxStatelessElementType) { // We don't call getResolvedSignature because here we have already resolve the type of JSX Element. const candidatesOutArray: Signature[] = []; - getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray); + getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, candidatesOutArray, /*isForSignatureHelp*/ false); let result: Type | undefined; let allMatchingAttributesType: Type | undefined; for (const candidate of candidatesOutArray) { @@ -19032,7 +19114,7 @@ namespace ts { return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length); } - function resolveCall(node: CallLikeExpression, signatures: ReadonlyArray, candidatesOutArray: Signature[] | undefined, fallbackError?: DiagnosticMessage): Signature { + function resolveCall(node: CallLikeExpression, signatures: ReadonlyArray, candidatesOutArray: Signature[] | undefined, isForSignatureHelp: boolean, fallbackError?: DiagnosticMessage): Signature { const isTaggedTemplate = node.kind === SyntaxKind.TaggedTemplateExpression; const isDecorator = node.kind === SyntaxKind.Decorator; const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node); @@ -19118,7 +19200,7 @@ namespace ts { // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. const signatureHelpTrailingComma = - candidatesOutArray && node.kind === SyntaxKind.CallExpression && node.arguments.hasTrailingComma; + isForSignatureHelp && node.kind === SyntaxKind.CallExpression && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument @@ -19329,7 +19411,7 @@ namespace ts { } const typeArgumentNodes: ReadonlyArray = callLikeExpressionMayHaveTypeArguments(node) ? node.typeArguments || emptyArray : emptyArray; - const typeArguments = typeArgumentNodes.map(n => getTypeOfNode(n) || anyType); + const typeArguments = typeArgumentNodes.map(getTypeOfNode); while (typeArguments.length > typeParameters.length) { typeArguments.pop(); } @@ -19360,7 +19442,7 @@ namespace ts { return maxParamsIndex; } - function resolveCallExpression(node: CallExpression, candidatesOutArray: Signature[] | undefined): Signature { + function resolveCallExpression(node: CallExpression, candidatesOutArray: Signature[] | undefined, isForSignatureHelp: boolean): Signature { if (node.expression.kind === SyntaxKind.SuperKeyword) { const superType = checkSuperExpression(node.expression); if (isTypeAny(superType)) { @@ -19375,7 +19457,7 @@ namespace ts { const baseTypeNode = getEffectiveBaseTypeNode(getContainingClass(node)!); if (baseTypeNode) { const baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode); - return resolveCall(node, baseConstructors, candidatesOutArray); + return resolveCall(node, baseConstructors, candidatesOutArray, isForSignatureHelp); } } return resolveUntypedCall(node); @@ -19428,7 +19510,12 @@ namespace ts { } return resolveErrorCall(node); } - return resolveCall(node, callSignatures, candidatesOutArray); + // If the function is explicitly marked with `@class`, then it must be constructed. + if (callSignatures.some(sig => isInJavaScriptFile(sig.declaration) && !!getJSDocClassTag(sig.declaration!))) { + error(node, Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); + return resolveErrorCall(node); + } + return resolveCall(node, callSignatures, candidatesOutArray, isForSignatureHelp); } /** @@ -19442,7 +19529,7 @@ namespace ts { !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & (TypeFlags.Union | TypeFlags.Never)) && isTypeAssignableTo(funcType, globalFunctionType); } - function resolveNewExpression(node: NewExpression, candidatesOutArray: Signature[] | undefined): Signature { + function resolveNewExpression(node: NewExpression, candidatesOutArray: Signature[] | undefined, isForSignatureHelp: boolean): Signature { if (node.arguments && languageVersion < ScriptTarget.ES5) { const spreadIndex = getSpreadArgumentIndex(node.arguments); if (spreadIndex >= 0) { @@ -19495,7 +19582,7 @@ namespace ts { return resolveErrorCall(node); } - return resolveCall(node, constructSignatures, candidatesOutArray); + return resolveCall(node, constructSignatures, candidatesOutArray, isForSignatureHelp); } // If expressionType's apparent type is an object type with no construct signatures but @@ -19504,7 +19591,7 @@ namespace ts { // operation is Any. It is an error to have a Void this type. const callSignatures = getSignaturesOfType(expressionType, SignatureKind.Call); if (callSignatures.length) { - const signature = resolveCall(node, callSignatures, candidatesOutArray); + const signature = resolveCall(node, callSignatures, candidatesOutArray, isForSignatureHelp); if (!isJavaScriptConstructor(signature.declaration) && getReturnTypeOfSignature(signature) !== voidType) { error(node, Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword); } @@ -19611,7 +19698,7 @@ namespace ts { } } - function resolveTaggedTemplateExpression(node: TaggedTemplateExpression, candidatesOutArray: Signature[] | undefined): Signature { + function resolveTaggedTemplateExpression(node: TaggedTemplateExpression, candidatesOutArray: Signature[] | undefined, isForSignatureHelp: boolean): Signature { const tagType = checkExpression(node.tag); const apparentType = getApparentType(tagType); @@ -19632,7 +19719,7 @@ namespace ts { return resolveErrorCall(node); } - return resolveCall(node, callSignatures, candidatesOutArray); + return resolveCall(node, callSignatures, candidatesOutArray, isForSignatureHelp); } /** @@ -19663,7 +19750,7 @@ namespace ts { /** * Resolves a decorator as if it were a call expression. */ - function resolveDecorator(node: Decorator, candidatesOutArray: Signature[] | undefined): Signature { + function resolveDecorator(node: Decorator, candidatesOutArray: Signature[] | undefined, isForSignatureHelp: boolean): Signature { const funcType = checkExpression(node.expression); const apparentType = getApparentType(funcType); if (apparentType === errorType) { @@ -19692,7 +19779,7 @@ namespace ts { return resolveErrorCall(node); } - return resolveCall(node, callSignatures, candidatesOutArray, headMessage); + return resolveCall(node, callSignatures, candidatesOutArray, isForSignatureHelp, headMessage); } /** @@ -19717,32 +19804,32 @@ namespace ts { * @param candidatesOutArray an array of signature to be filled in by the function. It is passed by signature help in the language service; * the function will fill it up with appropriate candidate signatures */ - function getResolvedJsxStatelessFunctionSignature(openingLikeElement: JsxOpeningLikeElement, elementType: Type, candidatesOutArray: Signature[] | undefined): Signature | undefined { + function getResolvedJsxStatelessFunctionSignature(openingLikeElement: JsxOpeningLikeElement, elementType: Type, candidatesOutArray: Signature[] | undefined, isForSignatureHelp: boolean): Signature | undefined { Debug.assert(!(elementType.flags & TypeFlags.Union)); const callSignatures = elementType && getSignaturesOfType(elementType, SignatureKind.Call); if (callSignatures && callSignatures.length > 0) { - return resolveCall(openingLikeElement, callSignatures, candidatesOutArray); + return resolveCall(openingLikeElement, callSignatures, candidatesOutArray, isForSignatureHelp); } return undefined; } - function resolveSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature { + function resolveSignature(node: CallLikeExpression, candidatesOutArray: Signature[] | undefined, isForSignatureHelp: boolean): Signature { switch (node.kind) { case SyntaxKind.CallExpression: - return resolveCallExpression(node, candidatesOutArray); + return resolveCallExpression(node, candidatesOutArray, isForSignatureHelp); case SyntaxKind.NewExpression: - return resolveNewExpression(node, candidatesOutArray); + return resolveNewExpression(node, candidatesOutArray, isForSignatureHelp); case SyntaxKind.TaggedTemplateExpression: - return resolveTaggedTemplateExpression(node, candidatesOutArray); + return resolveTaggedTemplateExpression(node, candidatesOutArray, isForSignatureHelp); case SyntaxKind.Decorator: - return resolveDecorator(node, candidatesOutArray); + return resolveDecorator(node, candidatesOutArray, isForSignatureHelp); case SyntaxKind.JsxOpeningElement: case SyntaxKind.JsxSelfClosingElement: // This code-path is called by language service const exprTypes = checkExpression(node.tagName); return forEachType(exprTypes, exprType => { - const sfcResult = getResolvedJsxStatelessFunctionSignature(node, exprType, candidatesOutArray); + const sfcResult = getResolvedJsxStatelessFunctionSignature(node, exprType, candidatesOutArray, isForSignatureHelp); if (sfcResult && sfcResult !== unknownSignature) { return sfcResult; } @@ -19763,7 +19850,7 @@ namespace ts { * the function will fill it up with appropriate candidate signatures * @return a signature of the call-like expression or undefined if one can't be found */ - function getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature { + function getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[] | undefined, isForSignatureHelp = false): Signature { const links = getNodeLinks(node); // If getResolvedSignature has already been called, we will have cached the resolvedSignature. // However, it is possible that either candidatesOutArray was not passed in the first time, @@ -19774,7 +19861,7 @@ namespace ts { return cached; } links.resolvedSignature = resolvingSignature; - const result = resolveSignature(node, candidatesOutArray); + const result = resolveSignature(node, candidatesOutArray, isForSignatureHelp); // If signature resolution originated in control flow type analysis (for example to compute the // assigned type in a flow assignment) we don't cache the result as it may be based on temporary // types from the control flow analysis. @@ -22613,6 +22700,7 @@ namespace ts { grammarErrorOnNode(node, Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); } checkSourceElement(node.typeParameter); + registerForUnusedIdentifiersCheck(node); } function checkImportType(node: ImportTypeNode) { @@ -23433,9 +23521,13 @@ namespace ts { } break; - case SyntaxKind.MethodDeclaration: case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: + const otherKind = node.kind === SyntaxKind.GetAccessor ? SyntaxKind.SetAccessor : SyntaxKind.GetAccessor; + const otherAccessor = getDeclarationOfKind(getSymbolOfNode(node as AccessorDeclaration), otherKind); + markDecoratorMedataDataTypeNodeAsReferenced(getAnnotatedAccessorTypeNode(node as AccessorDeclaration) || otherAccessor && getAnnotatedAccessorTypeNode(otherAccessor)); + break; + case SyntaxKind.MethodDeclaration: for (const parameter of (node).parameters) { markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } @@ -23641,7 +23733,8 @@ namespace ts { type PotentiallyUnusedIdentifier = | SourceFile | ModuleDeclaration | ClassLikeDeclaration | InterfaceDeclaration | Block | CaseBlock | ForStatement | ForInStatement | ForOfStatement - | Exclude | TypeAliasDeclaration; + | Exclude | TypeAliasDeclaration + | InferTypeNode; function checkUnusedIdentifiers(potentiallyUnusedIdentifiers: ReadonlyArray, addDiagnostic: AddUnusedDiagnostic) { for (const node of potentiallyUnusedIdentifiers) { @@ -23681,6 +23774,7 @@ namespace ts { case SyntaxKind.FunctionType: case SyntaxKind.ConstructorType: case SyntaxKind.TypeAliasDeclaration: + case SyntaxKind.InferType: checkUnusedTypeParameters(node, addDiagnostic); break; default: @@ -23734,21 +23828,48 @@ namespace ts { } } - function checkUnusedTypeParameters( - node: ClassDeclaration | ClassExpression | FunctionDeclaration | MethodDeclaration | FunctionExpression | ArrowFunction | ConstructorDeclaration | SignatureDeclaration | InterfaceDeclaration | TypeAliasDeclaration, - addDiagnostic: AddUnusedDiagnostic, - ): void { + function checkUnusedTypeParameters(node: ClassLikeDeclaration | SignatureDeclaration | InterfaceDeclaration | TypeAliasDeclaration | InferTypeNode, addDiagnostic: AddUnusedDiagnostic): void { // Only report errors on the last declaration for the type parameter container; // this ensures that all uses have been accounted for. - const typeParameters = getEffectiveTypeParameterDeclarations(node); - if (!(node.flags & NodeFlags.Ambient) && last(getSymbolOfNode(node).declarations) === node) { + if (node.flags & NodeFlags.Ambient || node.kind !== SyntaxKind.InferType && last(getSymbolOfNode(node).declarations) !== node) return; + + if (node.kind === SyntaxKind.InferType) { + const { typeParameter } = node; + if (isTypeParameterUnused(typeParameter)) { + addDiagnostic(node, UnusedKind.Parameter, createDiagnosticForNode(node, Diagnostics._0_is_declared_but_its_value_is_never_read, idText(typeParameter.name))); + } + } + else { + const typeParameters = getEffectiveTypeParameterDeclarations(node); + const seenParentsWithEveryUnused = new NodeSet(); + for (const typeParameter of typeParameters) { - if (!(getMergedSymbol(typeParameter.symbol).isReferenced! & SymbolFlags.TypeParameter) && !isIdentifierThatStartsWithUnderscore(typeParameter.name)) { - addDiagnostic(typeParameter, UnusedKind.Parameter, createDiagnosticForNode(typeParameter.name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolName(typeParameter.symbol))); + if (!isTypeParameterUnused(typeParameter)) continue; + + const name = idText(typeParameter.name); + const { parent } = typeParameter; + if (parent.kind !== SyntaxKind.InferType && parent.typeParameters!.every(isTypeParameterUnused)) { + if (seenParentsWithEveryUnused.tryAdd(parent)) { + const range = isJSDocTemplateTag(parent) + // Whole @template tag + ? rangeOfNode(parent) + // Include the `<>` in the error message + : rangeOfTypeParameters(parent.typeParameters!); + const only = typeParameters.length === 1; + const message = only ? Diagnostics._0_is_declared_but_its_value_is_never_read : Diagnostics.All_type_parameters_are_unused; + const arg0 = only ? name : undefined; + addDiagnostic(typeParameter, UnusedKind.Parameter, createFileDiagnostic(getSourceFileOfNode(parent), range.pos, range.end - range.pos, message, arg0)); + } + } + else { + addDiagnostic(typeParameter, UnusedKind.Parameter, createDiagnosticForNode(typeParameter, Diagnostics._0_is_declared_but_its_value_is_never_read, name)); } } } } + function isTypeParameterUnused(typeParameter: TypeParameterDeclaration): boolean { + return !(getMergedSymbol(typeParameter.symbol).isReferenced! & SymbolFlags.TypeParameter) && !isIdentifierThatStartsWithUnderscore(typeParameter.name); + } function addToGroup(map: Map<[K, V[]]>, key: K, value: V, getKey: (key: K) => number | string): void { const keyString = String(getKey(key)); @@ -27143,7 +27264,7 @@ namespace ts { grandParent.kind === SyntaxKind.ObjectBindingPattern && node === (parent).propertyName) { const typeOfPattern = getTypeOfNode(grandParent); - const propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, (node).escapedText); + const propertyDeclaration = getPropertyOfType(typeOfPattern, (node).escapedText); if (propertyDeclaration) { return propertyDeclaration; @@ -27243,7 +27364,7 @@ namespace ts { if (isPartOfTypeNode(node)) { let typeFromTypeNode = getTypeFromTypeNode(node); - if (typeFromTypeNode && isExpressionWithTypeArgumentsInClassImplementsClause(node)) { + if (isExpressionWithTypeArgumentsInClassImplementsClause(node)) { const containingClass = getContainingClass(node)!; const classType = getTypeOfNode(containingClass) as InterfaceType; typeFromTypeNode = getTypeWithThisArgument(typeFromTypeNode, classType.thisType); @@ -27261,8 +27382,8 @@ namespace ts { // extends clause of a class. We handle that case here. const classNode = getContainingClass(node)!; const classType = getDeclaredTypeOfSymbol(getSymbolOfNode(classNode)) as InterfaceType; - const baseType = getBaseTypes(classType)[0]; - return baseType && getTypeWithThisArgument(baseType, classType.thisType); + const baseType = firstOrUndefined(getBaseTypes(classType)); + return baseType ? getTypeWithThisArgument(baseType, classType.thisType) : errorType; } if (isTypeDeclaration(node)) { @@ -27959,8 +28080,8 @@ namespace ts { const otherAccessor = getDeclarationOfKind(getSymbolOfNode(accessor), otherKind); const firstAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? otherAccessor : accessor; const secondAccessor = otherAccessor && (otherAccessor.pos < accessor.pos) ? accessor : otherAccessor; - const setAccessor = accessor.kind === SyntaxKind.SetAccessor ? accessor : otherAccessor; - const getAccessor = accessor.kind === SyntaxKind.GetAccessor ? accessor : otherAccessor; + const setAccessor = accessor.kind === SyntaxKind.SetAccessor ? accessor : otherAccessor as SetAccessorDeclaration; + const getAccessor = accessor.kind === SyntaxKind.GetAccessor ? accessor : otherAccessor as GetAccessorDeclaration; return { firstAccessor, secondAccessor, @@ -29184,10 +29305,6 @@ namespace ts { } checkGrammarForDisallowedTrailingComma(elements, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma); - if (node.name.kind === SyntaxKind.ArrayBindingPattern || node.name.kind === SyntaxKind.ObjectBindingPattern) { - return grammarErrorOnNode(node.name, Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); - } - if (node.propertyName) { return grammarErrorOnNode(node.name, Diagnostics.A_rest_element_cannot_have_a_property_name); } diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 5ddc706aa22..1eaab5b1b59 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -2093,7 +2093,7 @@ namespace ts { return arg => f(arg) || g(arg); } - export function assertTypeIsNever(_: never): void { } // tslint:disable-line no-empty + export function assertType(_: T): void { } // tslint:disable-line no-empty export function singleElementArray(t: T | undefined): T[] | undefined { return t === undefined ? undefined : [t]; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index fc35d00103c..91dfdf705e6 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3655,6 +3655,10 @@ "category": "Message", "code": 6204 }, + "All type parameters are unused": { + "category": "Error", + "code": 6205 + }, "Projects to reference": { "category": "Message", @@ -4208,6 +4212,14 @@ "category": "Message", "code": 90010 }, + "Remove template tag": { + "category": "Message", + "code": 90011 + }, + "Remove type parameters": { + "category": "Message", + "code": 90012 + }, "Import '{0}' from module \"{1}\"": { "category": "Message", "code": 90013 @@ -4276,6 +4288,22 @@ "category": "Message", "code": 90029 }, + "Replace 'infer {0}' with 'unknown'": { + "category": "Message", + "code": 90030 + }, + "Replace all unused 'infer' with 'unknown'": { + "category": "Message", + "code": 90031 + }, + "Import default '{0}' from module \"{1}\"": { + "category": "Message", + "code": 90032 + }, + "Add default import '{0}' to existing import declaration from \"{1}\"": { + "category": "Message", + "code": 90033 + }, "Convert function to an ES2015 class": { "category": "Message", "code": 95001 diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 86911417cb6..226da57dbbe 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -1058,7 +1058,7 @@ namespace ts { : node; } - export function createTaggedTemplate(tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; + /** @deprecated */ export function createTaggedTemplate(tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; export function createTaggedTemplate(tag: Expression, typeArguments: ReadonlyArray | undefined, template: TemplateLiteral): TaggedTemplateExpression; /** @internal */ export function createTaggedTemplate(tag: Expression, typeArgumentsOrTemplate: ReadonlyArray | TemplateLiteral | undefined, template?: TemplateLiteral): TaggedTemplateExpression; @@ -1076,7 +1076,7 @@ namespace ts { return node; } - export function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; + /** @deprecated */ export function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; export function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, typeArguments: ReadonlyArray | undefined, template: TemplateLiteral): TaggedTemplateExpression; export function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, typeArgumentsOrTemplate: ReadonlyArray | TemplateLiteral | undefined, template?: TemplateLiteral) { return node.tag !== tag @@ -1168,14 +1168,6 @@ namespace ts { node.body = parenthesizeConciseBody(body); return node; } - - /** @deprecated */ export function updateArrowFunction( - node: ArrowFunction, - modifiers: ReadonlyArray | undefined, - typeParameters: ReadonlyArray | undefined, - parameters: ReadonlyArray, - type: TypeNode | undefined, - body: ConciseBody): ArrowFunction; export function updateArrowFunction( node: ArrowFunction, modifiers: ReadonlyArray | undefined, @@ -1183,28 +1175,8 @@ namespace ts { parameters: ReadonlyArray, type: TypeNode | undefined, equalsGreaterThanToken: Token, - body: ConciseBody): ArrowFunction; - export function updateArrowFunction( - node: ArrowFunction, - modifiers: ReadonlyArray | undefined, - typeParameters: ReadonlyArray | undefined, - parameters: ReadonlyArray, - type: TypeNode | undefined, - equalsGreaterThanTokenOrBody: Token | ConciseBody, - bodyOrUndefined?: ConciseBody, + body: ConciseBody ): ArrowFunction { - let equalsGreaterThanToken: Token; - let body: ConciseBody; - if (bodyOrUndefined === undefined) { - equalsGreaterThanToken = node.equalsGreaterThanToken; - body = cast(equalsGreaterThanTokenOrBody, isConciseBody); - } - else { - equalsGreaterThanToken = cast(equalsGreaterThanTokenOrBody, (n): n is Token => - n.kind === SyntaxKind.EqualsGreaterThanToken); - body = bodyOrUndefined; - } - return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters @@ -1306,7 +1278,7 @@ namespace ts { : node; } - export function createConditional(condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; + /** @deprecated */ export function createConditional(condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; export function createConditional(condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression; export function createConditional(condition: Expression, questionTokenOrWhenTrue: QuestionToken | Expression, whenTrueOrWhenFalse: Expression, colonToken?: ColonToken, whenFalse?: Expression) { const node = createSynthesizedNode(SyntaxKind.ConditionalExpression); @@ -1317,26 +1289,14 @@ namespace ts { node.whenFalse = parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenFalse : whenTrueOrWhenFalse); return node; } - - /** @deprecated */ export function updateConditional( - node: ConditionalExpression, - condition: Expression, - whenTrue: Expression, - whenFalse: Expression): ConditionalExpression; export function updateConditional( node: ConditionalExpression, condition: Expression, questionToken: Token, whenTrue: Expression, colonToken: Token, - whenFalse: Expression): ConditionalExpression; - export function updateConditional(node: ConditionalExpression, condition: Expression, ...args: any[]) { - if (args.length === 2) { - const [whenTrue, whenFalse] = args; - return updateConditional(node, condition, node.questionToken, whenTrue, node.colonToken, whenFalse); - } - Debug.assert(args.length === 4); - const [questionToken, whenTrue, colonToken, whenFalse] = args; + whenFalse: Expression + ): ConditionalExpression { return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue @@ -2231,7 +2191,7 @@ namespace ts { export function createJsxSelfClosingElement(tagName: JsxTagNameExpression, typeArguments: ReadonlyArray | undefined, attributes: JsxAttributes) { const node = createSynthesizedNode(SyntaxKind.JsxSelfClosingElement); node.tagName = tagName; - node.typeArguments = typeArguments && createNodeArray(typeArguments); + node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; return node; } @@ -2247,7 +2207,7 @@ namespace ts { export function createJsxOpeningElement(tagName: JsxTagNameExpression, typeArguments: ReadonlyArray | undefined, attributes: JsxAttributes) { const node = createSynthesizedNode(SyntaxKind.JsxOpeningElement); node.tagName = tagName; - node.typeArguments = typeArguments && createNodeArray(typeArguments); + node.typeArguments = asNodeArray(typeArguments); node.attributes = attributes; return node; } @@ -4024,6 +3984,11 @@ namespace ts { const binaryOperatorPrecedence = getOperatorPrecedence(SyntaxKind.BinaryExpression, binaryOperator); const binaryOperatorAssociativity = getOperatorAssociativity(SyntaxKind.BinaryExpression, binaryOperator); const emittedOperand = skipPartiallyEmittedExpressions(operand); + if (!isLeftSideOfBinary && operand.kind === SyntaxKind.ArrowFunction && binaryOperatorPrecedence > 4) { + // We need to parenthesize arrow functions on the right side to avoid it being + // parsed as parenthesized expression: `a && (() => {})` + return true; + } const operandPrecedence = getExpressionPrecedence(emittedOperand); switch (compareValues(operandPrecedence, binaryOperatorPrecedence)) { case Comparison.LessThan: diff --git a/src/compiler/moduleSpecifiers.ts b/src/compiler/moduleSpecifiers.ts index b243ff34814..a82f5b854e1 100644 --- a/src/compiler/moduleSpecifiers.ts +++ b/src/compiler/moduleSpecifiers.ts @@ -1,4 +1,4 @@ -// Used by importFixes to synthesize import module specifiers. +// Used by importFixes, getEditsForFileRename, and declaration emit to synthesize import module specifiers. /* @internal */ namespace ts.moduleSpecifiers { export interface ModuleSpecifierPreferences { @@ -14,13 +14,26 @@ namespace ts.moduleSpecifiers { host: ModuleSpecifierResolutionHost, files: ReadonlyArray, preferences: ModuleSpecifierPreferences = {}, + redirectTargetsMap: RedirectTargetsMap, ): string { const info = getInfo(compilerOptions, importingSourceFile, importingSourceFileName, host); - const modulePaths = getAllModulePaths(files, toFileName, info.getCanonicalFileName, host); + const modulePaths = getAllModulePaths(files, importingSourceFileName, toFileName, info.getCanonicalFileName, host, redirectTargetsMap); return firstDefined(modulePaths, moduleFileName => getGlobalModuleSpecifier(moduleFileName, info, host, compilerOptions)) || first(getLocalModuleSpecifiers(toFileName, info, compilerOptions, preferences)); } + export function getModuleSpecifierForDeclarationFile( + moduleSymbol: Symbol, + compilerOptions: CompilerOptions, + importingSourceFile: SourceFile, + host: ModuleSpecifierResolutionHost, + files: ReadonlyArray, + preferences: ModuleSpecifierPreferences, + redirectTargetsMap: RedirectTargetsMap, + ): string { + return first(first(getModuleSpecifiers(moduleSymbol, compilerOptions, importingSourceFile, host, files, preferences, redirectTargetsMap))); + } + // For each symlink/original for a module, returns a list of ways to import that file. export function getModuleSpecifiers( moduleSymbol: Symbol, @@ -29,6 +42,7 @@ namespace ts.moduleSpecifiers { host: ModuleSpecifierResolutionHost, files: ReadonlyArray, preferences: ModuleSpecifierPreferences, + redirectTargetsMap: RedirectTargetsMap, ): ReadonlyArray> { const ambient = tryGetModuleNameFromAmbientModule(moduleSymbol); if (ambient) return [[ambient]]; @@ -37,7 +51,8 @@ namespace ts.moduleSpecifiers { if (!files) { return Debug.fail("Files list must be present to resolve symlinks in specifier resolution"); } - const modulePaths = getAllModulePaths(files, getSourceFileOfNode(moduleSymbol.valueDeclaration).fileName, info.getCanonicalFileName, host); + const moduleSourceFile = getSourceFileOfNode(moduleSymbol.valueDeclaration); + const modulePaths = getAllModulePaths(files, importingSourceFile.path, moduleSourceFile.fileName, info.getCanonicalFileName, host, redirectTargetsMap); const global = mapDefined(modulePaths, moduleFileName => getGlobalModuleSpecifier(moduleFileName, info, host, compilerOptions)); return global.length ? global.map(g => [g]) : modulePaths.map(moduleFileName => @@ -142,64 +157,69 @@ namespace ts.moduleSpecifiers { return firstDefined(imports, ({ text }) => pathIsRelative(text) ? fileExtensionIs(text, Extension.Js) : undefined) || false; } - function discoverProbableSymlinks(files: ReadonlyArray, getCanonicalFileName: (file: string) => string, host: ModuleSpecifierResolutionHost) { + function stringsEqual(a: string, b: string, getCanonicalFileName: GetCanonicalFileName): boolean { + return getCanonicalFileName(a) === getCanonicalFileName(b); + } + + // KLUDGE: Don't assume one 'node_modules' links to another. More likely a single directory inside the node_modules is the symlink. + // ALso, don't assume that an `@foo` directory is linked. More likely the contents of that are linked. + function isNodeModulesOrScopedPackageDirectory(s: string, getCanonicalFileName: GetCanonicalFileName): boolean { + return getCanonicalFileName(s) === "node_modules" || startsWith(s, "@"); + } + + function guessDirectorySymlink(a: string, b: string, cwd: string, getCanonicalFileName: GetCanonicalFileName): [string, string] { + const aParts = getPathComponents(toPath(a, cwd, getCanonicalFileName)); + const bParts = getPathComponents(toPath(b, cwd, getCanonicalFileName)); + while (!isNodeModulesOrScopedPackageDirectory(aParts[aParts.length - 2], getCanonicalFileName) && + !isNodeModulesOrScopedPackageDirectory(bParts[bParts.length - 2], getCanonicalFileName) && + stringsEqual(aParts[aParts.length - 1], bParts[bParts.length - 1], getCanonicalFileName)) { + aParts.pop(); + bParts.pop(); + } + return [getPathFromPathComponents(aParts), getPathFromPathComponents(bParts)]; + } + + function discoverProbableSymlinks(files: ReadonlyArray, getCanonicalFileName: GetCanonicalFileName, cwd: string): ReadonlyMap { + const result = createMap(); const symlinks = mapDefined(files, sf => sf.resolvedModules && firstDefinedIterator(sf.resolvedModules.values(), res => res && res.originalPath && res.resolvedFileName !== res.originalPath ? [res.resolvedFileName, res.originalPath] : undefined)); - const result = createMap(); - if (symlinks) { - const currentDirectory = host.getCurrentDirectory ? host.getCurrentDirectory() : ""; - const compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? compareStringsCaseSensitive : compareStringsCaseInsensitive; - for (const [resolvedPath, originalPath] of symlinks) { - const resolvedParts = getPathComponents(toPath(resolvedPath, currentDirectory, getCanonicalFileName)); - const originalParts = getPathComponents(toPath(originalPath, currentDirectory, getCanonicalFileName)); - while (compareStrings(resolvedParts[resolvedParts.length - 1], originalParts[originalParts.length - 1]) === Comparison.EqualTo) { - resolvedParts.pop(); - originalParts.pop(); - } - result.set(getPathFromPathComponents(originalParts), getPathFromPathComponents(resolvedParts)); - } + for (const [resolvedPath, originalPath] of symlinks) { + const [commonResolved, commonOriginal] = guessDirectorySymlink(resolvedPath, originalPath, cwd, getCanonicalFileName); + result.set(commonOriginal, commonResolved); } return result; } - function getAllModulePathsUsingIndirectSymlinks(files: ReadonlyArray, target: string, getCanonicalFileName: (file: string) => string, host: ModuleSpecifierResolutionHost) { - const links = discoverProbableSymlinks(files, getCanonicalFileName, host); - const paths = arrayFrom(links.keys()); - let options: string[] | undefined; - const compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? compareStringsCaseSensitive : compareStringsCaseInsensitive; - for (const path of paths) { - const resolved = links.get(path)!; - if (compareStrings(target.slice(0, resolved.length + 1), resolved + "/") === Comparison.EqualTo) { - const relative = getRelativePathFromDirectory(resolved, target, getCanonicalFileName); - const option = resolvePath(path, relative); - if (!host.fileExists || host.fileExists(option)) { - if (!options) options = []; - options.push(option); - } - } - } - if (options) { - options.push(target); // Since these are speculative, we also include the original resolved name as a possibility - return options; - } - return [target]; - } - /** * Looks for existing imports that use symlinks to this module. - * Only if no symlink is available, the real path will be used. + * Symlinks will be returned first so they are preferred over the real path. */ - function getAllModulePaths(files: ReadonlyArray, importedFileName: string, getCanonicalFileName: (file: string) => string, host: ModuleSpecifierResolutionHost): ReadonlyArray { - const symlinks = mapDefined(files, sf => - sf.resolvedModules && firstDefinedIterator(sf.resolvedModules.values(), res => - res && res.resolvedFileName === importedFileName ? res.originalPath : undefined)); + function getAllModulePaths(files: ReadonlyArray, importingFileName: string, importedFileName: string, getCanonicalFileName: GetCanonicalFileName, host: ModuleSpecifierResolutionHost, redirectTargetsMap: RedirectTargetsMap): ReadonlyArray { + const redirects = redirectTargetsMap.get(importedFileName); + const importedFileNames = redirects ? [...redirects, importedFileName] : [importedFileName]; const cwd = host.getCurrentDirectory ? host.getCurrentDirectory() : ""; - const baseOptions = getAllModulePathsUsingIndirectSymlinks(files, getNormalizedAbsolutePath(importedFileName, cwd), getCanonicalFileName, host); - if (symlinks.length === 0) { - return baseOptions; - } - return deduplicate(concatenate(baseOptions, flatMap(symlinks, importedFileName => getAllModulePathsUsingIndirectSymlinks(files, getNormalizedAbsolutePath(importedFileName, cwd), getCanonicalFileName, host)))); + const targets = importedFileNames.map(f => getNormalizedAbsolutePath(f, cwd)); + const links = discoverProbableSymlinks(files, getCanonicalFileName, cwd); + + const result: string[] = []; + const compareStrings = (!host.useCaseSensitiveFileNames || host.useCaseSensitiveFileNames()) ? compareStringsCaseSensitive : compareStringsCaseInsensitive; + links.forEach((resolved, path) => { + if (startsWithDirectory(importingFileName, resolved, getCanonicalFileName)) { + return; // Don't want to a package to globally import from itself + } + + const target = targets.find(t => compareStrings(t.slice(0, resolved.length + 1), resolved + "/") === Comparison.EqualTo); + if (target === undefined) return; + + const relative = getRelativePathFromDirectory(resolved, target, getCanonicalFileName); + const option = resolvePath(path, relative); + if (!host.fileExists || host.fileExists(option)) { + result.push(option); + } + }); + result.push(...targets); + return result; } function getRelativePathNParents(relativePath: string): number { diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 4fd7f77978a..570d50f8485 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -491,6 +491,8 @@ namespace ts { visitNode(cbNode, (node as JSDocCallbackTag).typeExpression); case SyntaxKind.JSDocThisTag: return visitNode(cbNode, (node as JSDocThisTag).typeExpression); + case SyntaxKind.JSDocEnumTag: + return visitNode(cbNode, (node as JSDocEnumTag).typeExpression); case SyntaxKind.JSDocSignature: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || @@ -6398,7 +6400,7 @@ namespace ts { switch (token()) { case SyntaxKind.AtToken: if (state === JSDocState.BeginningOfLine || state === JSDocState.SawAsterisk) { - removeTrailingNewlines(comments); + removeTrailingWhitespace(comments); addTag(parseTag(indent)); // NOTE: According to usejsdoc.org, a tag goes to end of line, except the last tag. // Real-world comments may break this rule, so "BeginningOfLine" will not be a real line beginning @@ -6458,7 +6460,7 @@ namespace ts { nextJSDocToken(); } removeLeadingNewlines(comments); - removeTrailingNewlines(comments); + removeTrailingWhitespace(comments); return createJSDocComment(); }); @@ -6468,8 +6470,8 @@ namespace ts { } } - function removeTrailingNewlines(comments: string[]) { - while (comments.length && (comments[comments.length - 1] === "\n" || comments[comments.length - 1] === "\r")) { + function removeTrailingWhitespace(comments: string[]) { + while (comments.length && comments[comments.length - 1].trim() === "") { comments.pop(); } } @@ -6527,6 +6529,9 @@ namespace ts { case "this": tag = parseThisTag(atToken, tagName); break; + case "enum": + tag = parseEnumTag(atToken, tagName); + break; case "arg": case "argument": case "param": @@ -6627,7 +6632,7 @@ namespace ts { } removeLeadingNewlines(comments); - removeTrailingNewlines(comments); + removeTrailingWhitespace(comments); return comments.length === 0 ? undefined : comments.join(""); } @@ -6817,6 +6822,15 @@ namespace ts { return finishNode(tag); } + function parseEnumTag(atToken: AtToken, tagName: Identifier): JSDocEnumTag { + const tag = createNode(SyntaxKind.JSDocEnumTag, atToken.pos); + tag.atToken = atToken; + tag.tagName = tagName; + tag.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); + skipWhitespace(); + return finishNode(tag); + } + function parseTypedefTag(atToken: AtToken, tagName: Identifier, indent: number): JSDocTypedefTag { const typeExpression = tryParseTypeExpression(); skipWhitespace(); @@ -7030,8 +7044,8 @@ namespace ts { skipWhitespace(); const typeParameter = createNode(SyntaxKind.TypeParameter); typeParameter.name = parseJSDocIdentifierName(Diagnostics.Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces); - skipWhitespace(); finishNode(typeParameter); + skipWhitespace(); typeParameters.push(typeParameter); } while (parseOptionalJsdoc(SyntaxKind.CommaToken)); diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 59ac93f467e..c70477b4a17 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -634,7 +634,8 @@ namespace ts { const packageIdToSourceFile = createMap(); // Maps from a SourceFile's `.path` to the name of the package it was imported with. let sourceFileToPackageName = createMap(); - let redirectTargetsSet = createMap(); + // Key is a file name. Value is the (non-empty, or undefined) list of files that redirect to it. + let redirectTargetsMap = createMultiMap(); const filesByName = createMap(); let missingFilePaths: ReadonlyArray | undefined; @@ -752,7 +753,7 @@ namespace ts { getSourceFileFromReference, getLibFileFromReference, sourceFileToPackageName, - redirectTargetsSet, + redirectTargetsMap, isEmittedFile, getConfigFileParsingDiagnostics, getResolvedModuleWithFailedLookupLocationsFromCache, @@ -1073,7 +1074,7 @@ namespace ts { fileChanged = false; newSourceFile = oldSourceFile; // Use the redirect. } - else if (oldProgram.redirectTargetsSet.has(oldSourceFile.path)) { + else if (oldProgram.redirectTargetsMap.has(oldSourceFile.path)) { // If a redirected-to source file changes, the redirect may be broken. if (newSourceFile !== oldSourceFile) { return oldProgram.structureIsReused = StructureIsReused.Not; @@ -1220,7 +1221,7 @@ namespace ts { resolvedProjectReferences = oldProgram.getProjectReferences(); sourceFileToPackageName = oldProgram.sourceFileToPackageName; - redirectTargetsSet = oldProgram.redirectTargetsSet; + redirectTargetsMap = oldProgram.redirectTargetsMap; return oldProgram.structureIsReused = StructureIsReused.Completely; } @@ -2079,7 +2080,7 @@ namespace ts { // Some other SourceFile already exists with this package name and version. // Instead of creating a duplicate, just redirect to the existing one. const dupFile = createRedirectSourceFile(fileFromPackageId, file!, fileName, path); // TODO: GH#18217 - redirectTargetsSet.set(fileFromPackageId.path, true); + redirectTargetsMap.add(fileFromPackageId.path, fileName); filesByName.set(path, dupFile); sourceFileToPackageName.set(path, packageId.name); processingOtherFiles!.push(dupFile); @@ -2711,12 +2712,12 @@ namespace ts { function createDiagnosticForReference(index: number, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number) { const referencesSyntax = getProjectReferencesSyntax(); - if (referencesSyntax) { - if (createOptionDiagnosticInArrayLiteralSyntax(referencesSyntax, index, message, arg0, arg1)) { - return; - } + if (referencesSyntax && referencesSyntax.elements.length > index) { + programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile!, referencesSyntax.elements[index], message, arg0, arg1)); + } + else { + programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1)); } - programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1)); } function createDiagnosticForOption(onKey: boolean, option1: string, option2: string | undefined, message: DiagnosticMessage, arg0: string | number, arg1?: string | number, arg2?: string | number) { @@ -2769,15 +2770,6 @@ namespace ts { return !!props.length; } - function createOptionDiagnosticInArrayLiteralSyntax(arrayLiteral: ArrayLiteralExpression, index: number, message: DiagnosticMessage, arg0: string | number | undefined, arg1?: string | number, arg2?: string | number): boolean { - if (arrayLiteral.elements.length <= index) { - // Out-of-bounds - return false; - } - programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile!, arrayLiteral.elements[index], message, arg0, arg1, arg2)); - return false; // TODO: GH#18217 This function always returns `false`!` - } - function blockEmittingOfFile(emitFileName: string, diag: Diagnostic) { hasEmitBlockingDiagnostics.set(toPath(emitFileName), true); programDiagnostics.add(diag); diff --git a/src/compiler/resolutionCache.ts b/src/compiler/resolutionCache.ts index d05d8350508..ae451ae302d 100644 --- a/src/compiler/resolutionCache.ts +++ b/src/compiler/resolutionCache.ts @@ -52,7 +52,7 @@ namespace ts { getGlobalCache?(): string | undefined; writeLog(s: string): void; maxNumberOfFilesToIterateForInvalidation?: number; - getCurrentProgram(): Program; + getCurrentProgram(): Program | undefined; } interface DirectoryWatchesOfFailedLookup { @@ -398,8 +398,17 @@ namespace ts { function getDirectoryToWatchFailedLookupLocation(failedLookupLocation: string, failedLookupLocationPath: Path): DirectoryOfFailedLookupWatch { if (isInDirectoryPath(rootPath, failedLookupLocationPath)) { - // Always watch root directory recursively - return { dir: rootDir!, dirPath: rootPath }; // TODO: GH#18217 + failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? failedLookupLocation : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory()); + Debug.assert(failedLookupLocation.length === failedLookupLocationPath.length, `FailedLookup: ${failedLookupLocation} failedLookupLocationPath: ${failedLookupLocationPath}`); // tslint:disable-line + const subDirectoryInRoot = failedLookupLocationPath.indexOf(directorySeparator, rootPath.length + 1); + if (subDirectoryInRoot !== -1) { + // Instead of watching root, watch directory in root to avoid watching excluded directories not needed for module resolution + return { dir: failedLookupLocation.substr(0, subDirectoryInRoot), dirPath: failedLookupLocationPath.substr(0, subDirectoryInRoot) as Path }; + } + else { + // Always watch root directory non recursively + return { dir: rootDir!, dirPath: rootPath, nonRecursive: false }; // TODO: GH#18217 + } } return getDirectoryToWatchFromFailedLookupLocationDirectory( @@ -478,6 +487,7 @@ namespace ts { customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1); } if (dirPath === rootPath) { + Debug.assert(!nonRecursive); setAtRoot = true; } else { @@ -487,8 +497,8 @@ namespace ts { } if (setAtRoot) { - // This is always recursive - setDirectoryWatcher(rootDir!, rootPath); // TODO: GH#18217 + // This is always non recursive + setDirectoryWatcher(rootDir!, rootPath, /*nonRecursive*/ true); // TODO: GH#18217 } } @@ -497,7 +507,8 @@ namespace ts { } function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions: ResolutionWithFailedLookupLocations[], name: string) { - const updateResolution = resolutionHost.getCurrentProgram().getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name) ? + const program = resolutionHost.getCurrentProgram(); + const updateResolution = program && program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name) ? setRefCountToUndefined : watchFailedLookupLocationOfResolution; resolutions.forEach(updateResolution); } diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index bf4ae5ce7d3..7af0b7c5ad7 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -1752,6 +1752,12 @@ namespace ts { type SerializedEntityNameAsExpression = Identifier | BinaryExpression | PropertyAccessExpression; type SerializedTypeNode = SerializedEntityNameAsExpression | VoidExpression | ConditionalExpression; + function getAccessorTypeNode(node: AccessorDeclaration) { + const accessors = resolver.getAllAccessorDeclarations(node); + return accessors.setAccessor && getSetAccessorTypeAnnotationNode(accessors.setAccessor) + || accessors.getAccessor && getEffectiveReturnTypeNode(accessors.getAccessor); + } + /** * Serializes the type of a node for use with decorator type metadata. * @@ -1761,10 +1767,10 @@ namespace ts { switch (node.kind) { case SyntaxKind.PropertyDeclaration: case SyntaxKind.Parameter: - case SyntaxKind.GetAccessor: return serializeTypeNode((node).type); case SyntaxKind.SetAccessor: - return serializeTypeNode(getSetAccessorTypeAnnotationNode(node)); + case SyntaxKind.GetAccessor: + return serializeTypeNode(getAccessorTypeNode(node as AccessorDeclaration)); case SyntaxKind.ClassDeclaration: case SyntaxKind.ClassExpression: case SyntaxKind.MethodDeclaration: diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index 205e7cd8940..06a154cf16a 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -1268,7 +1268,7 @@ namespace ts { // Don't report status on "solution" projects break; default: - assertTypeIsNever(status); + assertType(status); } } } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 99d2291e898..2fdf8d4ac75 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -372,6 +372,7 @@ namespace ts { JSDocAugmentsTag, JSDocClassTag, JSDocCallbackTag, + JSDocEnumTag, JSDocParameterTag, JSDocReturnTag, JSDocThisTag, @@ -581,6 +582,7 @@ namespace ts { | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType + | ExportDeclaration | EndOfFileToken; export type HasType = @@ -858,6 +860,7 @@ namespace ts { name?: PropertyName; } + /** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */ export type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment @@ -2202,7 +2205,7 @@ namespace ts { name: Identifier; } - export interface ExportDeclaration extends DeclarationStatement { + export interface ExportDeclaration extends DeclarationStatement, JSDocContainer { kind: SyntaxKind.ExportDeclaration; parent: SourceFile | ModuleBlock; /** Will not be assigned in the case of `export * from "foo";` */ @@ -2348,6 +2351,11 @@ namespace ts { kind: SyntaxKind.JSDocClassTag; } + export interface JSDocEnumTag extends JSDocTag { + kind: SyntaxKind.JSDocEnumTag; + typeExpression?: JSDocTypeExpression; + } + export interface JSDocThisTag extends JSDocTag { kind: SyntaxKind.JSDocThisTag; typeExpression?: JSDocTypeExpression; @@ -2543,7 +2551,7 @@ namespace ts { /** * If two source files are for the same version of the same package, one will redirect to the other. * (See `createRedirectSourceFile` in program.ts.) - * The redirect will have this set. The redirected-to source file will be in `redirectTargetsSet`. + * The redirect will have this set. The redirected-to source file will be in `redirectTargetsMap`. */ /* @internal */ redirectInfo?: RedirectInfo; @@ -2790,7 +2798,7 @@ namespace ts { /** Given a source file, get the name of the package it was imported from. */ /* @internal */ sourceFileToPackageName: Map; /** Set of all source files that some other source file redirects to. */ - /* @internal */ redirectTargetsSet: Map; + /* @internal */ redirectTargetsMap: MultiMap; /** Is the file emitted file */ /* @internal */ isEmittedFile(file: string): boolean; @@ -2799,6 +2807,9 @@ namespace ts { getProjectReferences(): (ResolvedProjectReference | undefined)[] | undefined; } + /* @internal */ + export type RedirectTargetsMap = ReadonlyMap>; + export interface ResolvedProjectReference { commandLine: ParsedCommandLine; sourceFile: SourceFile; @@ -2876,6 +2887,8 @@ namespace ts { getSourceFiles(): ReadonlyArray; getSourceFile(fileName: string): SourceFile | undefined; getResolvedTypeReferenceDirectives(): ReadonlyMap; + + readonly redirectTargetsMap: RedirectTargetsMap; } export interface TypeChecker { @@ -2964,6 +2977,7 @@ namespace ts { * @param argumentCount Apparent number of arguments, passed in case of a possibly incomplete call. This should come from an ArgumentListInfo. See `signatureHelp.ts`. */ getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[], argumentCount?: number): Signature | undefined; + /* @internal */ getResolvedSignatureForSignatureHelp(node: CallLikeExpression, candidatesOutArray?: Signature[], argumentCount?: number): Signature | undefined; getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature | undefined; isImplementationOfOverload(node: SignatureDeclaration): boolean | undefined; isUndefinedSymbol(symbol: Symbol): boolean; @@ -3306,8 +3320,8 @@ namespace ts { export interface AllAccessorDeclarations { firstAccessor: AccessorDeclaration; secondAccessor: AccessorDeclaration | undefined; - getAccessor: AccessorDeclaration | undefined; - setAccessor: AccessorDeclaration | undefined; + getAccessor: GetAccessorDeclaration | undefined; + setAccessor: SetAccessorDeclaration | undefined; } /** Indicates how to serialize the name for a TypeReferenceNode when emitting decorator metadata */ diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 689e5cd2fef..56ea3cace0c 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -563,11 +563,6 @@ namespace ts { return isString(value) ? '"' + escapeNonAsciiString(value) + '"' : "" + value; } - // Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' - export function escapeLeadingUnderscores(identifier: string): __String { - return (identifier.length >= 2 && identifier.charCodeAt(0) === CharacterCodes._ && identifier.charCodeAt(1) === CharacterCodes._ ? "_" + identifier : identifier) as __String; - } - // Make an identifier from an external module name by extracting the string after the last "/" and replacing // all non-alphanumeric characters with underscores export function makeIdentifierFromModuleName(moduleName: string): string { @@ -676,6 +671,19 @@ namespace ts { export function isDeclarationWithTypeParameters(node: Node): node is DeclarationWithTypeParameters; export function isDeclarationWithTypeParameters(node: DeclarationWithTypeParameters): node is DeclarationWithTypeParameters { + switch (node.kind) { + case SyntaxKind.JSDocCallbackTag: + case SyntaxKind.JSDocTypedefTag: + case SyntaxKind.JSDocSignature: + return true; + default: + assertType(node); + return isDeclarationWithTypeParameterChildren(node); + } + } + + export function isDeclarationWithTypeParameterChildren(node: Node): node is DeclarationWithTypeParameterChildren; + export function isDeclarationWithTypeParameterChildren(node: DeclarationWithTypeParameterChildren): node is DeclarationWithTypeParameterChildren { switch (node.kind) { case SyntaxKind.CallSignature: case SyntaxKind.ConstructSignature: @@ -696,12 +704,9 @@ namespace ts { case SyntaxKind.SetAccessor: case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: - case SyntaxKind.JSDocCallbackTag: - case SyntaxKind.JSDocTypedefTag: - case SyntaxKind.JSDocSignature: return true; default: - assertTypeIsNever(node); + assertType(node); return false; } } @@ -786,7 +791,7 @@ namespace ts { return createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3); } - export function createDiagnosticForNodeArray(sourceFile: SourceFile, nodes: NodeArray, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): Diagnostic { + export function createDiagnosticForNodeArray(sourceFile: SourceFile, nodes: NodeArray, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): DiagnosticWithLocation { const start = skipTrivia(sourceFile.text, nodes.pos); return createFileDiagnostic(sourceFile, start, nodes.end - start, message, arg0, arg1, arg2, arg3); } @@ -3305,8 +3310,8 @@ namespace ts { // TODO: GH#18217 let firstAccessor!: AccessorDeclaration; let secondAccessor!: AccessorDeclaration; - let getAccessor!: AccessorDeclaration; - let setAccessor!: AccessorDeclaration; + let getAccessor!: GetAccessorDeclaration; + let setAccessor!: SetAccessorDeclaration; if (hasDynamicName(accessor)) { firstAccessor = accessor; if (accessor.kind === SyntaxKind.GetAccessor) { @@ -3334,11 +3339,11 @@ namespace ts { } if (member.kind === SyntaxKind.GetAccessor && !getAccessor) { - getAccessor = member; + getAccessor = member; } if (member.kind === SyntaxKind.SetAccessor && !setAccessor) { - setAccessor = member; + setAccessor = member; } } } @@ -4794,6 +4799,11 @@ namespace ts { return undefined; } + /** Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' */ + export function escapeLeadingUnderscores(identifier: string): __String { + return (identifier.length >= 2 && identifier.charCodeAt(0) === CharacterCodes._ && identifier.charCodeAt(1) === CharacterCodes._ ? "_" + identifier : identifier) as __String; + } + /** * Remove extra underscore from escaped identifier text content. * @@ -4985,6 +4995,11 @@ namespace ts { return getFirstJSDocTag(node, isJSDocClassTag); } + /** Gets the JSDoc enum tag for the node if present */ + export function getJSDocEnumTag(node: Node): JSDocEnumTag | undefined { + return getFirstJSDocTag(node, isJSDocEnumTag); + } + /** Gets the JSDoc this tag for the node if present */ export function getJSDocThisTag(node: Node): JSDocThisTag | undefined { return getFirstJSDocTag(node, isJSDocThisTag); @@ -5749,6 +5764,10 @@ namespace ts { return node.kind === SyntaxKind.JSDocClassTag; } + export function isJSDocEnumTag(node: Node): node is JSDocEnumTag { + return node.kind === SyntaxKind.JSDocEnumTag; + } + export function isJSDocThisTag(node: Node): node is JSDocThisTag { return node.kind === SyntaxKind.JSDocThisTag; } @@ -6622,18 +6641,7 @@ namespace ts { } export function isObjectLiteralElement(node: Node): node is ObjectLiteralElement { - switch (node.kind) { - case SyntaxKind.JsxAttribute: - case SyntaxKind.JsxSpreadAttribute: - case SyntaxKind.PropertyAssignment: - case SyntaxKind.ShorthandPropertyAssignment: - case SyntaxKind.MethodDeclaration: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - return true; - default: - return false; - } + return node.kind === SyntaxKind.JsxAttribute || node.kind === SyntaxKind.JsxSpreadAttribute || isObjectLiteralElementLike(node); } /* @internal */ @@ -7149,6 +7157,12 @@ namespace ts { return path.slice(0, Math.max(rootLength, path.lastIndexOf(directorySeparator))); } + export function startsWithDirectory(fileName: string, directoryName: string, getCanonicalFileName: GetCanonicalFileName): boolean { + const canonicalFileName = getCanonicalFileName(fileName); + const canonicalDirectoryName = getCanonicalFileName(directoryName); + return startsWith(canonicalFileName, canonicalDirectoryName + "/") || startsWith(canonicalFileName, canonicalDirectoryName + "\\"); + } + export function isUrl(path: string) { return getEncodedRootLength(path) < 0; } @@ -8128,4 +8142,75 @@ namespace ts { } return { min, max }; } + + export interface ReadonlyNodeSet { + has(node: TNode): boolean; + forEach(cb: (node: TNode) => void): void; + some(pred: (node: TNode) => boolean): boolean; + } + + export class NodeSet implements ReadonlyNodeSet { + private map = createMap(); + + add(node: TNode): void { + this.map.set(String(getNodeId(node)), node); + } + tryAdd(node: TNode): boolean { + if (this.has(node)) return false; + this.add(node); + return true; + } + has(node: TNode): boolean { + return this.map.has(String(getNodeId(node))); + } + forEach(cb: (node: TNode) => void): void { + this.map.forEach(cb); + } + some(pred: (node: TNode) => boolean): boolean { + return forEachEntry(this.map, pred) || false; + } + } + + export interface ReadonlyNodeMap { + get(node: TNode): TValue | undefined; + has(node: TNode): boolean; + } + + export class NodeMap implements ReadonlyNodeMap { + private map = createMap<{ node: TNode, value: TValue }>(); + + get(node: TNode): TValue | undefined { + const res = this.map.get(String(getNodeId(node))); + return res && res.value; + } + + getOrUpdate(node: TNode, setValue: () => TValue): TValue { + const res = this.get(node); + if (res) return res; + const value = setValue(); + this.set(node, value); + return value; + } + + set(node: TNode, value: TValue): void { + this.map.set(String(getNodeId(node)), { node, value }); + } + + has(node: TNode): boolean { + return this.map.has(String(getNodeId(node))); + } + + forEach(cb: (value: TValue, node: TNode) => void): void { + this.map.forEach(({ node, value }) => cb(value, node)); + } + } + + export function rangeOfNode(node: Node): TextRange { + return { pos: getTokenPosOfNode(node), end: node.end }; + } + + export function rangeOfTypeParameters(typeParameters: NodeArray): TextRange { + // Include the `<>` + return { pos: typeParameters.pos - 1, end: typeParameters.end + 1 }; + } } diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 6d50a66ad49..c72eb6eb12b 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1496,8 +1496,8 @@ Actual: ${stringify(fullActual)}`); const actualTags = selectedItem.tags; assert.equal(actualTags.length, (options.tags || ts.emptyArray).length, this.assertionMessageAtLastKnownMarker("signature help tags")); ts.zipWith((options.tags || ts.emptyArray), actualTags, (expectedTag, actualTag) => { - assert.equal(expectedTag.name, actualTag.name); - assert.equal(expectedTag.text, actualTag.text, this.assertionMessageAtLastKnownMarker("signature help tag " + actualTag.name)); + assert.equal(actualTag.name, expectedTag.name); + assert.equal(actualTag.text, expectedTag.text, this.assertionMessageAtLastKnownMarker("signature help tag " + actualTag.name)); }); const allKeys: ReadonlyArray = [ diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts index 602ed458c93..72ce3425cd8 100644 --- a/src/harness/typeWriter.ts +++ b/src/harness/typeWriter.ts @@ -75,10 +75,17 @@ class TypeWriterWalker { const sourceText = ts.getSourceTextOfNodeFromSourceFile(this.currentSourceFile, node); if (!isSymbolWalk) { + // Don't try to get the type of something that's already a type. + // Exception for `T` in `type T = something` because that may evaluate to some interesting type. + if (ts.isPartOfTypeNode(node) || ts.isIdentifier(node) && !(ts.getMeaningFromDeclaration(node.parent) & ts.SemanticMeaning.Value) && !(ts.isTypeAlias(node.parent) && node.parent.name === node)) { + return undefined; + } + // Workaround to ensure we output 'C' instead of 'typeof C' for base class expressions // let type = this.checker.getTypeAtLocation(node); - const type = node.parent && ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent) && this.checker.getTypeAtLocation(node.parent) || this.checker.getTypeAtLocation(node); - const typeString = type ? this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.AllowUniqueESSymbolType) : "No type information available!"; + let type = ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent) ? this.checker.getTypeAtLocation(node.parent) : undefined; + if (!type || type.flags & ts.TypeFlags.Any) type = this.checker.getTypeAtLocation(node); + const typeString = this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.AllowUniqueESSymbolType); return { line: lineAndCharacter.line, syntaxKind: node.kind, diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index 572c59bb305..2a2ed4ef7dc 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -583,6 +583,10 @@ interface Array {}` return; } this.invokeFileWatcher(fileOrDirectory.fullPath, FileWatcherEventKind.Created); + if (isFsFolder(fileOrDirectory)) { + this.invokeDirectoryWatcher(fileOrDirectory.fullPath, ""); + this.invokeWatchedDirectoriesRecursiveCallback(fileOrDirectory.fullPath, ""); + } this.invokeDirectoryWatcher(folder.fullPath, fileOrDirectory.fullPath); } @@ -599,12 +603,11 @@ interface Array {}` this.invokeFileWatcher(fileOrDirectory.fullPath, FileWatcherEventKind.Deleted); if (isFsFolder(fileOrDirectory)) { Debug.assert(fileOrDirectory.entries.length === 0 || isRenaming); - const relativePath = this.getRelativePathToDirectory(fileOrDirectory.fullPath, fileOrDirectory.fullPath); // Invoke directory and recursive directory watcher for the folder // Here we arent invoking recursive directory watchers for the base folders // since that is something we would want to do for both file as well as folder we are deleting - this.invokeWatchedDirectoriesCallback(fileOrDirectory.fullPath, relativePath); - this.invokeWatchedDirectoriesRecursiveCallback(fileOrDirectory.fullPath, relativePath); + this.invokeWatchedDirectoriesCallback(fileOrDirectory.fullPath, ""); + this.invokeWatchedDirectoriesRecursiveCallback(fileOrDirectory.fullPath, ""); } if (basePath !== fileOrDirectory.path) { diff --git a/src/lib/dom.generated.d.ts b/src/lib/dom.generated.d.ts index d1ddf216d74..a74a128f7dd 100644 --- a/src/lib/dom.generated.d.ts +++ b/src/lib/dom.generated.d.ts @@ -71,6 +71,10 @@ interface AssertionOptions { timeoutSeconds?: number; } +interface AssignedNodesOptions { + flatten?: boolean; +} + interface AudioBufferOptions { length: number; numberOfChannels?: number; @@ -152,6 +156,10 @@ interface CacheQueryOptions { ignoreVary?: boolean; } +interface CanvasRenderingContext2DSettings { + alpha?: boolean; +} + interface ChannelMergerOptions extends AudioNodeOptions { numberOfInputs?: number; } @@ -335,6 +343,10 @@ interface DoubleRange { min?: number; } +interface DragEventInit extends MouseEventInit { + dataTransfer?: DataTransfer | null; +} + interface DynamicsCompressorOptions extends AudioNodeOptions { attack?: number; knee?: number; @@ -344,15 +356,15 @@ interface DynamicsCompressorOptions extends AudioNodeOptions { } interface EcKeyAlgorithm extends KeyAlgorithm { - namedCurve: string; + namedCurve: NamedCurve; } interface EcKeyGenParams extends Algorithm { - namedCurve: string; + namedCurve: NamedCurve; } interface EcKeyImportParams extends Algorithm { - namedCurve: string; + namedCurve: NamedCurve; } interface EcdhKeyDeriveParams extends Algorithm { @@ -360,7 +372,7 @@ interface EcdhKeyDeriveParams extends Algorithm { } interface EcdsaParams extends Algorithm { - hash: string | Algorithm; + hash: HashAlgorithmIdentifier; } interface EffectTiming { @@ -374,6 +386,10 @@ interface EffectTiming { iterations?: number; } +interface ElementDefinitionOptions { + extends?: string; +} + interface ErrorEventInit extends EventInit { colno?: number; error?: any; @@ -414,25 +430,6 @@ interface ExceptionInformation { domain?: string | null; } -interface ExtendableEventInit extends EventInit { -} - -interface ExtendableMessageEventInit extends ExtendableEventInit { - data?: any; - lastEventId?: string; - origin?: string; - ports?: MessagePort[]; - source?: object | ServiceWorker | MessagePort; -} - -interface FetchEventInit extends ExtendableEventInit { - clientId?: string; - preloadResponse: Promise; - request: Request; - resultingClientId?: string; - targetClientId?: string; -} - interface FilePropertyBag extends BlobPropertyBag { lastModified?: number; } @@ -456,6 +453,10 @@ interface FocusNavigationOrigin { originWidth?: number; } +interface FocusOptions { + preventScroll?: boolean; +} + interface GainOptions extends AudioNodeOptions { gain?: number; } @@ -468,19 +469,23 @@ interface GetNotificationOptions { tag?: string; } +interface GetRootNodeOptions { + composed?: boolean; +} + interface HashChangeEventInit extends EventInit { newURL?: string; oldURL?: string; } interface HkdfParams extends Algorithm { - hash: string | Algorithm; + hash: HashAlgorithmIdentifier; info: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; } interface HmacImportParams extends Algorithm { - hash: string | Algorithm; + hash: HashAlgorithmIdentifier; length?: number; } @@ -490,7 +495,7 @@ interface HmacKeyAlgorithm extends KeyAlgorithm { } interface HmacKeyGenParams extends Algorithm { - hash: string | Algorithm; + hash: HashAlgorithmIdentifier; length?: number; } @@ -501,7 +506,7 @@ interface IDBIndexParameters { interface IDBObjectStoreParameters { autoIncrement?: boolean; - keyPath?: string | string[]; + keyPath?: string | string[] | null; } interface IDBVersionChangeEventInit extends EventInit { @@ -581,308 +586,6 @@ interface LongRange { min?: number; } -interface MSAccountInfo { - accountImageUri?: string; - accountName?: string; - rpDisplayName: string; - userDisplayName: string; - userId?: string; -} - -interface MSAudioLocalClientEvent extends MSLocalClientEventBase { - cpuInsufficientEventRatio?: number; - deviceCaptureNotFunctioningEventRatio?: number; - deviceClippingEventRatio?: number; - deviceEchoEventRatio?: number; - deviceGlitchesEventRatio?: number; - deviceHalfDuplexAECEventRatio?: number; - deviceHowlingEventCount?: number; - deviceLowSNREventRatio?: number; - deviceLowSpeechLevelEventRatio?: number; - deviceMultipleEndpointsEventCount?: number; - deviceNearEndToEchoRatioEventRatio?: number; - deviceRenderMuteEventRatio?: number; - deviceRenderNotFunctioningEventRatio?: number; - deviceRenderZeroVolumeEventRatio?: number; - networkDelayEventRatio?: number; - networkSendQualityEventRatio?: number; -} - -interface MSAudioRecvPayload extends MSPayloadBase { - burstLossLength1?: number; - burstLossLength2?: number; - burstLossLength3?: number; - burstLossLength4?: number; - burstLossLength5?: number; - burstLossLength6?: number; - burstLossLength7?: number; - burstLossLength8OrHigher?: number; - fecRecvDistance1?: number; - fecRecvDistance2?: number; - fecRecvDistance3?: number; - packetReorderDepthAvg?: number; - packetReorderDepthMax?: number; - packetReorderRatio?: number; - ratioCompressedSamplesAvg?: number; - ratioConcealedSamplesAvg?: number; - ratioStretchedSamplesAvg?: number; - samplingRate?: number; - signal?: MSAudioRecvSignal; -} - -interface MSAudioRecvSignal { - initialSignalLevelRMS?: number; - recvNoiseLevelCh1?: number; - recvSignalLevelCh1?: number; - renderLoopbackSignalLevel?: number; - renderNoiseLevel?: number; - renderSignalLevel?: number; -} - -interface MSAudioSendPayload extends MSPayloadBase { - audioFECUsed?: boolean; - samplingRate?: number; - sendMutePercent?: number; - signal?: MSAudioSendSignal; -} - -interface MSAudioSendSignal { - noiseLevel?: number; - sendNoiseLevelCh1?: number; - sendSignalLevelCh1?: number; -} - -interface MSConnectivity { - iceType?: MSIceType; - iceWarningFlags?: MSIceWarningFlags; - relayAddress?: MSRelayAddress; -} - -interface MSCredentialFilter { - accept?: MSCredentialSpec[]; -} - -interface MSCredentialParameters { - type?: MSCredentialType; -} - -interface MSCredentialSpec { - id?: string; - type: MSCredentialType; -} - -interface MSDCCEventInit extends EventInit { - maxFr?: number; - maxFs?: number; -} - -interface MSDSHEventInit extends EventInit { - sources?: number[]; - timestamp?: number; -} - -interface MSDelay { - roundTrip?: number; - roundTripMax?: number; -} - -interface MSDescription extends RTCStats { - connectivity?: MSConnectivity; - deviceDevName?: string; - localAddr?: MSIPAddressInfo; - networkconnectivity?: MSNetworkConnectivityInfo; - reflexiveLocalIPAddr?: MSIPAddressInfo; - remoteAddr?: MSIPAddressInfo; - transport?: RTCIceProtocol; -} - -interface MSFIDOCredentialParameters extends MSCredentialParameters { - algorithm?: string | Algorithm; - authenticators?: string[]; -} - -interface MSIPAddressInfo { - ipAddr?: string; - manufacturerMacAddrMask?: string; - port?: number; -} - -interface MSIceWarningFlags { - allocationMessageIntegrityFailed?: boolean; - alternateServerReceived?: boolean; - connCheckMessageIntegrityFailed?: boolean; - connCheckOtherError?: boolean; - fipsAllocationFailure?: boolean; - multipleRelayServersAttempted?: boolean; - noRelayServersConfigured?: boolean; - portRangeExhausted?: boolean; - pseudoTLSFailure?: boolean; - tcpNatConnectivityFailed?: boolean; - tcpRelayConnectivityFailed?: boolean; - turnAuthUnknownUsernameError?: boolean; - turnTcpAllocateFailed?: boolean; - turnTcpSendFailed?: boolean; - turnTcpTimedOut?: boolean; - turnTurnTcpConnectivityFailed?: boolean; - turnUdpAllocateFailed?: boolean; - turnUdpSendFailed?: boolean; - udpLocalConnectivityFailed?: boolean; - udpNatConnectivityFailed?: boolean; - udpRelayConnectivityFailed?: boolean; - useCandidateChecksFailed?: boolean; -} - -interface MSJitter { - interArrival?: number; - interArrivalMax?: number; - interArrivalSD?: number; -} - -interface MSLocalClientEventBase extends RTCStats { - networkBandwidthLowEventRatio?: number; - networkReceiveQualityEventRatio?: number; -} - -interface MSNetwork extends RTCStats { - delay?: MSDelay; - jitter?: MSJitter; - packetLoss?: MSPacketLoss; - utilization?: MSUtilization; -} - -interface MSNetworkConnectivityInfo { - linkspeed?: number; - networkConnectionDetails?: string; - vpn?: boolean; -} - -interface MSNetworkInterfaceType { - interfaceTypeEthernet?: boolean; - interfaceTypePPP?: boolean; - interfaceTypeTunnel?: boolean; - interfaceTypeWWAN?: boolean; - interfaceTypeWireless?: boolean; -} - -interface MSOutboundNetwork extends MSNetwork { - appliedBandwidthLimit?: number; -} - -interface MSPacketLoss { - lossRate?: number; - lossRateMax?: number; -} - -interface MSPayloadBase extends RTCStats { - payloadDescription?: string; -} - -interface MSPortRange { - max?: number; - min?: number; -} - -interface MSRelayAddress { - port?: number; - relayAddress?: string; -} - -interface MSSignatureParameters { - userPrompt?: string; -} - -interface MSTransportDiagnosticsStats extends RTCStats { - allocationTimeInMs?: number; - baseAddress?: string; - baseInterface?: MSNetworkInterfaceType; - iceRole?: RTCIceRole; - iceWarningFlags?: MSIceWarningFlags; - interfaces?: MSNetworkInterfaceType; - localAddrType?: MSIceAddrType; - localAddress?: string; - localInterface?: MSNetworkInterfaceType; - localMR?: string; - localMRTCPPort?: number; - localSite?: string; - msRtcEngineVersion?: string; - networkName?: string; - numConsentReqReceived?: number; - numConsentReqSent?: number; - numConsentRespReceived?: number; - numConsentRespSent?: number; - portRangeMax?: number; - portRangeMin?: number; - protocol?: RTCIceProtocol; - remoteAddrType?: MSIceAddrType; - remoteAddress?: string; - remoteMR?: string; - remoteMRTCPPort?: number; - remoteSite?: string; - rtpRtcpMux?: boolean; - stunVer?: number; -} - -interface MSUtilization { - bandwidthEstimation?: number; - bandwidthEstimationAvg?: number; - bandwidthEstimationMax?: number; - bandwidthEstimationMin?: number; - bandwidthEstimationStdDev?: number; - packets?: number; -} - -interface MSVideoPayload extends MSPayloadBase { - durationSeconds?: number; - resolution?: string; - videoBitRateAvg?: number; - videoBitRateMax?: number; - videoFrameRateAvg?: number; - videoPacketLossRate?: number; -} - -interface MSVideoRecvPayload extends MSVideoPayload { - lowBitRateCallPercent?: number; - lowFrameRateCallPercent?: number; - recvBitRateAverage?: number; - recvBitRateMaximum?: number; - recvCodecType?: string; - recvFpsHarmonicAverage?: number; - recvFrameRateAverage?: number; - recvNumResSwitches?: number; - recvReorderBufferMaxSuccessfullyOrderedExtent?: number; - recvReorderBufferMaxSuccessfullyOrderedLateTime?: number; - recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number; - recvReorderBufferPacketsDroppedDueToTimeout?: number; - recvReorderBufferReorderedPackets?: number; - recvResolutionHeight?: number; - recvResolutionWidth?: number; - recvVideoStreamsMax?: number; - recvVideoStreamsMin?: number; - recvVideoStreamsMode?: number; - reorderBufferTotalPackets?: number; - videoFrameLossRate?: number; - videoPostFECPLR?: number; - videoResolutions?: MSVideoResolutionDistribution; -} - -interface MSVideoResolutionDistribution { - cifQuality?: number; - h1080Quality?: number; - h1440Quality?: number; - h2160Quality?: number; - h720Quality?: number; - vgaQuality?: number; -} - -interface MSVideoSendPayload extends MSVideoPayload { - sendBitRateAverage?: number; - sendBitRateMaximum?: number; - sendFrameRateAverage?: number; - sendResolutionHeight?: number; - sendResolutionWidth?: number; - sendVideoStreamsMax?: number; -} - interface MediaElementAudioSourceOptions { mediaElement: HTMLMediaElement; } @@ -910,6 +613,11 @@ interface MediaKeySystemMediaCapability { robustness?: string; } +interface MediaQueryListEventInit extends EventInit { + matches?: boolean; + media?: string; +} + interface MediaStreamAudioSourceOptions { mediaStream: MediaStream; } @@ -1001,12 +709,11 @@ interface MediaTrackSupportedConstraints { } interface MessageEventInit extends EventInit { - channel?: string; data?: any; lastEventId?: string; origin?: string; ports?: MessagePort[]; - source?: Window | null; + source?: MessageEventSource | null; } interface MouseEventInit extends EventModifierInit { @@ -1019,15 +726,6 @@ interface MouseEventInit extends EventModifierInit { screenY?: number; } -interface MsZoomToOptions { - animate?: string; - contentX?: number; - contentY?: number; - scaleFactor?: number; - viewportX?: string | null; - viewportY?: string | null; -} - interface MutationObserverInit { attributeFilter?: string[]; attributeOldValue?: boolean; @@ -1049,11 +747,6 @@ interface NotificationAction { title: string; } -interface NotificationEventInit extends ExtendableEventInit { - action?: string; - notification: Notification; -} - interface NotificationOptions { actions?: NotificationAction[]; badge?: string; @@ -1175,7 +868,7 @@ interface PaymentShippingOption { } interface Pbkdf2Params extends Algorithm { - hash: string | Algorithm; + hash: HashAlgorithmIdentifier; iterations: number; salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; } @@ -1234,15 +927,6 @@ interface PropertyIndexedKeyframes extends Record any) | null; addEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; @@ -1952,6 +1620,19 @@ declare var AbortSignal: { new(): AbortSignal; }; +interface AbstractRange { + readonly collapsed: boolean; + readonly endContainer: Node; + readonly endOffset: number; + readonly startContainer: Node; + readonly startOffset: number; +} + +declare var AbstractRange: { + prototype: AbstractRange; + new(): AbstractRange; +}; + interface AbstractWorkerEventMap { "error": ErrorEvent; } @@ -2082,17 +1763,29 @@ interface ApplicationCacheEventMap { } interface ApplicationCache extends EventTarget { + /** @deprecated */ oncached: ((this: ApplicationCache, ev: Event) => any) | null; + /** @deprecated */ onchecking: ((this: ApplicationCache, ev: Event) => any) | null; + /** @deprecated */ ondownloading: ((this: ApplicationCache, ev: Event) => any) | null; + /** @deprecated */ onerror: ((this: ApplicationCache, ev: Event) => any) | null; + /** @deprecated */ onnoupdate: ((this: ApplicationCache, ev: Event) => any) | null; + /** @deprecated */ onobsolete: ((this: ApplicationCache, ev: Event) => any) | null; + /** @deprecated */ onprogress: ((this: ApplicationCache, ev: ProgressEvent) => any) | null; + /** @deprecated */ onupdateready: ((this: ApplicationCache, ev: Event) => any) | null; + /** @deprecated */ readonly status: number; + /** @deprecated */ abort(): void; + /** @deprecated */ swapCache(): void; + /** @deprecated */ update(): void; readonly CHECKING: number; readonly DOWNLOADING: number; @@ -2117,12 +1810,10 @@ declare var ApplicationCache: { readonly UPDATEREADY: number; }; -interface AssignedNodesOptions { - flatten?: boolean; -} - interface Attr extends Node { + readonly localName: string; readonly name: string; + readonly namespaceURI: string | null; readonly ownerElement: Element | null; readonly prefix: string | null; readonly specified: boolean; @@ -2406,7 +2097,7 @@ interface BaseAudioContext extends EventTarget { createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; createStereoPanner(): StereoPannerNode; createWaveShaper(): WaveShaperNode; - decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): Promise; + decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback | null, errorCallback?: DecodeErrorCallback | null): Promise; resume(): Promise; addEventListener(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; @@ -3157,14 +2848,51 @@ declare var CacheStorage: { new(): CacheStorage; }; -interface Canvas2DContextAttributes { - alpha?: boolean; - storage?: boolean; - willReadFrequently?: boolean; - [attribute: string]: boolean | string | undefined; +interface CanvasCompositing { + globalAlpha: number; + globalCompositeOperation: string; +} + +interface CanvasDrawImage { + drawImage(image: CanvasImageSource, dx: number, dy: number): void; + drawImage(image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number): void; + drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void; +} + +interface CanvasDrawPath { + beginPath(): void; + clip(fillRule?: CanvasFillRule): void; + clip(path: Path2D, fillRule?: CanvasFillRule): void; + fill(fillRule?: CanvasFillRule): void; + fill(path: Path2D, fillRule?: CanvasFillRule): void; + isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean; + isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean; + isPointInStroke(x: number, y: number): boolean; + isPointInStroke(path: Path2D, x: number, y: number): boolean; + stroke(): void; + stroke(path: Path2D): void; +} + +interface CanvasFillStrokeStyles { + fillStyle: string | CanvasGradient | CanvasPattern; + strokeStyle: string | CanvasGradient | CanvasPattern; + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; + createPattern(image: CanvasImageSource, repetition: string): CanvasPattern | null; + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; +} + +interface CanvasFilters { + filter: string; } interface CanvasGradient { + /** + * Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset + * at one end of the gradient, 1.0 is the offset at the other end. + * Throws an "IndexSizeError" DOMException if the offset + * is out of range. Throws a "SyntaxError" DOMException if + * the color cannot be parsed. + */ addColorStop(offset: number, color: string): void; } @@ -3173,10 +2901,22 @@ declare var CanvasGradient: { new(): CanvasGradient; }; -interface CanvasPathMethods { +interface CanvasImageData { + createImageData(sw: number, sh: number): ImageData; + createImageData(imagedata: ImageData): ImageData; + getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + putImageData(imagedata: ImageData, dx: number, dy: number): void; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number): void; +} + +interface CanvasImageSmoothing { + imageSmoothingEnabled: boolean; + imageSmoothingQuality: ImageSmoothingQuality; +} + +interface CanvasPath { arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radiusX: number, radiusY: number, rotation: number): void; bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; closePath(): void; ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; @@ -3186,8 +2926,22 @@ interface CanvasPathMethods { rect(x: number, y: number, w: number, h: number): void; } +interface CanvasPathDrawingStyles { + lineCap: CanvasLineCap; + lineDashOffset: number; + lineJoin: CanvasLineJoin; + lineWidth: number; + miterLimit: number; + getLineDash(): number[]; + setLineDash(segments: number[]): void; +} + interface CanvasPattern { - setTransform(matrix: SVGMatrix): void; + /** + * Sets the transformation matrix that will be used when rendering the pattern during a fill or + * stroke painting operation. + */ + setTransform(transform?: DOMMatrix2DInit): void; } declare var CanvasPattern: { @@ -3195,65 +2949,14 @@ declare var CanvasPattern: { new(): CanvasPattern; }; -interface CanvasRenderingContext2D extends CanvasPathMethods { - readonly canvas: HTMLCanvasElement; - fillStyle: string | CanvasGradient | CanvasPattern; - font: string; - globalAlpha: number; - globalCompositeOperation: string; - imageSmoothingEnabled: boolean; - lineCap: string; - lineDashOffset: number; - lineJoin: string; - lineWidth: number; - miterLimit: number; - mozImageSmoothingEnabled: boolean; - msFillRule: CanvasFillRule; - oImageSmoothingEnabled: boolean; - shadowBlur: number; - shadowColor: string; - shadowOffsetX: number; - shadowOffsetY: number; - strokeStyle: string | CanvasGradient | CanvasPattern; - textAlign: string; - textBaseline: string; - webkitImageSmoothingEnabled: boolean; - beginPath(): void; +interface CanvasRect { clearRect(x: number, y: number, w: number, h: number): void; - clip(fillRule?: CanvasFillRule): void; - clip(path: Path2D, fillRule?: CanvasFillRule): void; - createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; - createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; - drawFocusIfNeeded(element: Element): void; - drawFocusIfNeeded(path: Path2D, element: Element): void; - drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number): void; - drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number, dstW: number, dstH: number): void; - drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, srcX: number, srcY: number, srcW: number, srcH: number, dstX: number, dstY: number, dstW: number, dstH: number): void; - fill(fillRule?: CanvasFillRule): void; - fill(path: Path2D, fillRule?: CanvasFillRule): void; fillRect(x: number, y: number, w: number, h: number): void; - fillText(text: string, x: number, y: number, maxWidth?: number): void; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - getLineDash(): number[]; - isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean; - isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean; - isPointInStroke(x: number, y: number, fillRule?: CanvasFillRule): boolean; - isPointInStroke(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean; - measureText(text: string): TextMetrics; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; - restore(): void; - rotate(angle: number): void; - save(): void; - scale(x: number, y: number): void; - setLineDash(segments: number[]): void; - setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - stroke(path?: Path2D): void; strokeRect(x: number, y: number, w: number, h: number): void; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; - transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - translate(x: number, y: number): void; +} + +interface CanvasRenderingContext2D extends CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { + readonly canvas: HTMLCanvasElement; } declare var CanvasRenderingContext2D: { @@ -3261,6 +2964,60 @@ declare var CanvasRenderingContext2D: { new(): CanvasRenderingContext2D; }; +interface CanvasShadowStyles { + shadowBlur: number; + shadowColor: string; + shadowOffsetX: number; + shadowOffsetY: number; +} + +interface CanvasState { + restore(): void; + save(): void; +} + +interface CanvasText { + fillText(text: string, x: number, y: number, maxWidth?: number): void; + measureText(text: string): TextMetrics; + strokeText(text: string, x: number, y: number, maxWidth?: number): void; +} + +interface CanvasTextDrawingStyles { + direction: CanvasDirection; + font: string; + textAlign: CanvasTextAlign; + textBaseline: CanvasTextBaseline; +} + +interface CanvasTransform { + getTransform(): DOMMatrix; + resetTransform(): void; + rotate(angle: number): void; + scale(x: number, y: number): void; + setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void; + setTransform(transform?: DOMMatrix2DInit): void; + transform(a: number, b: number, c: number, d: number, e: number, f: number): void; + translate(x: number, y: number): void; +} + +interface CanvasUserInterface { + drawFocusIfNeeded(element: Element): void; + drawFocusIfNeeded(path: Path2D, element: Element): void; + scrollPathIntoView(): void; + scrollPathIntoView(path: Path2D): void; +} + +interface CaretPosition { + readonly offset: number; + readonly offsetNode: Node; + getClientRect(): DOMRect | null; +} + +declare var CaretPosition: { + prototype: CaretPosition; + new(): CaretPosition; +}; + interface ChannelMergerNode extends AudioNode { } @@ -3277,13 +3034,13 @@ declare var ChannelSplitterNode: { new(context: BaseAudioContext, options?: ChannelSplitterOptions): ChannelSplitterNode; }; -interface CharacterData extends Node, ChildNode { +interface CharacterData extends Node, NonDocumentTypeChildNode, ChildNode { data: string; readonly length: number; - appendData(arg: string): void; + appendData(data: string): void; deleteData(offset: number, count: number): void; - insertData(offset: number, arg: string): void; - replaceData(offset: number, count: number, arg: string): void; + insertData(offset: number, data: string): void; + replaceData(offset: number, count: number, data: string): void; substringData(offset: number, count: number): string; } @@ -3292,8 +3049,29 @@ declare var CharacterData: { new(): CharacterData; }; -interface ChildNode { +interface ChildNode extends Node { + /** + * Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. + * Throws a "HierarchyRequestError" DOMException if the constraints of + * the node tree are violated. + */ + after(...nodes: (Node | string)[]): void; + /** + * Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. + * Throws a "HierarchyRequestError" DOMException if the constraints of + * the node tree are violated. + */ + before(...nodes: (Node | string)[]): void; + /** + * Removes node. + */ remove(): void; + /** + * Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. + * Throws a "HierarchyRequestError" DOMException if the constraints of + * the node tree are violated. + */ + replaceWith(...nodes: (Node | string)[]): void; } interface ClientRect { @@ -3349,7 +3127,6 @@ declare var CloseEvent: { }; interface Comment extends CharacterData { - text: string; } declare var Comment: { @@ -3393,10 +3170,8 @@ interface Console { info(message?: any, ...optionalParams: any[]): void; log(message?: any, ...optionalParams: any[]): void; markTimeline(label?: string): void; - msIsIndependentlyComposed(element: Element): boolean; profile(reportName?: string): void; - profileEnd(): void; - select(element: Element): void; + profileEnd(reportName?: string): void; table(...tabularData: any[]): void; time(label?: string): void; timeEnd(label?: string): void; @@ -3468,8 +3243,8 @@ declare var Crypto: { interface CryptoKey { readonly algorithm: KeyAlgorithm; readonly extractable: boolean; - readonly type: string; - readonly usages: string[]; + readonly type: KeyType; + readonly usages: KeyUsage[]; } declare var CryptoKey: { @@ -3490,10 +3265,20 @@ declare var CryptoKeyPair: { interface CustomElementRegistry { define(name: string, constructor: Function, options?: ElementDefinitionOptions): void; get(name: string): any; - whenDefined(name: string): PromiseLike; + upgrade(root: Node): void; + whenDefined(name: string): Promise; } +declare var CustomElementRegistry: { + prototype: CustomElementRegistry; + new(): CustomElementRegistry; +}; + interface CustomEvent extends Event { + /** + * Returns any custom data event was created with. + * Typically used for synthetic events. + */ readonly detail: T; initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: T): void; } @@ -3578,7 +3363,8 @@ interface DOMImplementation { createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null): Document; createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; createHTMLDocument(title?: string): Document; - hasFeature(feature: string | null, version: string | null): boolean; + /** @deprecated */ + hasFeature(...args: any[]): true; } declare var DOMImplementation: { @@ -3590,10 +3376,6 @@ interface DOML2DeprecatedColorProperty { color: string; } -interface DOML2DeprecatedSizeProperty { - size: number; -} - interface DOMMatrix extends DOMMatrixReadOnly { a: number; b: number; @@ -3838,14 +3620,56 @@ declare var DOMStringMap: { }; interface DOMTokenList { + /** + * Returns the number of tokens. + */ readonly length: number; + /** + * Returns the associated set as string. + * Can be set, to change the associated attribute. + */ + value: string; + /** + * Adds all arguments passed, except those already present. + * Throws a "SyntaxError" DOMException if one of the arguments is the empty + * string. + * Throws an "InvalidCharacterError" DOMException if one of the arguments + * contains any ASCII whitespace. + */ add(...tokens: string[]): void; + /** + * Returns true if token is present, and false otherwise. + */ contains(token: string): boolean; + /** + * tokenlist[index] + */ item(index: number): string | null; + /** + * Removes arguments passed, if they are present. + * Throws a "SyntaxError" DOMException if one of the arguments is the empty + * string. + * Throws an "InvalidCharacterError" DOMException if one of the arguments + * contains any ASCII whitespace. + */ remove(...tokens: string[]): void; + /** + * Replaces token with newToken. + * Returns true if token was replaced with newToken, and false otherwise. + * Throws a "SyntaxError" DOMException if one of the arguments is the empty + * string. + * Throws an "InvalidCharacterError" DOMException if one of the arguments + * contains any ASCII whitespace. + */ replace(oldToken: string, newToken: string): void; - toString(): string; + /** + * Returns true if token is in the associated attribute's supported tokens. Returns + * false otherwise. + * Throws a TypeError if the associated attribute has no supported tokens defined. + */ + supports(token: string): boolean; toggle(token: string, force?: boolean): boolean; + forEach(callbackfn: (value: string, key: number, parent: DOMTokenList) => void, thisArg?: any): void; [index: number]: string; } @@ -3870,12 +3694,35 @@ declare var DataCue: { interface DataTransfer { dropEffect: string; effectAllowed: string; + /** + * Returns a FileList of the files being dragged, if any. + */ readonly files: FileList; + /** + * Returns a DataTransferItemList object, with the drag data. + */ readonly items: DataTransferItemList; - readonly types: string[]; - clearData(format?: string): boolean; + /** + * Returns a frozen array listing the formats that were set in the dragstart event. In addition, if any files are being + * dragged, then one of the types will be the string "Files". + */ + readonly types: ReadonlyArray; + /** + * Removes the data of the specified formats. Removes all data if the argument is omitted. + */ + clearData(format?: string): void; + /** + * Returns the specified data. If there is no such data, returns the empty string. + */ getData(format: string): string; - setData(format: string, data: string): boolean; + /** + * Adds the specified data. + */ + setData(format: string, data: string): void; + /** + * Uses the given element to update the drag feedback, replacing any previously specified + * feedback. + */ setDragImage(image: Element, x: number, y: number): void; } @@ -3885,10 +3732,24 @@ declare var DataTransfer: { }; interface DataTransferItem { + /** + * Returns the drag data item kind, one of: "string", + * "file". + */ readonly kind: string; + /** + * Returns the drag data item type string. + */ readonly type: string; + /** + * Returns a File object, if the drag data item kind is File. + */ getAsFile(): File | null; - getAsString(_callback: FunctionStringCallback | null): void; + /** + * Invokes the callback with the string data as the argument, if the drag data item + * kind is Plain Unicode string. + */ + getAsString(callback: FunctionStringCallback | null): void; webkitGetAsEntry(): any; } @@ -3898,11 +3759,25 @@ declare var DataTransferItem: { }; interface DataTransferItemList { + /** + * Returns the number of items in the drag data store. + */ readonly length: number; - add(data: File): DataTransferItem | null; + /** + * Adds a new entry for the given data to the drag data store. If the data is plain + * text then a type string has to be provided + * also. + */ add(data: string, type: string): DataTransferItem | null; + add(data: File): DataTransferItem | null; + /** + * Removes all the entries in the drag data store. + */ clear(): void; item(index: number): DataTransferItem; + /** + * Removes the indexth entry in the drag data store. + */ remove(index: number): void; [name: number]: DataTransferItem; } @@ -4010,110 +3885,20 @@ interface DhKeyGenParams extends Algorithm { prime: Uint8Array; } -interface DocumentEventMap extends GlobalEventHandlersEventMap { - "abort": UIEvent; - "activate": Event; - "beforeactivate": Event; - "beforedeactivate": Event; - "blur": FocusEvent; - "canplay": Event; - "canplaythrough": Event; - "change": Event; - "click": MouseEvent; - "contextmenu": PointerEvent; - "dblclick": MouseEvent; - "deactivate": Event; - "drag": DragEvent; - "dragend": DragEvent; - "dragenter": DragEvent; - "dragleave": DragEvent; - "dragover": DragEvent; - "dragstart": DragEvent; - "drop": DragEvent; - "durationchange": Event; - "emptied": Event; - "ended": Event; - "error": ErrorEvent; - "focus": FocusEvent; - "fullscreenchange": Event; - "fullscreenerror": Event; - "input": Event; - "invalid": Event; - "keydown": KeyboardEvent; - "keypress": KeyboardEvent; - "keyup": KeyboardEvent; - "load": Event; - "loadeddata": Event; - "loadedmetadata": Event; - "loadstart": Event; - "mousedown": MouseEvent; - "mousemove": MouseEvent; - "mouseout": MouseEvent; - "mouseover": MouseEvent; - "mouseup": MouseEvent; - "mousewheel": WheelEvent; - "MSContentZoom": Event; - "MSGestureChange": Event; - "MSGestureDoubleTap": Event; - "MSGestureEnd": Event; - "MSGestureHold": Event; - "MSGestureStart": Event; - "MSGestureTap": Event; - "MSInertiaStart": Event; - "MSManipulationStateChanged": Event; - "MSPointerCancel": Event; - "MSPointerDown": Event; - "MSPointerEnter": Event; - "MSPointerLeave": Event; - "MSPointerMove": Event; - "MSPointerOut": Event; - "MSPointerOver": Event; - "MSPointerUp": Event; - "mssitemodejumplistitemremoved": Event; - "msthumbnailclick": Event; - "pause": Event; - "play": Event; - "playing": Event; - "pointerlockchange": Event; - "pointerlockerror": Event; - "progress": ProgressEvent; - "ratechange": Event; - "readystatechange": Event; - "reset": Event; - "scroll": UIEvent; - "seeked": Event; - "seeking": Event; - "select": UIEvent; - "selectionchange": Event; - "selectstart": Event; - "stalled": Event; - "stop": Event; - "submit": Event; - "suspend": Event; - "timeupdate": Event; - "touchcancel": TouchEvent; - "touchend": TouchEvent; - "touchmove": TouchEvent; - "touchstart": TouchEvent; - "volumechange": Event; - "waiting": Event; - "webkitfullscreenchange": Event; - "webkitfullscreenerror": Event; +interface DocumentEventMap extends GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap { + "readystatechange": ProgressEvent; + "visibilitychange": Event; } -interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent { +interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, GlobalEventHandlers, DocumentAndElementEventHandlers { /** * Sets or gets the URL for the current document. */ readonly URL: string; - /** - * Gets the URL for the document, stripped of any character encoding. - */ - readonly URLUnencoded: string; /** * Gets the object that has the focus when the parent document has focus. */ - readonly activeElement: Element; + readonly activeElement: Element | null; /** * Sets or gets the color of all active links in the document. */ @@ -4142,19 +3927,45 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent /** * Specifies the beginning and end of the document body. */ - body: HTMLElement; + body: HTMLElement | null; + /** + * Returns document's encoding. + */ readonly characterSet: string; /** * Gets or sets the character set used to encode the object. */ - charset: string; + readonly charset: string; /** * Gets a value that indicates whether standards-compliant mode is switched on for the object. */ readonly compatMode: string; + /** + * Returns document's content type. + */ + readonly contentType: string; + /** + * Returns the HTTP cookies that apply to the Document. If there are no cookies or + * cookies can't be applied to this resource, the empty string will be returned. + * Can be set, to add a new cookie to the element's set of HTTP cookies. + * If the contents are sandboxed into a + * unique origin (e.g. in an iframe with the sandbox attribute), a + * "SecurityError" DOMException will be thrown on getting + * and setting. + */ cookie: string; - readonly currentScript: HTMLScriptElement | SVGScriptElement | null; - readonly defaultView: Window; + /** + * Returns the script element, or the SVG script element, + * that is currently executing, as long as the element represents a classic script. + * In the case of reentrant script execution, returns the one that most recently started executing + * amongst those that have not yet finished executing. + * Returns null if the Document is not currently executing a script + * or SVG script element (e.g., because the running script is an event + * handler, or a timeout), or if the currently executing script or SVG + * script element represents a module script. + */ + readonly currentScript: HTMLOrSVGScriptElement | null; + readonly defaultView: WindowProxy | null; /** * Sets or gets a value that indicates whether the document can be edited. */ @@ -4166,11 +3977,15 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent /** * Gets an object representing the document type declaration associated with the current document. */ - readonly doctype: DocumentType; + readonly doctype: DocumentType | null; /** * Gets a reference to the root node of the document. */ - readonly documentElement: HTMLElement; + readonly documentElement: HTMLElement | null; + /** + * Returns document's URL. + */ + readonly documentURI: string; /** * Sets or gets the security domain of the document. */ @@ -4188,9 +4003,10 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent * Retrieves a collection, in source order, of all form objects in the document. */ readonly forms: HTMLCollectionOf; - readonly fullscreenElement: Element | null; - readonly fullscreenEnabled: boolean; - readonly head: HTMLHeadElement; + /** + * Returns the head element. + */ + readonly head: HTMLHeadElement | null; readonly hidden: boolean; /** * Retrieves a collection, in source order, of img objects in the document. @@ -4203,7 +4019,7 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent /** * Returns the character encoding used to create the webpage that is loaded into the document object. */ - readonly inputEncoding: string | null; + readonly inputEncoding: string; /** * Gets the date that the page was last modified, if the page supplies one. */ @@ -4220,316 +4036,21 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent /** * Contains information about the current URL. */ - location: Location; - msCSSOMElementFloatMetrics: boolean; - msCapsLockWarningOff: boolean; - /** - * Fires when the user aborts the download. - * @param ev The event. - */ - onabort: ((this: Document, ev: UIEvent) => any) | null; - /** - * Fires when the object is set as the active element. - * @param ev The event. - */ - onactivate: ((this: Document, ev: Event) => any) | null; - /** - * Fires immediately before the object is set as the active element. - * @param ev The event. - */ - onbeforeactivate: ((this: Document, ev: Event) => any) | null; - /** - * Fires immediately before the activeElement is changed from the current object to another object in the parent document. - * @param ev The event. - */ - onbeforedeactivate: ((this: Document, ev: Event) => any) | null; - /** - * Fires when the object loses the input focus. - * @param ev The focus event. - */ - onblur: ((this: Document, ev: FocusEvent) => any) | null; - /** - * Occurs when playback is possible, but would require further buffering. - * @param ev The event. - */ - oncanplay: ((this: Document, ev: Event) => any) | null; - oncanplaythrough: ((this: Document, ev: Event) => any) | null; - /** - * Fires when the contents of the object or selection have changed. - * @param ev The event. - */ - onchange: ((this: Document, ev: Event) => any) | null; - /** - * Fires when the user clicks the left mouse button on the object - * @param ev The mouse event. - */ - onclick: ((this: Document, ev: MouseEvent) => any) | null; - /** - * Fires when the user clicks the right mouse button in the client area, opening the context menu. - * @param ev The mouse event. - */ - oncontextmenu: ((this: Document, ev: PointerEvent) => any) | null; - /** - * Fires when the user double-clicks the object. - * @param ev The mouse event. - */ - ondblclick: ((this: Document, ev: MouseEvent) => any) | null; - /** - * Fires when the activeElement is changed from the current object to another object in the parent document. - * @param ev The UI Event - */ - ondeactivate: ((this: Document, ev: Event) => any) | null; - /** - * Fires on the source object continuously during a drag operation. - * @param ev The event. - */ - ondrag: ((this: Document, ev: DragEvent) => any) | null; - /** - * Fires on the source object when the user releases the mouse at the close of a drag operation. - * @param ev The event. - */ - ondragend: ((this: Document, ev: DragEvent) => any) | null; - /** - * Fires on the target element when the user drags the object to a valid drop target. - * @param ev The drag event. - */ - ondragenter: ((this: Document, ev: DragEvent) => any) | null; - /** - * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. - * @param ev The drag event. - */ - ondragleave: ((this: Document, ev: DragEvent) => any) | null; - /** - * Fires on the target element continuously while the user drags the object over a valid drop target. - * @param ev The event. - */ - ondragover: ((this: Document, ev: DragEvent) => any) | null; - /** - * Fires on the source object when the user starts to drag a text selection or selected object. - * @param ev The event. - */ - ondragstart: ((this: Document, ev: DragEvent) => any) | null; - ondrop: ((this: Document, ev: DragEvent) => any) | null; - /** - * Occurs when the duration attribute is updated. - * @param ev The event. - */ - ondurationchange: ((this: Document, ev: Event) => any) | null; - /** - * Occurs when the media element is reset to its initial state. - * @param ev The event. - */ - onemptied: ((this: Document, ev: Event) => any) | null; - /** - * Occurs when the end of playback is reached. - * @param ev The event - */ - onended: ((this: Document, ev: Event) => any) | null; - /** - * Fires when an error occurs during object loading. - * @param ev The event. - */ - onerror: ((this: Document, ev: ErrorEvent) => any) | null; - /** - * Fires when the object receives focus. - * @param ev The event. - */ - onfocus: ((this: Document, ev: FocusEvent) => any) | null; - onfullscreenchange: ((this: Document, ev: Event) => any) | null; - onfullscreenerror: ((this: Document, ev: Event) => any) | null; - oninput: ((this: Document, ev: Event) => any) | null; - oninvalid: ((this: Document, ev: Event) => any) | null; - /** - * Fires when the user presses a key. - * @param ev The keyboard event - */ - onkeydown: ((this: Document, ev: KeyboardEvent) => any) | null; - /** - * Fires when the user presses an alphanumeric key. - * @param ev The event. - */ - onkeypress: ((this: Document, ev: KeyboardEvent) => any) | null; - /** - * Fires when the user releases a key. - * @param ev The keyboard event - */ - onkeyup: ((this: Document, ev: KeyboardEvent) => any) | null; - /** - * Fires immediately after the browser loads the object. - * @param ev The event. - */ - onload: ((this: Document, ev: Event) => any) | null; - /** - * Occurs when media data is loaded at the current playback position. - * @param ev The event. - */ - onloadeddata: ((this: Document, ev: Event) => any) | null; - /** - * Occurs when the duration and dimensions of the media have been determined. - * @param ev The event. - */ - onloadedmetadata: ((this: Document, ev: Event) => any) | null; - /** - * Occurs when Internet Explorer begins looking for media data. - * @param ev The event. - */ - onloadstart: ((this: Document, ev: Event) => any) | null; - /** - * Fires when the user clicks the object with either mouse button. - * @param ev The mouse event. - */ - onmousedown: ((this: Document, ev: MouseEvent) => any) | null; - /** - * Fires when the user moves the mouse over the object. - * @param ev The mouse event. - */ - onmousemove: ((this: Document, ev: MouseEvent) => any) | null; - /** - * Fires when the user moves the mouse pointer outside the boundaries of the object. - * @param ev The mouse event. - */ - onmouseout: ((this: Document, ev: MouseEvent) => any) | null; - /** - * Fires when the user moves the mouse pointer into the object. - * @param ev The mouse event. - */ - onmouseover: ((this: Document, ev: MouseEvent) => any) | null; - /** - * Fires when the user releases a mouse button while the mouse is over the object. - * @param ev The mouse event. - */ - onmouseup: ((this: Document, ev: MouseEvent) => any) | null; - /** - * Fires when the wheel button is rotated. - * @param ev The mouse event - */ - onmousewheel: ((this: Document, ev: WheelEvent) => any) | null; - onmscontentzoom: ((this: Document, ev: Event) => any) | null; - onmsgesturechange: ((this: Document, ev: Event) => any) | null; - onmsgesturedoubletap: ((this: Document, ev: Event) => any) | null; - onmsgestureend: ((this: Document, ev: Event) => any) | null; - onmsgesturehold: ((this: Document, ev: Event) => any) | null; - onmsgesturestart: ((this: Document, ev: Event) => any) | null; - onmsgesturetap: ((this: Document, ev: Event) => any) | null; - onmsinertiastart: ((this: Document, ev: Event) => any) | null; - onmsmanipulationstatechanged: ((this: Document, ev: Event) => any) | null; - onmspointercancel: ((this: Document, ev: Event) => any) | null; - onmspointerdown: ((this: Document, ev: Event) => any) | null; - onmspointerenter: ((this: Document, ev: Event) => any) | null; - onmspointerleave: ((this: Document, ev: Event) => any) | null; - onmspointermove: ((this: Document, ev: Event) => any) | null; - onmspointerout: ((this: Document, ev: Event) => any) | null; - onmspointerover: ((this: Document, ev: Event) => any) | null; - onmspointerup: ((this: Document, ev: Event) => any) | null; - /** - * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. - * @param ev The event. - */ - onmssitemodejumplistitemremoved: ((this: Document, ev: Event) => any) | null; - /** - * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. - * @param ev The event. - */ - onmsthumbnailclick: ((this: Document, ev: Event) => any) | null; - /** - * Occurs when playback is paused. - * @param ev The event. - */ - onpause: ((this: Document, ev: Event) => any) | null; - /** - * Occurs when the play method is requested. - * @param ev The event. - */ - onplay: ((this: Document, ev: Event) => any) | null; - /** - * Occurs when the audio or video has started playing. - * @param ev The event. - */ - onplaying: ((this: Document, ev: Event) => any) | null; - onpointerlockchange: ((this: Document, ev: Event) => any) | null; - onpointerlockerror: ((this: Document, ev: Event) => any) | null; - /** - * Occurs to indicate progress while downloading media data. - * @param ev The event. - */ - onprogress: ((this: Document, ev: ProgressEvent) => any) | null; - /** - * Occurs when the playback rate is increased or decreased. - * @param ev The event. - */ - onratechange: ((this: Document, ev: Event) => any) | null; + location: Location | null; /** * Fires when the state of the object has changed. * @param ev The event */ - onreadystatechange: ((this: Document, ev: Event) => any) | null; - /** - * Fires when the user resets a form. - * @param ev The event. + onreadystatechange: ((this: Document, ev: ProgressEvent) => any) | null; + onvisibilitychange: ((this: Document, ev: Event) => any) | null; + /** + * Returns document's origin. */ - onreset: ((this: Document, ev: Event) => any) | null; - /** - * Fires when the user repositions the scroll box in the scroll bar on the object. - * @param ev The event. + readonly origin: string; + /** + * Return an HTMLCollection of the embed elements in the Document. */ - onscroll: ((this: Document, ev: UIEvent) => any) | null; - /** - * Occurs when the seek operation ends. - * @param ev The event. - */ - onseeked: ((this: Document, ev: Event) => any) | null; - /** - * Occurs when the current playback position is moved. - * @param ev The event. - */ - onseeking: ((this: Document, ev: Event) => any) | null; - /** - * Fires when the current selection changes. - * @param ev The event. - */ - onselect: ((this: Document, ev: UIEvent) => any) | null; - /** - * Fires when the selection state of a document changes. - * @param ev The event. - */ - onselectionchange: ((this: Document, ev: Event) => any) | null; - onselectstart: ((this: Document, ev: Event) => any) | null; - /** - * Occurs when the download has stopped. - * @param ev The event. - */ - onstalled: ((this: Document, ev: Event) => any) | null; - /** - * Fires when the user clicks the Stop button or leaves the Web page. - * @param ev The event. - */ - onstop: ((this: Document, ev: Event) => any) | null; - onsubmit: ((this: Document, ev: Event) => any) | null; - /** - * Occurs if the load operation has been intentionally halted. - * @param ev The event. - */ - onsuspend: ((this: Document, ev: Event) => any) | null; - /** - * Occurs to indicate the current playback position. - * @param ev The event. - */ - ontimeupdate: ((this: Document, ev: Event) => any) | null; - onvisibilitychange: (this: Document, ev: Event) => any; - /** - * Occurs when the volume is changed, or playback is muted or unmuted. - * @param ev The event. - */ - onvolumechange: ((this: Document, ev: Event) => any) | null; - /** - * Occurs when playback stops because the next frame of a video resource is not available. - * @param ev The event. - */ - onwaiting: ((this: Document, ev: Event) => any) | null; - onwebkitfullscreenchange: ((this: Document, ev: Event) => any) | null; - onwebkitfullscreenerror: ((this: Document, ev: Event) => any) | null; readonly plugins: HTMLCollectionOf; - readonly pointerLockElement: Element; /** * Retrieves a value that indicates the current state of the object. */ @@ -4538,19 +4059,11 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent * Gets the URL of the location that referred the user to the current page. */ readonly referrer: string; - /** - * Gets the root svg element in the document hierarchy. - */ - readonly rootElement: SVGSVGElement; /** * Retrieves a collection of all script objects in the document. */ readonly scripts: HTMLCollectionOf; readonly scrollingElement: Element | null; - /** - * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. - */ - readonly styleSheets: StyleSheetList; readonly timeline: DocumentTimeline; /** * Contains the title of the document. @@ -4562,20 +4075,15 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent */ /** @deprecated */ vlinkColor: string; - readonly webkitCurrentFullScreenElement: Element | null; - readonly webkitFullscreenElement: Element | null; - readonly webkitFullscreenEnabled: boolean; - readonly webkitIsFullScreen: boolean; - readonly xmlEncoding: string | null; - xmlStandalone: boolean; - /** - * Gets or sets the version attribute specified in the declaration of an XML document. + /** + * Moves node from another document and returns it. + * If node is a document, throws a "NotSupportedError" DOMException or, if node is a shadow root, throws a + * "HierarchyRequestError" DOMException. */ - xmlVersion: string | null; adoptNode(source: T): T; /** @deprecated */ captureEvents(): void; - caretRangeFromPoint(x: number, y: number): Range; + caretPositionFromPoint(x: number, y: number): CaretPosition | null; /** @deprecated */ clear(): void; /** @@ -4586,8 +4094,11 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent * Creates an attribute object with a specified name. * @param name String that sets the attribute object's name. */ - createAttribute(name: string): Attr; - createAttributeNS(namespaceURI: string | null, qualifiedName: string): Attr; + createAttribute(localName: string): Attr; + createAttributeNS(namespace: string | null, qualifiedName: string): Attr; + /** + * Returns a CDATASection node whose data is data. + */ createCDATASection(data: string): CDATASection; /** * Creates a comment object with the specified data. @@ -4603,7 +4114,23 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent * @param tagName The name of an element. */ createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; + /** @deprecated */ + createElement(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; createElement(tagName: string, options?: ElementCreationOptions): HTMLElement; + /** + * Returns an element with namespace namespace. Its namespace prefix will be everything before ":" (U+003E) in qualifiedName or null. Its local name will be everything after + * ":" (U+003E) in qualifiedName or qualifiedName. + * If localName does not match the Name production an + * "InvalidCharacterError" DOMException will be thrown. + * If one of the following conditions is true a "NamespaceError" DOMException will be thrown: + * localName does not match the QName production. + * Namespace prefix is not null and namespace is the empty string. + * Namespace prefix is "xml" and namespace is not the XML namespace. + * qualifiedName or namespace prefix is "xmlns" and namespace is not the XMLNS namespace. + * namespace is the XMLNS namespace and + * neither qualifiedName nor namespace prefix is "xmlns". + * When supplied, options's is can be used to create a customized built-in element. + */ createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement; @@ -4667,162 +4194,8 @@ interface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "use"): SVGUseElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "view"): SVGViewElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement; - createElementNS(namespaceURI: string | null, qualifiedName: string): Element; - createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; - createNSResolver(nodeResolver: Node): XPathNSResolver; - /** - * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list - * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator; - createProcessingInstruction(target: string, data: string): ProcessingInstruction; - /** - * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. - */ - createRange(): Range; - /** - * Creates a text string from the specified value. - * @param data String that specifies the nodeValue property of the text node. - */ - createTextNode(data: string): Text; - createTouch(view: Window, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch; - createTouchList(...touches: Touch[]): TouchList; - /** - * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. - * @param filter A custom NodeFilter function to use. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker; - /** - * Returns the element for the specified x coordinate and the specified y coordinate. - * @param x The x-offset - * @param y The y-offset - */ - elementFromPoint(x: number, y: number): Element; - elementsFromPoint(x: number, y: number): Element[]; - evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult; - /** - * Executes a command on the current document, current selection, or the given range. - * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. - * @param showUI Display the user interface, defaults to false. - * @param value Value to assign. - */ - execCommand(commandId: string, showUI?: boolean, value?: any): boolean; - /** - * Displays help information for the given command identifier. - * @param commandId Displays help information for the given command identifier. - */ - execCommandShowHelp(commandId: string): boolean; - exitFullscreen(): void; - exitPointerLock(): void; - /** - * Causes the element to receive the focus and executes the code specified by the onfocus event. - */ - /** @deprecated */ - focus(): void; - getAnimations(): Animation[]; - /** - * Returns a reference to the first object with the specified value of the ID or NAME attribute. - * @param elementId String that specifies the ID value. Case-insensitive. - */ - getElementById(elementId: string): HTMLElement | null; - getElementsByClassName(classNames: string): HTMLCollectionOf; - /** - * Gets a collection of objects based on the value of the NAME or ID attribute. - * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. - */ - getElementsByName(elementName: string): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(tagname: K): NodeListOf; - getElementsByTagName(tagname: K): NodeListOf; - getElementsByTagName(tagname: string): NodeListOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; - getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; - /** - * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. - */ - getSelection(): Selection; - /** - * Gets a value indicating whether the object currently has focus. - */ - hasFocus(): boolean; - importNode(importedNode: T, deep: boolean): T; - msElementsFromPoint(x: number, y: number): NodeListOf; - msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf; - /** - * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. - * @param url Specifies a MIME type for the document. - * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. - * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. - * @param replace Specifies whether the existing entry for the document is replaced in the history list. - */ - open(url?: string, name?: string, features?: string, replace?: boolean): Document; - /** - * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. - * @param commandId Specifies a command identifier. - */ - queryCommandEnabled(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. - * @param commandId String that specifies a command identifier. - */ - queryCommandIndeterm(commandId: string): boolean; - /** - * Returns a Boolean value that indicates the current state of the command. - * @param commandId String that specifies a command identifier. - */ - queryCommandState(commandId: string): boolean; - /** - * Returns a Boolean value that indicates whether the current command is supported on the current range. - * @param commandId Specifies a command identifier. - */ - queryCommandSupported(commandId: string): boolean; - /** - * Retrieves the string associated with a command. - * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. - */ - queryCommandText(commandId: string): string; - /** - * Returns the current value of the document, range, or current selection for the given command. - * @param commandId String that specifies a command identifier. - */ - queryCommandValue(commandId: string): string; - /** @deprecated */ - releaseEvents(): void; - updateSettings(): void; - webkitCancelFullScreen(): void; - webkitExitFullscreen(): void; - /** - * Writes one or more HTML expressions to a document in the specified window. - * @param content Specifies the text and HTML tags to write. - */ - write(...content: string[]): void; - /** - * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. - * @param content The text and HTML tags to write. - */ - writeln(...content: string[]): void; - addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var Document: { - prototype: Document; - new(): Document; -}; - -interface DocumentEvent { + createElementNS(namespaceURI: string | null, qualifiedName: string, options?: ElementCreationOptions): Element; + createElementNS(namespace: string | null, qualifiedName: string, options?: string | ElementCreationOptions): Element; createEvent(eventInterface: "AnimationEvent"): AnimationEvent; createEvent(eventInterface: "AnimationPlaybackEvent"): AnimationPlaybackEvent; createEvent(eventInterface: "AudioProcessingEvent"): AudioProcessingEvent; @@ -4845,12 +4218,13 @@ interface DocumentEvent { createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; createEvent(eventInterface: "ListeningStateChangedEvent"): ListeningStateChangedEvent; - createEvent(eventInterface: "MSDCCEvent"): MSDCCEvent; - createEvent(eventInterface: "MSDSHEvent"): MSDSHEvent; + createEvent(eventInterface: "MSGestureEvent"): MSGestureEvent; createEvent(eventInterface: "MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; createEvent(eventInterface: "MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; + createEvent(eventInterface: "MSPointerEvent"): MSPointerEvent; createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent; createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent; + createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent; createEvent(eventInterface: "MediaStreamErrorEvent"): MediaStreamErrorEvent; createEvent(eventInterface: "MediaStreamEvent"): MediaStreamEvent; createEvent(eventInterface: "MediaStreamTrackEvent"): MediaStreamTrackEvent; @@ -4884,6 +4258,263 @@ interface DocumentEvent { createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent; createEvent(eventInterface: "ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent; + createEvent(eventInterface: "SpeechRecognitionError"): SpeechRecognitionError; + createEvent(eventInterface: "SpeechRecognitionEvent"): SpeechRecognitionEvent; + createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent; + createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent; + createEvent(eventInterface: "StorageEvent"): StorageEvent; + createEvent(eventInterface: "TextEvent"): TextEvent; + createEvent(eventInterface: "TouchEvent"): TouchEvent; + createEvent(eventInterface: "TrackEvent"): TrackEvent; + createEvent(eventInterface: "TransitionEvent"): TransitionEvent; + createEvent(eventInterface: "UIEvent"): UIEvent; + createEvent(eventInterface: "UIEvents"): UIEvent; + createEvent(eventInterface: "VRDisplayEvent"): VRDisplayEvent; + createEvent(eventInterface: "VRDisplayEvent "): VRDisplayEvent ; + createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent; + createEvent(eventInterface: "WheelEvent"): WheelEvent; + createEvent(eventInterface: string): Event; + /** + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list + * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + */ + createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter | null): NodeIterator; + /** + * Returns a ProcessingInstruction node whose target is target and data is data. + * If target does not match the Name production an + * "InvalidCharacterError" DOMException will be thrown. + * If data contains "?>" an + * "InvalidCharacterError" DOMException will be thrown. + */ + createProcessingInstruction(target: string, data: string): ProcessingInstruction; + /** + * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. + */ + createRange(): Range; + /** + * Creates a text string from the specified value. + * @param data String that specifies the nodeValue property of the text node. + */ + createTextNode(data: string): Text; + createTouch(view: WindowProxy, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch; + createTouchList(...touches: Touch[]): TouchList; + /** + * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. + * @param filter A custom NodeFilter function to use. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + */ + createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker; + /** + * Returns the element for the specified x coordinate and the specified y coordinate. + * @param x The x-offset + * @param y The y-offset + */ + elementFromPoint(x: number, y: number): Element | null; + elementsFromPoint(x: number, y: number): Element[]; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult; + /** + * Executes a command on the current document, current selection, or the given range. + * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. + * @param showUI Display the user interface, defaults to false. + * @param value Value to assign. + */ + execCommand(commandId: string, showUI?: boolean, value?: string): boolean; + getAnimations(): Animation[]; + /** + * Returns a reference to the first object with the specified value of the ID or NAME attribute. + * @param elementId String that specifies the ID value. Case-insensitive. + */ + getElementById(elementId: string): HTMLElement | null; + /** + * collection = element . getElementsByClassName(classNames) + */ + getElementsByClassName(classNames: string): HTMLCollectionOf; + /** + * Gets a collection of objects based on the value of the NAME or ID attribute. + * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. + */ + getElementsByName(elementName: string): NodeListOf; + /** + * Displays help information for the given command identifier. + * @param commandId Displays help information for the given command identifier. + */ + /** + * Retrieves a collection of objects based on the specified element name. + * @param name Specifies the name of an element. + */ + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: string): HTMLCollectionOf; + /** + * Causes the element to receive the focus and executes the code specified by the onfocus event. + */ + /** + * Retrieves the string associated with a command. + * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. + */ + /** + * Returns the current value of the document, range, or current selection for the given command. + * @param commandId String that specifies a command identifier. + */ + queryCommandValue(commandId: string): string; + /** + * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. + */ + /** + * Returns a Boolean value that indicates the current state of the command. + * @param commandId String that specifies a command identifier. + */ + queryCommandState(commandId: string): boolean; + /** @deprecated */ + releaseEvents(): void; + /** + * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. + * @param commandId String that specifies a command identifier. + */ + queryCommandIndeterm(commandId: string): boolean; + /** + * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. + * @param commandId Specifies a command identifier. + */ + queryCommandEnabled(commandId: string): boolean; + /** + * Gets a value indicating whether the object currently has focus. + */ + hasFocus(): boolean; + /** + * Returns a Boolean value that indicates whether the current command is supported on the current range. + * @param commandId Specifies a command identifier. + */ + queryCommandSupported(commandId: string): boolean; + msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf; + msElementsFromPoint(x: number, y: number): NodeListOf; + /** + * Writes one or more HTML expressions to a document in the specified window. + * @param content Specifies the text and HTML tags to write. + */ + write(...text: string[]): void; + /** + * If namespace and localName are + * "*" returns a HTMLCollection of all descendant elements. + * If only namespace is "*" returns a HTMLCollection of all descendant elements whose local name is localName. + * If only localName is "*" returns a HTMLCollection of all descendant elements whose namespace is namespace. + * Otherwise, returns a HTMLCollection of all descendant elements whose namespace is namespace and local name is localName. + */ + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; + /** + * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. + * @param url Specifies a MIME type for the document. + * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. + * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. + * @param replace Specifies whether the existing entry for the document is replaced in the history list. + */ + open(url?: string, name?: string, features?: string, replace?: boolean): Document; + importNode(importedNode: T, deep: boolean): T; + /** + * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. + * @param content The text and HTML tags to write. + */ + writeln(...text: string[]): void; + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var Document: { + prototype: Document; + new(): Document; +}; + +interface DocumentAndElementEventHandlersEventMap { + "copy": ClipboardEvent; + "cut": ClipboardEvent; + "paste": ClipboardEvent; +} + +interface DocumentAndElementEventHandlers { + oncopy: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null; + oncut: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null; + onpaste: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null; + addEventListener(type: K, listener: (this: DocumentAndElementEventHandlers, ev: DocumentAndElementEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: DocumentAndElementEventHandlers, ev: DocumentAndElementEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +interface DocumentEvent { + createEvent(eventInterface: "AnimationEvent"): AnimationEvent; + createEvent(eventInterface: "AnimationPlaybackEvent"): AnimationPlaybackEvent; + createEvent(eventInterface: "AudioProcessingEvent"): AudioProcessingEvent; + createEvent(eventInterface: "BeforeUnloadEvent"): BeforeUnloadEvent; + createEvent(eventInterface: "ClipboardEvent"): ClipboardEvent; + createEvent(eventInterface: "CloseEvent"): CloseEvent; + createEvent(eventInterface: "CompositionEvent"): CompositionEvent; + createEvent(eventInterface: "CustomEvent"): CustomEvent; + createEvent(eventInterface: "DeviceLightEvent"): DeviceLightEvent; + createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent; + createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent; + createEvent(eventInterface: "DragEvent"): DragEvent; + createEvent(eventInterface: "ErrorEvent"): ErrorEvent; + createEvent(eventInterface: "Event"): Event; + createEvent(eventInterface: "Events"): Event; + createEvent(eventInterface: "FocusEvent"): FocusEvent; + createEvent(eventInterface: "FocusNavigationEvent"): FocusNavigationEvent; + createEvent(eventInterface: "GamepadEvent"): GamepadEvent; + createEvent(eventInterface: "HashChangeEvent"): HashChangeEvent; + createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; + createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; + createEvent(eventInterface: "ListeningStateChangedEvent"): ListeningStateChangedEvent; + createEvent(eventInterface: "MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface: "MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; + createEvent(eventInterface: "MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; + createEvent(eventInterface: "MSPointerEvent"): MSPointerEvent; + createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent; + createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent; + createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent; + createEvent(eventInterface: "MediaStreamErrorEvent"): MediaStreamErrorEvent; + createEvent(eventInterface: "MediaStreamEvent"): MediaStreamEvent; + createEvent(eventInterface: "MediaStreamTrackEvent"): MediaStreamTrackEvent; + createEvent(eventInterface: "MessageEvent"): MessageEvent; + createEvent(eventInterface: "MouseEvent"): MouseEvent; + createEvent(eventInterface: "MouseEvents"): MouseEvent; + createEvent(eventInterface: "MutationEvent"): MutationEvent; + createEvent(eventInterface: "MutationEvents"): MutationEvent; + createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; + createEvent(eventInterface: "OverflowEvent"): OverflowEvent; + createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface: "PaymentRequestUpdateEvent"): PaymentRequestUpdateEvent; + createEvent(eventInterface: "PermissionRequestedEvent"): PermissionRequestedEvent; + createEvent(eventInterface: "PointerEvent"): PointerEvent; + createEvent(eventInterface: "PopStateEvent"): PopStateEvent; + createEvent(eventInterface: "ProgressEvent"): ProgressEvent; + createEvent(eventInterface: "PromiseRejectionEvent"): PromiseRejectionEvent; + createEvent(eventInterface: "RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent; + createEvent(eventInterface: "RTCDataChannelEvent"): RTCDataChannelEvent; + createEvent(eventInterface: "RTCDtlsTransportStateChangedEvent"): RTCDtlsTransportStateChangedEvent; + createEvent(eventInterface: "RTCErrorEvent"): RTCErrorEvent; + createEvent(eventInterface: "RTCIceCandidatePairChangedEvent"): RTCIceCandidatePairChangedEvent; + createEvent(eventInterface: "RTCIceGathererEvent"): RTCIceGathererEvent; + createEvent(eventInterface: "RTCIceTransportStateChangedEvent"): RTCIceTransportStateChangedEvent; + createEvent(eventInterface: "RTCPeerConnectionIceErrorEvent"): RTCPeerConnectionIceErrorEvent; + createEvent(eventInterface: "RTCPeerConnectionIceEvent"): RTCPeerConnectionIceEvent; + createEvent(eventInterface: "RTCSsrcConflictEvent"): RTCSsrcConflictEvent; + createEvent(eventInterface: "RTCStatsEvent"): RTCStatsEvent; + createEvent(eventInterface: "RTCTrackEvent"): RTCTrackEvent; + createEvent(eventInterface: "SVGZoomEvent"): SVGZoomEvent; + createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; + createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent; + createEvent(eventInterface: "ServiceWorkerMessageEvent"): ServiceWorkerMessageEvent; + createEvent(eventInterface: "SpeechRecognitionError"): SpeechRecognitionError; + createEvent(eventInterface: "SpeechRecognitionEvent"): SpeechRecognitionEvent; + createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent; createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent; createEvent(eventInterface: "StorageEvent"): StorageEvent; createEvent(eventInterface: "TextEvent"): TextEvent; @@ -4899,7 +4530,7 @@ interface DocumentEvent { createEvent(eventInterface: string): Event; } -interface DocumentFragment extends Node, ParentNode { +interface DocumentFragment extends Node, NonElementParentNode, ParentNode { getElementById(elementId: string): HTMLElement | null; } @@ -4910,6 +4541,9 @@ declare var DocumentFragment: { interface DocumentOrShadowRoot { readonly activeElement: Element | null; + /** + * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. + */ readonly styleSheets: StyleSheetList; elementFromPoint(x: number, y: number): Element | null; elementsFromPoint(x: number, y: number): Element[]; @@ -4925,10 +4559,7 @@ declare var DocumentTimeline: { }; interface DocumentType extends Node, ChildNode { - readonly entities: NamedNodeMap; - readonly internalSubset: string | null; readonly name: string; - readonly notations: NamedNodeMap; readonly publicId: string; readonly systemId: string; } @@ -4939,14 +4570,15 @@ declare var DocumentType: { }; interface DragEvent extends MouseEvent { - readonly dataTransfer: DataTransfer; - initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; - msConvertURL(file: File, targetType: string, targetURL?: string): void; + /** + * Returns the DataTransfer object for the event. + */ + readonly dataTransfer: DataTransfer | null; } declare var DragEvent: { prototype: DragEvent; - new(type: "drag" | "dragend" | "dragenter" | "dragexit" | "dragleave" | "dragover" | "dragstart" | "drop", dragEventInit?: { dataTransfer?: DataTransfer }): DragEvent; + new(type: string, eventInitDict?: DragEventInit): DragEvent; }; interface DynamicsCompressorNode extends AudioNode { @@ -4993,116 +4625,123 @@ declare var EXT_texture_filter_anisotropic: { readonly TEXTURE_MAX_ANISOTROPY_EXT: number; }; -interface ElementEventMap extends GlobalEventHandlersEventMap { - "ariarequest": Event; - "command": Event; - "gotpointercapture": PointerEvent; - "lostpointercapture": PointerEvent; - "MSGestureChange": Event; - "MSGestureDoubleTap": Event; - "MSGestureEnd": Event; - "MSGestureHold": Event; - "MSGestureStart": Event; - "MSGestureTap": Event; - "MSGotPointerCapture": Event; - "MSInertiaStart": Event; - "MSLostPointerCapture": Event; - "MSPointerCancel": Event; - "MSPointerDown": Event; - "MSPointerEnter": Event; - "MSPointerLeave": Event; - "MSPointerMove": Event; - "MSPointerOut": Event; - "MSPointerOver": Event; - "MSPointerUp": Event; - "touchcancel": TouchEvent; - "touchend": TouchEvent; - "touchmove": TouchEvent; - "touchstart": TouchEvent; - "webkitfullscreenchange": Event; - "webkitfullscreenerror": Event; -} - -interface Element extends Node, GlobalEventHandlers, ElementTraversal, ParentNode, ChildNode, Animatable { +interface Element extends Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slotable, Animatable { readonly assignedSlot: HTMLSlotElement | null; readonly attributes: NamedNodeMap; + /** + * Allows for manipulation of element's class content attribute as a + * set of whitespace-separated tokens through a DOMTokenList object. + */ readonly classList: DOMTokenList; + /** + * Returns the value of element's class content attribute. Can be set + * to change it. + */ className: string; readonly clientHeight: number; readonly clientLeft: number; readonly clientTop: number; readonly clientWidth: number; + /** + * Returns the value of element's id content attribute. Can be set to + * change it. + */ id: string; - innerHTML: string; - msContentZoomFactor: number; - readonly msRegionOverflow: string; - onariarequest: ((this: Element, ev: Event) => any) | null; - oncommand: ((this: Element, ev: Event) => any) | null; - onmsgesturechange: ((this: Element, ev: Event) => any) | null; - onmsgesturedoubletap: ((this: Element, ev: Event) => any) | null; - onmsgestureend: ((this: Element, ev: Event) => any) | null; - onmsgesturehold: ((this: Element, ev: Event) => any) | null; - onmsgesturestart: ((this: Element, ev: Event) => any) | null; - onmsgesturetap: ((this: Element, ev: Event) => any) | null; - onmsgotpointercapture: ((this: Element, ev: Event) => any) | null; - onmsinertiastart: ((this: Element, ev: Event) => any) | null; - onmslostpointercapture: ((this: Element, ev: Event) => any) | null; - onmspointercancel: ((this: Element, ev: Event) => any) | null; - onmspointerdown: ((this: Element, ev: Event) => any) | null; - onmspointerenter: ((this: Element, ev: Event) => any) | null; - onmspointerleave: ((this: Element, ev: Event) => any) | null; - onmspointermove: ((this: Element, ev: Event) => any) | null; - onmspointerout: ((this: Element, ev: Event) => any) | null; - onmspointerover: ((this: Element, ev: Event) => any) | null; - onmspointerup: ((this: Element, ev: Event) => any) | null; - onwebkitfullscreenchange: ((this: Element, ev: Event) => any) | null; - onwebkitfullscreenerror: ((this: Element, ev: Event) => any) | null; - outerHTML: string; + /** + * Returns the local name. + */ + readonly localName: string; + /** + * Returns the namespace. + */ + readonly namespaceURI: string | null; + /** + * Returns the namespace prefix. + */ readonly prefix: string | null; readonly scrollHeight: number; scrollLeft: number; scrollTop: number; readonly scrollWidth: number; + /** + * Returns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise. + */ readonly shadowRoot: ShadowRoot | null; + /** + * Returns the value of element's slot content attribute. Can be set to + * change it. + */ slot: string; + /** + * Returns the HTML-uppercased qualified name. + */ readonly tagName: string; + /** + * Creates a shadow root for element and returns it. + */ attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot; + /** + * Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. + */ closest(selector: K): HTMLElementTagNameMap[K] | null; closest(selector: K): SVGElementTagNameMap[K] | null; closest(selector: string): Element | null; + /** + * Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. + */ getAttribute(qualifiedName: string): string | null; - getAttributeNS(namespaceURI: string, localName: string): string; + /** + * Returns element's attribute whose namespace is namespace and local name is localName, and null if there is + * no such attribute otherwise. + */ + getAttributeNS(namespace: string | null, localName: string): string | null; + /** + * Returns the qualified names of all element's attributes. + * Can contain duplicates. + */ + getAttributeNames(): string[]; getAttributeNode(name: string): Attr | null; getAttributeNodeNS(namespaceURI: string, localName: string): Attr | null; getBoundingClientRect(): ClientRect | DOMRect; getClientRects(): ClientRectList | DOMRectList; getElementsByClassName(classNames: string): NodeListOf; - getElementsByTagName(name: K): NodeListOf; - getElementsByTagName(name: K): NodeListOf; - getElementsByTagName(name: string): NodeListOf; + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: string): HTMLCollectionOf; getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf; - hasAttribute(name: string): boolean; - hasAttributeNS(namespaceURI: string, localName: string): boolean; + /** + * Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. + */ + hasAttribute(qualifiedName: string): boolean; + /** + * Returns true if element has an attribute whose namespace is namespace and local name is localName. + */ + hasAttributeNS(namespace: string | null, localName: string): boolean; + /** + * Returns true if element has attributes, and false otherwise. + */ hasAttributes(): boolean; hasPointerCapture(pointerId: number): boolean; insertAdjacentElement(position: InsertPosition, insertedElement: Element): Element | null; insertAdjacentHTML(where: InsertPosition, html: string): void; insertAdjacentText(where: InsertPosition, text: string): void; + /** + * Returns true if matching selectors against element's root yields element, and false otherwise. + */ matches(selectors: string): boolean; msGetRegionContent(): any; - msGetUntransformedBounds(): ClientRect; - msMatchesSelector(selectors: string): boolean; - msReleasePointerCapture(pointerId: number): void; - msSetPointerCapture(pointerId: number): void; - msZoomTo(args: MsZoomToOptions): void; releasePointerCapture(pointerId: number): void; + /** + * Removes element's first attribute whose qualified name is qualifiedName. + */ removeAttribute(qualifiedName: string): void; - removeAttributeNS(namespaceURI: string, localName: string): void; - removeAttributeNode(oldAttr: Attr): Attr; - requestFullscreen(): void; - requestPointerLock(): void; + /** + * Removes element's attribute whose namespace is namespace and local name is localName. + */ + removeAttributeNS(namespace: string | null, localName: string): void; + removeAttributeNode(attr: Attr): Attr; scroll(options?: ScrollToOptions): void; scroll(x: number, y: number): void; scrollBy(options?: ScrollToOptions): void; @@ -5110,18 +4749,24 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, ParentNod scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void; scrollTo(options?: ScrollToOptions): void; scrollTo(x: number, y: number): void; + /** + * Sets the value of element's first attribute whose qualified name is qualifiedName to value. + */ setAttribute(qualifiedName: string, value: string): void; - setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; - setAttributeNode(newAttr: Attr): Attr; - setAttributeNodeNS(newAttr: Attr): Attr; + /** + * Sets the value of element's attribute whose namespace is namespace and local name is localName to value. + */ + setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void; + setAttributeNode(attr: Attr): Attr | null; + setAttributeNodeNS(attr: Attr): Attr | null; setPointerCapture(pointerId: number): void; + /** + * If force is not given, "toggles" qualifiedName, removing it if it is + * present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName. + * Returns true if qualifiedName is now present, and false otherwise. + */ + toggleAttribute(qualifiedName: string, force?: boolean): boolean; webkitMatchesSelector(selectors: string): boolean; - webkitRequestFullScreen(): void; - webkitRequestFullscreen(): void; - addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var Element: { @@ -5129,58 +4774,80 @@ declare var Element: { new(): Element; }; -interface ElementCSSInlineStyle { - readonly style: CSSStyleDeclaration; +interface ElementContentEditable { + contentEditable: string; + inputMode: string; + readonly isContentEditable: boolean; } interface ElementCreationOptions { is?: string; } -interface ElementDefinitionOptions { - extends: string; -} - -interface ElementTraversal { - readonly childElementCount: number; - readonly firstElementChild: Element | null; - readonly lastElementChild: Element | null; - readonly nextElementSibling: Element | null; - readonly previousElementSibling: Element | null; -} - interface ErrorEvent extends Event { readonly colno: number; readonly error: any; readonly filename: string; readonly lineno: number; readonly message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; } declare var ErrorEvent: { prototype: ErrorEvent; - new(typeArg: string, eventInitDict?: ErrorEventInit): ErrorEvent; + new(type: string, eventInitDict?: ErrorEventInit): ErrorEvent; }; interface Event { + /** + * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. + */ readonly bubbles: boolean; cancelBubble: boolean; readonly cancelable: boolean; + /** + * Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. + */ readonly composed: boolean; + /** + * Returns the object whose event listener's callback is currently being + * invoked. + */ readonly currentTarget: EventTarget | null; readonly defaultPrevented: boolean; readonly eventPhase: number; + /** + * Returns true if event was dispatched by the user agent, and + * false otherwise. + */ readonly isTrusted: boolean; returnValue: boolean; - readonly srcElement: Element | null; + /** + * Returns the object to which event is dispatched (its target). + */ readonly target: EventTarget | null; + /** + * Returns the event's timestamp as the number of milliseconds measured relative to + * the time origin. + */ readonly timeStamp: number; + /** + * Returns the type of event, e.g. + * "click", "hashchange", or + * "submit". + */ readonly type: string; - deepPath(): EventTarget[]; + composedPath(): EventTarget[]; initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void; preventDefault(): void; + /** + * Invoking this method prevents event from reaching + * any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any + * other objects. + */ stopImmediatePropagation(): void; + /** + * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. + */ stopPropagation(): void; readonly AT_TARGET: number; readonly BUBBLING_PHASE: number; @@ -5190,7 +4857,7 @@ interface Event { declare var Event: { prototype: Event; - new(typeArg: string, eventInitDict?: EventInit): Event; + new(type: string, eventInitDict?: EventInit): Event; readonly AT_TARGET: number; readonly BUBBLING_PHASE: number; readonly CAPTURING_PHASE: number; @@ -5224,9 +4891,26 @@ interface EventSourceInit { } interface EventTarget { + /** + * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched. + * The options argument sets listener-specific options. For compatibility this can be a + * boolean, in which case the method behaves exactly as if the value was specified as options's capture. + * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET. + * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in §2.8 Observing event listeners. + * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will + * be removed. + * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. + */ addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void; - dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; + /** + * Dispatches a synthetic event event to target and returns true + * if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. + */ + dispatchEvent(event: Event): boolean; + /** + * Removes the event listener in target's event listener list with the same type, callback, and options. + */ + removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; } declare var EventTarget: { @@ -5444,12 +5128,57 @@ interface GetSVGDocument { } interface GlobalEventHandlersEventMap { + "abort": UIEvent; "animationcancel": AnimationEvent; "animationend": AnimationEvent; "animationiteration": AnimationEvent; "animationstart": AnimationEvent; + "auxclick": Event; + "blur": FocusEvent; + "cancel": Event; + "canplay": Event; + "canplaythrough": Event; + "change": Event; + "click": MouseEvent; + "close": Event; + "contextmenu": MouseEvent; + "cuechange": Event; + "dblclick": MouseEvent; + "drag": DragEvent; + "dragend": DragEvent; + "dragenter": DragEvent; + "dragexit": Event; + "dragleave": DragEvent; + "dragover": DragEvent; + "dragstart": DragEvent; + "drop": DragEvent; + "durationchange": Event; + "emptied": Event; + "ended": Event; + "error": ErrorEvent; + "focus": FocusEvent; "gotpointercapture": PointerEvent; + "input": Event; + "invalid": Event; + "keydown": KeyboardEvent; + "keypress": KeyboardEvent; + "keyup": KeyboardEvent; + "load": Event; + "loadeddata": Event; + "loadedmetadata": Event; + "loadend": ProgressEvent; + "loadstart": Event; "lostpointercapture": PointerEvent; + "mousedown": MouseEvent; + "mouseenter": MouseEvent; + "mouseleave": MouseEvent; + "mousemove": MouseEvent; + "mouseout": MouseEvent; + "mouseover": MouseEvent; + "mouseup": MouseEvent; + "pause": Event; + "play": Event; + "playing": Event; "pointercancel": PointerEvent; "pointerdown": PointerEvent; "pointerenter": PointerEvent; @@ -5458,6 +5187,20 @@ interface GlobalEventHandlersEventMap { "pointerout": PointerEvent; "pointerover": PointerEvent; "pointerup": PointerEvent; + "progress": ProgressEvent; + "ratechange": Event; + "reset": Event; + "resize": UIEvent; + "scroll": UIEvent; + "securitypolicyviolation": SecurityPolicyViolationEvent; + "seeked": Event; + "seeking": Event; + "select": UIEvent; + "stalled": Event; + "submit": Event; + "suspend": Event; + "timeupdate": Event; + "toggle": Event; "touchcancel": TouchEvent; "touchend": TouchEvent; "touchmove": TouchEvent; @@ -5466,16 +5209,195 @@ interface GlobalEventHandlersEventMap { "transitionend": TransitionEvent; "transitionrun": TransitionEvent; "transitionstart": TransitionEvent; + "volumechange": Event; + "waiting": Event; "wheel": WheelEvent; } interface GlobalEventHandlers { + /** + * Fires when the user aborts the download. + * @param ev The event. + */ + onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; + onauxclick: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the object loses the input focus. + * @param ev The focus event. + */ + onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null; + oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when playback is possible, but would require further buffering. + * @param ev The event. + */ + oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null; + oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the contents of the object or selection have changed. + * @param ev The event. + */ + onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. + */ + onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. + */ + oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user double-clicks the object. + * @param ev The mouse event. + */ + ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires on the source object continuously during a drag operation. + * @param ev The event. + */ + ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the source object when the user releases the mouse at the close of a drag operation. + * @param ev The event. + */ + ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. + */ + ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + ondragexit: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. + */ + ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. + */ + ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. + */ + ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Occurs when the duration attribute is updated. + * @param ev The event. + */ + ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the media element is reset to its initial state. + * @param ev The event. + */ + onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the end of playback is reached. + * @param ev The event + */ + onended: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when an error occurs during object loading. + * @param ev The event. + */ + onerror: ((this: GlobalEventHandlers, ev: ErrorEvent) => any) | null; + /** + * Fires when the object receives focus. + * @param ev The event. + */ + onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null; ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null; + oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user presses a key. + * @param ev The keyboard event + */ + onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; + /** + * Fires when the user presses an alphanumeric key. + * @param ev The event. + */ + onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; + /** + * Fires when the user releases a key. + * @param ev The keyboard event + */ + onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; + /** + * Fires immediately after the browser loads the object. + * @param ev The event. + */ + onload: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. + */ + onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. + */ + onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null; + onloadend: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null; + /** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. + */ + onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. + */ + onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. + */ + onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. + */ + onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. + */ + onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. + */ + onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Occurs when playback is paused. + * @param ev The event. + */ + onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the play method is requested. + * @param ev The event. + */ + onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the audio or video has started playing. + * @param ev The event. + */ + onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null; onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; @@ -5484,6 +5406,60 @@ interface GlobalEventHandlers { onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** + * Occurs to indicate progress while downloading media data. + * @param ev The event. + */ + onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null; + /** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. + */ + onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user resets a form. + * @param ev The event. + */ + onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null; + onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; + /** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. + */ + onscroll: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; + onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null; + /** + * Occurs when the seek operation ends. + * @param ev The event. + */ + onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the current playback position is moved. + * @param ev The event. + */ + onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the current selection changes. + * @param ev The event. + */ + onselect: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; + /** + * Occurs when the download has stopped. + * @param ev The event. + */ + onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null; + onsubmit: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs if the load operation has been intentionally halted. + * @param ev The event. + */ + onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs to indicate the current playback position. + * @param ev The event. + */ + ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null; + ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null; ontouchcancel: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null; ontouchend: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null; ontouchmove: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null; @@ -5492,6 +5468,16 @@ interface GlobalEventHandlers { ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; + /** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. + */ + onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. + */ + onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null; onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null; addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; @@ -5500,7 +5486,7 @@ interface GlobalEventHandlers { } interface GlobalFetch { - fetch(input?: Request | string, init?: RequestInit): Promise; + fetch(input: RequestInfo, init?: RequestInit): Promise; } interface HTMLAllCollection { @@ -5525,7 +5511,6 @@ declare var HTMLAllCollection: { }; interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils { - Methods: string; /** * Sets or retrieves the character set used to encode the object. */ @@ -5541,14 +5526,13 @@ interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils { * Sets or retrieves the language code of the object. */ hreflang: string; - readonly mimeType: string; /** * Sets or retrieves the shape of the object. */ /** @deprecated */ name: string; - readonly nameProp: string; - readonly protocolLong: string; + ping: string; + referrerPolicy: string; /** * Sets or retrieves the relationship between the object and the destination of the link. */ @@ -5573,7 +5557,6 @@ interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils { */ text: string; type: string; - urn: string; addEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -5650,6 +5633,8 @@ interface HTMLAreaElement extends HTMLElement, HTMLHyperlinkElementUtils { */ /** @deprecated */ noHref: boolean; + ping: string; + referrerPolicy: string; rel: string; readonly relList: DOMTokenList; /** @@ -5671,14 +5656,6 @@ declare var HTMLAreaElement: { new(): HTMLAreaElement; }; -interface HTMLAreasCollection extends HTMLCollectionBase { -} - -declare var HTMLAreasCollection: { - prototype: HTMLAreasCollection; - new(): HTMLAreasCollection; -}; - interface HTMLAudioElement extends HTMLMediaElement { addEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; @@ -5751,13 +5728,7 @@ declare var HTMLBaseFontElement: { }; interface HTMLBodyElementEventMap extends HTMLElementEventMap, WindowEventHandlersEventMap { - "blur": FocusEvent; - "error": ErrorEvent; - "focus": FocusEvent; - "load": Event; "orientationchange": Event; - "resize": UIEvent; - "scroll": UIEvent; } interface HTMLBodyElement extends HTMLElement, WindowEventHandlers { @@ -5772,8 +5743,8 @@ interface HTMLBodyElement extends HTMLElement, WindowEventHandlers { link: string; /** @deprecated */ noWrap: boolean; + /** @deprecated */ onorientationchange: ((this: HTMLBodyElement, ev: Event) => any) | null; - onresize: ((this: HTMLBodyElement, ev: UIEvent) => any) | null; /** @deprecated */ text: string; /** @deprecated */ @@ -5878,19 +5849,15 @@ interface HTMLCanvasElement extends HTMLElement { * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); */ - getContext(contextId: "2d", contextAttributes?: Canvas2DContextAttributes): CanvasRenderingContext2D | null; + getContext(contextId: "2d", contextAttributes?: CanvasRenderingContext2DSettings): CanvasRenderingContext2D | null; getContext(contextId: "webgl" | "experimental-webgl", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null; getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null; - /** - * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. - */ - msToBlob(): Blob; - toBlob(callback: (result: Blob | null) => void, type?: string, ...arguments: any[]): void; + toBlob(callback: BlobCallback, type?: string, quality?: any): void; /** * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. */ - toDataURL(type?: string, ...args: any[]): string; + toDataURL(type?: string, quality?: any): string; addEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -5910,7 +5877,7 @@ interface HTMLCollectionBase { /** * Retrieves an object from various collections. */ - item(index: number): Element; + item(index: number): Element | null; [index: number]: Element; } @@ -5927,9 +5894,8 @@ declare var HTMLCollection: { }; interface HTMLCollectionOf extends HTMLCollectionBase { - item(index: number): T; - namedItem(name: string): T; - forEach(callbackfn: (value: T, key: number, parent: HTMLCollectionOf) => void, thisArg?: any): void; + item(index: number): T | null; + namedItem(name: string): T | null; [index: number]: T; } @@ -6023,10 +5989,6 @@ interface HTMLDivElement extends HTMLElement { */ /** @deprecated */ align: string; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; addEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -6050,168 +6012,27 @@ declare var HTMLDocument: { new(): HTMLDocument; }; -interface HTMLElementEventMap extends ElementEventMap { - "abort": UIEvent; - "activate": Event; - "beforeactivate": Event; - "beforecopy": Event; - "beforecut": Event; - "beforedeactivate": Event; - "beforepaste": Event; - "blur": FocusEvent; - "canplay": Event; - "canplaythrough": Event; - "change": Event; - "click": MouseEvent; - "contextmenu": PointerEvent; - "copy": ClipboardEvent; - "cuechange": Event; - "cut": ClipboardEvent; - "dblclick": MouseEvent; - "deactivate": Event; - "drag": DragEvent; - "dragend": DragEvent; - "dragenter": DragEvent; - "dragleave": DragEvent; - "dragover": DragEvent; - "dragstart": DragEvent; - "drop": DragEvent; - "durationchange": Event; - "emptied": Event; - "ended": Event; - "error": ErrorEvent; - "focus": FocusEvent; - "input": Event; - "invalid": Event; - "keydown": KeyboardEvent; - "keypress": KeyboardEvent; - "keyup": KeyboardEvent; - "load": Event; - "loadeddata": Event; - "loadedmetadata": Event; - "loadstart": Event; - "mousedown": MouseEvent; - "mouseenter": MouseEvent; - "mouseleave": MouseEvent; - "mousemove": MouseEvent; - "mouseout": MouseEvent; - "mouseover": MouseEvent; - "mouseup": MouseEvent; - "mousewheel": WheelEvent; - "MSContentZoom": Event; - "MSManipulationStateChanged": Event; - "paste": ClipboardEvent; - "pause": Event; - "play": Event; - "playing": Event; - "progress": ProgressEvent; - "ratechange": Event; - "reset": Event; - "scroll": UIEvent; - "seeked": Event; - "seeking": Event; - "select": UIEvent; - "selectstart": Event; - "stalled": Event; - "submit": Event; - "suspend": Event; - "timeupdate": Event; - "volumechange": Event; - "waiting": Event; +interface HTMLElementEventMap extends GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap { } -interface HTMLElement extends Element, ElementCSSInlineStyle { +interface HTMLElement extends Element, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement { accessKey: string; - contentEditable: string; - readonly dataset: DOMStringMap; + readonly accessKeyLabel: string; + autocapitalize: string; dir: string; draggable: boolean; hidden: boolean; - hideFocus: boolean; innerText: string; - readonly isContentEditable: boolean; lang: string; readonly offsetHeight: number; readonly offsetLeft: number; - readonly offsetParent: Element; + readonly offsetParent: Element | null; readonly offsetTop: number; readonly offsetWidth: number; - onabort: ((this: HTMLElement, ev: UIEvent) => any) | null; - onactivate: ((this: HTMLElement, ev: Event) => any) | null; - onbeforeactivate: ((this: HTMLElement, ev: Event) => any) | null; - onbeforecopy: ((this: HTMLElement, ev: Event) => any) | null; - onbeforecut: ((this: HTMLElement, ev: Event) => any) | null; - onbeforedeactivate: ((this: HTMLElement, ev: Event) => any) | null; - onbeforepaste: ((this: HTMLElement, ev: Event) => any) | null; - onblur: ((this: HTMLElement, ev: FocusEvent) => any) | null; - oncanplay: ((this: HTMLElement, ev: Event) => any) | null; - oncanplaythrough: ((this: HTMLElement, ev: Event) => any) | null; - onchange: ((this: HTMLElement, ev: Event) => any) | null; - onclick: ((this: HTMLElement, ev: MouseEvent) => any) | null; - oncontextmenu: ((this: HTMLElement, ev: PointerEvent) => any) | null; - oncopy: ((this: HTMLElement, ev: ClipboardEvent) => any) | null; - oncuechange: ((this: HTMLElement, ev: Event) => any) | null; - oncut: ((this: HTMLElement, ev: ClipboardEvent) => any) | null; - ondblclick: ((this: HTMLElement, ev: MouseEvent) => any) | null; - ondeactivate: ((this: HTMLElement, ev: Event) => any) | null; - ondrag: ((this: HTMLElement, ev: DragEvent) => any) | null; - ondragend: ((this: HTMLElement, ev: DragEvent) => any) | null; - ondragenter: ((this: HTMLElement, ev: DragEvent) => any) | null; - ondragleave: ((this: HTMLElement, ev: DragEvent) => any) | null; - ondragover: ((this: HTMLElement, ev: DragEvent) => any) | null; - ondragstart: ((this: HTMLElement, ev: DragEvent) => any) | null; - ondrop: ((this: HTMLElement, ev: DragEvent) => any) | null; - ondurationchange: ((this: HTMLElement, ev: Event) => any) | null; - onemptied: ((this: HTMLElement, ev: Event) => any) | null; - onended: ((this: HTMLElement, ev: Event) => any) | null; - onerror: ((this: HTMLElement, ev: ErrorEvent) => any) | null; - onfocus: ((this: HTMLElement, ev: FocusEvent) => any) | null; - oninput: ((this: HTMLElement, ev: Event) => any) | null; - oninvalid: ((this: HTMLElement, ev: Event) => any) | null; - onkeydown: ((this: HTMLElement, ev: KeyboardEvent) => any) | null; - onkeypress: ((this: HTMLElement, ev: KeyboardEvent) => any) | null; - onkeyup: ((this: HTMLElement, ev: KeyboardEvent) => any) | null; - onload: ((this: HTMLElement, ev: Event) => any) | null; - onloadeddata: ((this: HTMLElement, ev: Event) => any) | null; - onloadedmetadata: ((this: HTMLElement, ev: Event) => any) | null; - onloadstart: ((this: HTMLElement, ev: Event) => any) | null; - onmousedown: ((this: HTMLElement, ev: MouseEvent) => any) | null; - onmouseenter: ((this: HTMLElement, ev: MouseEvent) => any) | null; - onmouseleave: ((this: HTMLElement, ev: MouseEvent) => any) | null; - onmousemove: ((this: HTMLElement, ev: MouseEvent) => any) | null; - onmouseout: ((this: HTMLElement, ev: MouseEvent) => any) | null; - onmouseover: ((this: HTMLElement, ev: MouseEvent) => any) | null; - onmouseup: ((this: HTMLElement, ev: MouseEvent) => any) | null; - onmousewheel: ((this: HTMLElement, ev: WheelEvent) => any) | null; - onmscontentzoom: ((this: HTMLElement, ev: Event) => any) | null; - onmsmanipulationstatechanged: ((this: HTMLElement, ev: Event) => any) | null; - onpaste: ((this: HTMLElement, ev: ClipboardEvent) => any) | null; - onpause: ((this: HTMLElement, ev: Event) => any) | null; - onplay: ((this: HTMLElement, ev: Event) => any) | null; - onplaying: ((this: HTMLElement, ev: Event) => any) | null; - onprogress: ((this: HTMLElement, ev: ProgressEvent) => any) | null; - onratechange: ((this: HTMLElement, ev: Event) => any) | null; - onreset: ((this: HTMLElement, ev: Event) => any) | null; - onscroll: ((this: HTMLElement, ev: UIEvent) => any) | null; - onseeked: ((this: HTMLElement, ev: Event) => any) | null; - onseeking: ((this: HTMLElement, ev: Event) => any) | null; - onselect: ((this: HTMLElement, ev: UIEvent) => any) | null; - onselectstart: ((this: HTMLElement, ev: Event) => any) | null; - onstalled: ((this: HTMLElement, ev: Event) => any) | null; - onsubmit: ((this: HTMLElement, ev: Event) => any) | null; - onsuspend: ((this: HTMLElement, ev: Event) => any) | null; - ontimeupdate: ((this: HTMLElement, ev: Event) => any) | null; - onvolumechange: ((this: HTMLElement, ev: Event) => any) | null; - onwaiting: ((this: HTMLElement, ev: Event) => any) | null; - outerText: string; spellcheck: boolean; - tabIndex: number; title: string; - blur(): void; + translate: boolean; click(): void; - dragDrop(): boolean; - focus(): void; - msGetInputContext(): MSInputMethodContext; addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -6408,16 +6229,6 @@ interface HTMLFormElement extends HTMLElement { * Returns whether a form will validate when it is submitted, without having to submit it. */ checkValidity(): boolean; - /** - * Retrieves a form object or an object from an elements collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Retrieves a form object or an object from an elements collection. - */ - namedItem(name: string): any; reportValidity(): boolean; /** * Fires when the user resets a form. @@ -6431,7 +6242,7 @@ interface HTMLFormElement extends HTMLElement { addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; - [name: string]: any; + [index: number]: Element; } declare var HTMLFormElement: { @@ -6449,7 +6260,7 @@ interface HTMLFrameElement extends HTMLElement { * Retrieves the object of the specified. */ /** @deprecated */ - readonly contentWindow: Window | null; + readonly contentWindow: WindowProxy | null; /** * Sets or retrieves whether to display a border for the frame. */ @@ -6501,6 +6312,9 @@ declare var HTMLFrameElement: { new(): HTMLFrameElement; }; +interface HTMLFrameSetElementEventMap extends HTMLElementEventMap, WindowEventHandlersEventMap { +} + interface HTMLFrameSetElement extends HTMLElement, WindowEventHandlers { /** * Sets or retrieves the frame widths of the object. @@ -6512,11 +6326,9 @@ interface HTMLFrameSetElement extends HTMLElement, WindowEventHandlers { */ /** @deprecated */ rows: string; - addEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: WindowEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: WindowEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } @@ -6557,8 +6369,6 @@ declare var HTMLHRElement: { }; interface HTMLHeadElement extends HTMLElement { - /** @deprecated */ - profile: string; addEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -6609,16 +6419,13 @@ interface HTMLHyperlinkElementUtils { host: string; hostname: string; href: string; - origin: string; + readonly origin: string; + password: string; pathname: string; port: string; protocol: string; search: string; - toString(): string; -} - -interface HTMLIFrameElementEventMap extends HTMLElementEventMap { - "load": Event; + username: string; } interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { @@ -6683,9 +6490,9 @@ interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { * Sets or retrieves the width of the object. */ width: string; - addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } @@ -6736,19 +6543,6 @@ interface HTMLImageElement extends HTMLElement { longDesc: string; /** @deprecated */ lowsrc: string; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - readonly msPlayToSource: any; /** * Sets or retrieves the name of the object. */ @@ -6762,6 +6556,7 @@ interface HTMLImageElement extends HTMLElement { * The original width of the image resource before sizing. */ readonly naturalWidth: number; + referrerPolicy: string; sizes: string; /** * The address or URL of the a media resource that is to be considered. @@ -6783,7 +6578,7 @@ interface HTMLImageElement extends HTMLElement { width: number; readonly x: number; readonly y: number; - msGetAsCastingSource(): any; + decode(): Promise; addEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -6829,6 +6624,7 @@ interface HTMLInputElement extends HTMLElement { * Sets or retrieves the initial contents of the object. */ defaultValue: string; + dirName: string; disabled: boolean; /** * Returns a FileList object on a file type input object. @@ -6863,6 +6659,7 @@ interface HTMLInputElement extends HTMLElement { */ height: number; indeterminate: boolean; + readonly labels: NodeListOf | null; /** * Specifies the ID of a pre-defined datalist of options for an input element. */ @@ -6945,7 +6742,6 @@ interface HTMLInputElement extends HTMLElement { * Returns the input field value as a number. */ valueAsNumber: number; - webkitdirectory: boolean; /** * Sets or retrieves the width of the object. */ @@ -6958,6 +6754,7 @@ interface HTMLInputElement extends HTMLElement { * Returns whether a form will validate when it is submitted, without having to submit it. */ checkValidity(): boolean; + reportValidity(): boolean; /** * Makes the selection equal to the current object. */ @@ -6967,6 +6764,8 @@ interface HTMLInputElement extends HTMLElement { * @param error Sets a custom error message that is displayed when a form is submitted. */ setCustomValidity(error: string): void; + setRangeText(replacement: string): void; + setRangeText(replacement: string, start: number, end: number, selectionMode?: SelectionMode): void; /** * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. @@ -7014,7 +6813,7 @@ declare var HTMLLIElement: { }; interface HTMLLabelElement extends HTMLElement { - readonly control: HTMLInputElement | null; + readonly control: HTMLElement | null; /** * Retrieves a reference to the form that the object is embedded in. */ @@ -7053,13 +6852,13 @@ declare var HTMLLegendElement: { }; interface HTMLLinkElement extends HTMLElement, LinkStyle { + as: string; /** * Sets or retrieves the character set used to encode the object. */ /** @deprecated */ charset: string; crossOrigin: string | null; - /** @deprecated */ disabled: boolean; /** * Sets or retrieves a destination URL or an anchor point. @@ -7069,12 +6868,12 @@ interface HTMLLinkElement extends HTMLElement, LinkStyle { * Sets or retrieves the language code of the object. */ hreflang: string; - import?: Document; integrity: string; /** * Sets or retrieves the media type. */ media: string; + referrerPolicy: string; /** * Sets or retrieves the relationship between the object and the destination of the link. */ @@ -7085,6 +6884,7 @@ interface HTMLLinkElement extends HTMLElement, LinkStyle { */ /** @deprecated */ rev: string; + readonly sizes: DOMTokenList; /** * Sets or retrieves the window or frame at which to target content. */ @@ -7121,7 +6921,7 @@ interface HTMLMapElement extends HTMLElement { /** * Retrieves a collection of the area objects defined for the given map object. */ - readonly areas: HTMLAreasCollection; + readonly areas: HTMLCollection; /** * Sets or retrieves the name of the object. */ @@ -7386,7 +7186,6 @@ declare var HTMLMediaElement: { interface HTMLMenuElement extends HTMLElement { /** @deprecated */ compact: boolean; - type: string; addEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -7399,11 +7198,6 @@ declare var HTMLMenuElement: { }; interface HTMLMetaElement extends HTMLElement { - /** - * Sets or retrieves the character set used to encode the object. - */ - /** @deprecated */ - charset: string; /** * Gets or sets meta-information to associate with httpEquiv or name. */ @@ -7421,11 +7215,6 @@ interface HTMLMetaElement extends HTMLElement { */ /** @deprecated */ scheme: string; - /** - * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. - */ - /** @deprecated */ - url: string; addEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -7479,6 +7268,7 @@ declare var HTMLModElement: { interface HTMLOListElement extends HTMLElement { /** @deprecated */ compact: boolean; + reversed: boolean; /** * The starting number. */ @@ -7700,7 +7490,7 @@ interface HTMLOptionsCollection extends HTMLCollectionOf { * This method will throw a "HierarchyRequestError" DOMException if * element is an ancestor of the element into which it is to be inserted. */ - add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void; + add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number | null): void; /** * Removes the item with index index from the collection. */ @@ -7712,6 +7502,14 @@ declare var HTMLOptionsCollection: { new(): HTMLOptionsCollection; }; +interface HTMLOrSVGElement { + readonly dataset: DOMStringMap; + nonce: string; + tabIndex: number; + blur(): void; + focus(options?: FocusOptions): void; +} + interface HTMLOutputElement extends HTMLElement { defaultValue: string; readonly form: HTMLFormElement | null; @@ -7743,7 +7541,6 @@ interface HTMLParagraphElement extends HTMLElement { */ /** @deprecated */ align: string; - clear: string; addEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -7879,6 +7676,7 @@ interface HTMLScriptElement extends HTMLElement { htmlFor: string; integrity: string; noModule: boolean; + referrerPolicy: string; /** * Retrieves the URL to an external file that contains the source code or data. */ @@ -7965,7 +7763,7 @@ interface HTMLSelectElement extends HTMLElement { * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. */ - add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void; + add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number | null): void; /** * Returns whether a form will validate when it is submitted, without having to submit it. */ @@ -7997,7 +7795,7 @@ interface HTMLSelectElement extends HTMLElement { addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; - [index: number]: Element; + [name: number]: HTMLOptionElement | HTMLOptGroupElement; } declare var HTMLSelectElement: { @@ -8007,6 +7805,7 @@ declare var HTMLSelectElement: { interface HTMLSlotElement extends HTMLElement { name: string; + assignedElements(options?: AssignedNodesOptions): Element[]; assignedNodes(options?: AssignedNodesOptions): Node[]; addEventListener(type: K, listener: (this: HTMLSlotElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; @@ -8014,13 +7813,16 @@ interface HTMLSlotElement extends HTMLElement { removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } +declare var HTMLSlotElement: { + prototype: HTMLSlotElement; + new(): HTMLSlotElement; +}; + interface HTMLSourceElement extends HTMLElement { /** * Gets or sets the intended media type of the media source. */ media: string; - /** @deprecated */ - msKeySystem: string; sizes: string; /** * The address or URL of the a media resource that is to be considered. @@ -8055,8 +7857,6 @@ declare var HTMLSpanElement: { }; interface HTMLStyleElement extends HTMLElement, LinkStyle { - /** @deprecated */ - disabled: boolean; /** * Sets or retrieves the media type. */ @@ -8077,18 +7877,6 @@ declare var HTMLStyleElement: { new(): HTMLStyleElement; }; -interface HTMLSummaryElement extends HTMLElement { - addEventListener(type: K, listener: (this: HTMLSummaryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: HTMLSummaryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; -} - -declare var HTMLSummaryElement: { - prototype: HTMLSummaryElement; - new(): HTMLSummaryElement; -}; - interface HTMLTableCaptionElement extends HTMLElement { /** * Sets or retrieves the alignment of the caption or legend. @@ -8306,7 +8094,7 @@ interface HTMLTableElement extends HTMLElement { * Removes the specified row (tr) from the element and from the rows collection. * @param index Number that specifies the zero-based position in the rows collection of the row to remove. */ - deleteRow(index?: number): void; + deleteRow(index: number): void; /** * Deletes the tFoot element and its contents from the table. */ @@ -8374,7 +8162,7 @@ interface HTMLTableRowElement extends HTMLElement { * Removes the specified cell from the table row, as well as from the cells collection. * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. */ - deleteCell(index?: number): void; + deleteCell(index: number): void; /** * Creates a new cell in the table row, and adds the cell to the cells collection. * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. @@ -8411,7 +8199,7 @@ interface HTMLTableSectionElement extends HTMLElement { * Removes the specified row (tr) from the element and from the rows collection. * @param index Number that specifies the zero-based position in the rows collection of the row to remove. */ - deleteRow(index?: number): void; + deleteRow(index: number): void; /** * Creates a new row (tr) in the table, and adds the row to the rows collection. * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. @@ -8724,11 +8512,11 @@ interface History { readonly length: number; scrollRestoration: ScrollRestoration; readonly state: any; - back(distance?: any): void; - forward(distance?: any): void; - go(delta?: any): void; - pushState(data: any, title?: string, url?: string | null): void; - replaceState(data: any, title?: string, url?: string | null): void; + back(): void; + forward(): void; + go(delta?: number): void; + pushState(data: any, title: string, url?: string | null): void; + replaceState(data: any, title: string, url?: string | null): void; } declare var History: { @@ -8784,13 +8572,13 @@ interface IDBCursor { * Delete the record pointed at by the cursor with a new value. * If successful, request's result will be undefined. */ - delete(): IDBRequest; + delete(): IDBRequest; /** * Updated the record pointed at by the cursor with a new value. * Throws a "DataError" DOMException if the effective object store uses in-line keys and the key would have changed. * If successful, request's result will be the record's key. */ - update(value: any): IDBRequest; + update(value: any): IDBRequest; } declare var IDBCursor: { @@ -8916,40 +8704,40 @@ interface IDBIndex { * If successful, request's result will be the * count. */ - count(key?: IDBValidKey | IDBKeyRange): IDBRequest; + count(key?: IDBValidKey | IDBKeyRange): IDBRequest; /** * Retrieves the value of the first record matching the * given key or key range in query. * If successful, request's result will be the value, or undefined if there was no matching record. */ - get(key: IDBValidKey | IDBKeyRange): IDBRequest; + get(key: IDBValidKey | IDBKeyRange): IDBRequest; /** * Retrieves the values of the records matching the given key or key range in query (up to count if given). * If successful, request's result will be an Array of the values. */ - getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest; + getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest; /** * Retrieves the keys of records matching the given key or key range in query (up to count if given). * If successful, request's result will be an Array of the keys. */ - getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest; + getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest; /** * Retrieves the key of the first record matching the * given key or key range in query. * If successful, request's result will be the key, or undefined if there was no matching record. */ - getKey(key: IDBValidKey | IDBKeyRange): IDBRequest; + getKey(key: IDBValidKey | IDBKeyRange): IDBRequest; /** * Opens a cursor over the records matching query, * ordered by direction. If query is null, all records in index are matched. * If successful, request's result will be an IDBCursorWithValue, or null if there were no matching records. */ - openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest; + openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest; /** * Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in index are matched. * If successful, request's result will be an IDBCursor, or null if there were no matching records. */ - openKeyCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest; + openKeyCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest; } declare var IDBIndex: { @@ -9028,19 +8816,19 @@ interface IDBObjectStore { * Returns the associated transaction. */ readonly transaction: IDBTransaction; - add(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest; + add(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest; /** * Deletes all records in store. * If successful, request's result will * be undefined. */ - clear(): IDBRequest; + clear(): IDBRequest; /** * Retrieves the number of records matching the * given key or key range in query. * If successful, request's result will be the count. */ - count(key?: IDBValidKey | IDBKeyRange): IDBRequest; + count(key?: IDBValidKey | IDBKeyRange): IDBRequest; /** * Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be * satisfied with the data already in store the upgrade @@ -9055,7 +8843,7 @@ interface IDBObjectStore { * If successful, request's result will * be undefined. */ - delete(key: IDBValidKey | IDBKeyRange): IDBRequest; + delete(key: IDBValidKey | IDBKeyRange): IDBRequest; /** * Deletes the index in store with the given name. * Throws an "InvalidStateError" DOMException if not called within an upgrade @@ -9067,41 +8855,41 @@ interface IDBObjectStore { * given key or key range in query. * If successful, request's result will be the value, or undefined if there was no matching record. */ - get(query: IDBValidKey | IDBKeyRange): IDBRequest; + get(query: IDBValidKey | IDBKeyRange): IDBRequest; /** * Retrieves the values of the records matching the * given key or key range in query (up to count if given). * If successful, request's result will * be an Array of the values. */ - getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest; + getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest; /** * Retrieves the keys of records matching the * given key or key range in query (up to count if given). * If successful, request's result will * be an Array of the keys. */ - getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest; + getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest; /** * Retrieves the key of the first record matching the * given key or key range in query. * If successful, request's result will be the key, or undefined if there was no matching record. */ - getKey(query: IDBValidKey | IDBKeyRange): IDBRequest; + getKey(query: IDBValidKey | IDBKeyRange): IDBRequest; index(name: string): IDBIndex; /** * Opens a cursor over the records matching query, * ordered by direction. If query is null, all records in store are matched. * If successful, request's result will be an IDBCursorWithValue pointing at the first matching record, or null if there were no matching records. */ - openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest; + openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest; /** * Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in store are matched. * If successful, request's result will be an IDBCursor pointing at the first matching record, or * null if there were no matching records. */ - openKeyCursor(query?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest; - put(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest; + openKeyCursor(query?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest; + put(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest; } declare var IDBObjectStore: { @@ -9114,7 +8902,7 @@ interface IDBOpenDBRequestEventMap extends IDBRequestEventMap { "upgradeneeded": IDBVersionChangeEvent; } -interface IDBOpenDBRequest extends IDBRequest { +interface IDBOpenDBRequest extends IDBRequest { onblocked: ((this: IDBOpenDBRequest, ev: Event) => any) | null; onupgradeneeded: ((this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any) | null; addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; @@ -9133,14 +8921,14 @@ interface IDBRequestEventMap { "success": Event; } -interface IDBRequest extends EventTarget { +interface IDBRequest extends EventTarget { /** * When a request is completed, returns the error (a DOMException), or null if the request succeeded. Throws * a "InvalidStateError" DOMException if the request is still pending. */ readonly error: DOMException | null; - onerror: ((this: IDBRequest, ev: Event) => any) | null; - onsuccess: ((this: IDBRequest, ev: Event) => any) | null; + onerror: ((this: IDBRequest, ev: Event) => any) | null; + onsuccess: ((this: IDBRequest, ev: Event) => any) | null; /** * Returns "pending" until a request is complete, * then returns "done". @@ -9151,7 +8939,7 @@ interface IDBRequest extends EventTarget { * or undefined if the request failed. Throws a * "InvalidStateError" DOMException if the request is still pending. */ - readonly result: any; + readonly result: T; /** * Returns the IDBObjectStore, IDBIndex, or IDBCursor the request was made against, or null if is was an open * request. @@ -9162,9 +8950,9 @@ interface IDBRequest extends EventTarget { * If this as an open request, then it returns an upgrade transaction while it is running, or null otherwise. */ readonly transaction: IDBTransaction | null; - addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } @@ -9244,11 +9032,27 @@ declare var IIRFilterNode: { }; interface ImageBitmap { + /** + * Returns the intrinsic height of the image, in CSS + * pixels. + */ readonly height: number; + /** + * Returns the intrinsic width of the image, in CSS + * pixels. + */ readonly width: number; + /** + * Releases imageBitmap's underlying bitmap data. + */ close(): void; } +declare var ImageBitmap: { + prototype: ImageBitmap; + new(): ImageBitmap; +}; + interface ImageBitmapOptions { colorSpaceConversion?: "none" | "default"; imageOrientation?: "none" | "flipY"; @@ -9258,8 +9062,34 @@ interface ImageBitmapOptions { resizeWidth?: number; } +interface ImageBitmapRenderingContext { + /** + * Returns the canvas element that the context is bound to. + */ + readonly canvas: HTMLCanvasElement; + /** + * Replaces contents of the canvas element to which context + * is bound with a transparent black bitmap whose size corresponds to the width and height + * content attributes of the canvas element. + */ + transferFromImageBitmap(bitmap: ImageBitmap | null): void; +} + +declare var ImageBitmapRenderingContext: { + prototype: ImageBitmapRenderingContext; + new(): ImageBitmapRenderingContext; +}; + interface ImageData { + /** + * Returns the one-dimensional array containing the data in RGBA order, as integers in the + * range 0 to 255. + */ readonly data: Uint8ClampedArray; + /** + * Returns the actual dimensions of the data in the ImageData object, in + * pixels. + */ readonly height: number; readonly width: number; } @@ -9368,19 +9198,68 @@ declare var ListeningStateChangedEvent: { }; interface Location { + /** + * Returns a DOMStringList object listing the origins of the ancestor browsing contexts, from the parent browsing + * context to the top-level browsing context. + */ + readonly ancestorOrigins: DOMStringList; + /** + * Returns the Location object's URL's fragment (includes leading "#" if non-empty). + * Can be set, to navigate to the same URL with a changed fragment (ignores leading "#"). + */ hash: string; + /** + * Returns the Location object's URL's host and port (if different from the default + * port for the scheme). + * Can be set, to navigate to the same URL with a changed host and port. + */ host: string; + /** + * Returns the Location object's URL's host. + * Can be set, to navigate to the same URL with a changed host. + */ hostname: string; + /** + * Returns the Location object's URL. + * Can be set, to navigate to the given URL. + */ href: string; + /** + * Returns the Location object's URL's origin. + */ readonly origin: string; + /** + * Returns the Location object's URL's path. + * Can be set, to navigate to the same URL with a changed path. + */ pathname: string; + /** + * Returns the Location object's URL's port. + * Can be set, to navigate to the same URL with a changed port. + */ port: string; + /** + * Returns the Location object's URL's scheme. + * Can be set, to navigate to the same URL with a changed scheme. + */ protocol: string; + /** + * Returns the Location object's URL's query (includes leading "?" if non-empty). + * Can be set, to navigate to the same URL with a changed query (ignores leading "?"). + */ search: string; + /** + * Navigates to the given URL. + */ assign(url: string): void; - reload(forcedReload?: boolean): void; + /** + * Reloads the current page. + */ + reload(): void; + /** + * Removes the current page from the session history and navigates to the given URL. + */ replace(url: string): void; - toString(): string; } declare var Location: { @@ -9408,36 +9287,6 @@ declare var MSBlobBuilder: { new(): MSBlobBuilder; }; -interface MSCredentials { - getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): Promise; - makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): Promise; -} - -declare var MSCredentials: { - prototype: MSCredentials; - new(): MSCredentials; -}; - -interface MSDCCEvent extends Event { - readonly maxFr: number; - readonly maxFs: number; -} - -declare var MSDCCEvent: { - prototype: MSDCCEvent; - new(type: string, eventInitDict: MSDCCEventInit): MSDCCEvent; -}; - -interface MSDSHEvent extends Event { - readonly sources: number[]; - readonly timestamp: number; -} - -declare var MSDSHEvent: { - prototype: MSDSHEvent; - new(type: string, eventInitDict: MSDSHEventInit): MSDSHEvent; -}; - interface MSFIDOCredentialAssertion extends MSAssertion { readonly algorithm: string | Algorithm; readonly attestation: any; @@ -9816,11 +9665,20 @@ declare var MediaList: { new(): MediaList; }; -interface MediaQueryList { +interface MediaQueryListEventMap { + "change": Event; +} + +interface MediaQueryList extends EventTarget { readonly matches: boolean; readonly media: string; - addListener(listener: MediaQueryListListener): void; - removeListener(listener: MediaQueryListListener): void; + onchange: ((this: MediaQueryList, ev: Event) => any) | null; + addListener(listener: EventListenerOrEventListenerObject | null): void; + removeListener(listener: EventListenerOrEventListenerObject | null): void; + addEventListener(type: K, listener: (this: MediaQueryList, ev: MediaQueryListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: MediaQueryList, ev: MediaQueryListEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var MediaQueryList: { @@ -9828,6 +9686,16 @@ declare var MediaQueryList: { new(): MediaQueryList; }; +interface MediaQueryListEvent extends Event { + readonly matches: boolean; + readonly media: string; +} + +declare var MediaQueryListEvent: { + prototype: MediaQueryListEvent; + new(type: string, eventInitDict?: MediaQueryListEventInit): MediaQueryListEvent; +}; + interface MediaSource extends EventTarget { readonly activeSourceBuffers: SourceBufferList; duration: number; @@ -9994,11 +9862,31 @@ declare var MessageChannel: { }; interface MessageEvent extends Event { + /** + * Returns the data of the message. + */ readonly data: any; + /** + * Returns the last event ID string, for + * server-sent events. + */ + readonly lastEventId: string; + /** + * Returns the origin of the message, for server-sent events and + * cross-document messaging. + */ readonly origin: string; + /** + * Returns the MessagePort array sent with the message, for cross-document + * messaging and channel messaging. + */ readonly ports: ReadonlyArray; - readonly source: MessageEventSource; - initMessageEvent(type: string, bubbles: boolean, cancelable: boolean, data: any, origin: string, lastEventId: string, source: Window): void; + /** + * Returns the WindowProxy of the source window, for cross-document + * messaging, and the MessagePort being attached, in the connect event fired at + * SharedWorkerGlobalScope objects. + */ + readonly source: MessageEventSource | null; } declare var MessageEvent: { @@ -10025,7 +9913,7 @@ interface MessagePort extends EventTarget { * transfer contains duplicate objects or port, or if message * could not be cloned. */ - postMessage(message: any, transfer?: any[]): void; + postMessage(message: any, transfer?: Transferable[]): void; /** * Begins dispatching messages received on the port. */ @@ -10124,7 +10012,40 @@ declare var MutationEvent: { interface MutationObserver { disconnect(): void; - observe(target: Node, options: MutationObserverInit): void; + /** + * Instructs the user agent to observe a given target (a node) and report any mutations based on + * the criteria given by options (an object). + * The options argument allows for setting mutation + * observation options via object members. These are the object members that + * can be used: + * childList + * Set to true if mutations to target's children are to be observed. + * attributes + * Set to true if mutations to target's attributes are to be observed. Can be omitted if attributeOldValue or attributeFilter is + * specified. + * characterData + * Set to true if mutations to target's data are to be observed. Can be omitted if characterDataOldValue is specified. + * subtree + * Set to true if mutations to not just target, but + * also target's descendants are to be + * observed. + * attributeOldValue + * Set to true if attributes is true or omitted + * and target's attribute value before the mutation + * needs to be recorded. + * characterDataOldValue + * Set to true if characterData is set to true or omitted and target's data before the mutation + * needs to be recorded. + * attributeFilter + * Set to a list of attribute local names (without namespace) if not all attribute mutations need to be + * observed and attributes is true + * or omitted. + */ + observe(target: Node, options?: MutationObserverInit): void; + /** + * Empties the record queue and + * returns what was in there. + */ takeRecords(): MutationRecord[]; } @@ -10135,13 +10056,41 @@ declare var MutationObserver: { interface MutationRecord { readonly addedNodes: NodeList; + /** + * Returns the local name of the + * changed attribute, and null otherwise. + */ readonly attributeName: string | null; + /** + * Returns the namespace of the + * changed attribute, and null otherwise. + */ readonly attributeNamespace: string | null; + /** + * Return the previous and next sibling respectively + * of the added or removed nodes, and null otherwise. + */ readonly nextSibling: Node | null; + /** + * The return value depends on type. For + * "attributes", it is the value of the + * changed attribute before the change. + * For "characterData", it is the data of the changed node before the change. For + * "childList", it is null. + */ readonly oldValue: string | null; readonly previousSibling: Node | null; + /** + * Return the nodes added and removed + * respectively. + */ readonly removedNodes: NodeList; readonly target: Node; + /** + * Returns "attributes" if it was an attribute mutation. + * "characterData" if it was a mutation to a CharacterData node. And + * "childList" if it was a mutation to the tree of nodes. + */ readonly type: MutationRecordType; } @@ -10179,7 +10128,7 @@ declare var NavigationPreloadManager: { new(): NavigationPreloadManager; }; -interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, MSNavigatorDoNotTrack, MSFileSaver, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorUserMedia, NavigatorLanguage, NavigatorStorage { +interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, MSNavigatorDoNotTrack, MSFileSaver, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorUserMedia, NavigatorLanguage, NavigatorStorage, NavigatorAutomationInformation { readonly activeVRDisplays: ReadonlyArray; readonly authentication: WebAuthentication; readonly cookieEnabled: boolean; @@ -10208,6 +10157,10 @@ declare var Navigator: { new(): Navigator; }; +interface NavigatorAutomationInformation { + readonly webdriver: boolean; +} + interface NavigatorBeacon { sendBeacon(url: string, data?: Blob | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | FormData | string | null): boolean; } @@ -10254,33 +10207,103 @@ interface NavigatorUserMedia { } interface Node extends EventTarget { - readonly baseURI: string | null; - readonly childNodes: NodeListOf; - readonly firstChild: Node | null; + /** + * Returns node's node document's document base URL. + */ + readonly baseURI: string; + /** + * Returns the children. + */ + readonly childNodes: NodeListOf; + /** + * Returns the first child. + */ + readonly firstChild: ChildNode | null; + /** + * Returns true if node is connected and false otherwise. + */ readonly isConnected: boolean; - readonly lastChild: Node | null; - readonly localName: string | null; - readonly namespaceURI: string | null; + /** + * Returns the last child. + */ + readonly lastChild: ChildNode | null; + /** + * Returns the next sibling. + */ readonly nextSibling: Node | null; + /** + * Returns a string appropriate for the type of node, as + * follows: + * Element + * Its HTML-uppercased qualified name. + * Attr + * Its qualified name. + * Text + * "#text". + * CDATASection + * "#cdata-section". + * ProcessingInstruction + * Its target. + * Comment + * "#comment". + * Document + * "#document". + * DocumentType + * Its name. + * DocumentFragment + * "#document-fragment". + */ readonly nodeName: string; readonly nodeType: number; nodeValue: string | null; - readonly ownerDocument: Document; - readonly parentElement: HTMLElement | null; - readonly parentNode: Node | null; + /** + * Returns the node document. + * Returns null for documents. + */ + readonly ownerDocument: Document | null; + /** + * Returns the parent element. + */ + readonly parentElement: Element | null; + /** + * Returns the parent. + */ + readonly parentNode: Node & ParentNode | null; + /** + * Returns the previous sibling. + */ readonly previousSibling: Node | null; textContent: string | null; appendChild(newChild: T): T; + /** + * Returns a copy of node. If deep is true, the copy also includes the node's descendants. + */ cloneNode(deep?: boolean): Node; compareDocumentPosition(other: Node): number; - contains(child: Node): boolean; + /** + * Returns true if other is an inclusive descendant of node, and false otherwise. + */ + contains(other: Node | null): boolean; + /** + * Returns node's shadow-including root. + */ + getRootNode(options?: GetRootNodeOptions): Node; + /** + * Returns whether node has children. + */ hasChildNodes(): boolean; insertBefore(newChild: T, refChild: Node | null): T; - isDefaultNamespace(namespaceURI: string | null): boolean; - isEqualNode(arg: Node): boolean; - isSameNode(other: Node): boolean; + isDefaultNamespace(namespace: string | null): boolean; + /** + * Returns whether node and otherNode have the same properties. + */ + isEqualNode(otherNode: Node | null): boolean; + isSameNode(otherNode: Node | null): boolean; lookupNamespaceURI(prefix: string | null): string | null; - lookupPrefix(namespaceURI: string | null): string | null; + lookupPrefix(namespace: string | null): string | null; + /** + * Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. + */ normalize(): void; removeChild(oldChild: T): T; replaceChild(newChild: Node, oldChild: T): T; @@ -10351,9 +10374,9 @@ declare var NodeFilter: { }; interface NodeIterator { - /** @deprecated */ - readonly expandEntityReferences: boolean; readonly filter: NodeFilter | null; + readonly pointerBeforeReferenceNode: boolean; + readonly referenceNode: Node; readonly root: Node; readonly whatToShow: number; detach(): void; @@ -10367,8 +10390,14 @@ declare var NodeIterator: { }; interface NodeList { + /** + * Returns the number of nodes in the collection. + */ readonly length: number; - item(index: number): Node; + /** + * element = collection[index] + */ + item(index: number): Node | null; /** * Performs the specified action for each node in an list. * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list. @@ -10404,6 +10433,26 @@ interface NodeSelector { querySelectorAll(selectors: string): NodeListOf; } +interface NonDocumentTypeChildNode { + /** + * Returns the first following sibling that + * is an element, and null otherwise. + */ + readonly nextElementSibling: Element | null; + /** + * Returns the first preceding sibling that + * is an element, and null otherwise. + */ + readonly previousElementSibling: Element | null; +} + +interface NonElementParentNode { + /** + * Returns the first element within node's descendants whose ID is elementId. + */ + getElementById(elementId: string): Element | null; +} + interface NotificationEventMap { "click": Event; "close": Event; @@ -10606,23 +10655,55 @@ declare var PannerNode: { interface ParentNode { readonly childElementCount: number; + /** + * Returns the child elements. + */ readonly children: HTMLCollection; + /** + * Returns the first child that is an element, and null otherwise. + */ readonly firstElementChild: Element | null; + /** + * Returns the last child that is an element, and null otherwise. + */ readonly lastElementChild: Element | null; + /** + * Inserts nodes after the last child of node, while replacing + * strings in nodes with equivalent Text nodes. + * Throws a "HierarchyRequestError" DOMException if the constraints of + * the node tree are violated. + */ + append(...nodes: (Node | string)[]): void; + /** + * Inserts nodes before the first child of node, while + * replacing strings in nodes with equivalent Text nodes. + * Throws a "HierarchyRequestError" DOMException if the constraints of + * the node tree are violated. + */ + prepend(...nodes: (Node | string)[]): void; + /** + * Returns the first element that is a descendant of node that + * matches selectors. + */ querySelector(selectors: K): HTMLElementTagNameMap[K] | null; querySelector(selectors: K): SVGElementTagNameMap[K] | null; querySelector(selectors: string): E | null; + /** + * Returns all element descendants of node that + * match selectors. + */ querySelectorAll(selectors: K): NodeListOf; querySelectorAll(selectors: K): NodeListOf; querySelectorAll(selectors: string): NodeListOf; } -interface Path2D extends CanvasPathMethods { +interface Path2D extends CanvasPath { + addPath(path: Path2D, transform?: DOMMatrix2DInit): void; } declare var Path2D: { prototype: Path2D; - new(d?: Path2D | string): Path2D; + new(path?: Path2D | string): Path2D; }; interface PaymentAddress { @@ -11022,7 +11103,7 @@ declare var ProgressEvent: { }; interface PromiseRejectionEvent extends Event { - readonly promise: PromiseLike; + readonly promise: Promise; readonly reason: any; } @@ -11455,7 +11536,7 @@ interface RTCRtpReceiver { declare var RTCRtpReceiver: { prototype: RTCRtpReceiver; new(): RTCRtpReceiver; - getCapabilities(kind: string): RTCRtpCapabilities; + getCapabilities(kind: string): RTCRtpCapabilities | null; }; interface RTCRtpSender { @@ -11473,7 +11554,7 @@ interface RTCRtpSender { declare var RTCRtpSender: { prototype: RTCRtpSender; new(): RTCRtpSender; - getCapabilities(kind: string): RTCRtpCapabilities; + getCapabilities(kind: string): RTCRtpCapabilities | null; }; interface RTCRtpTransceiver { @@ -11610,25 +11691,31 @@ declare var RandomSource: { new(): RandomSource; }; -interface Range { - readonly collapsed: boolean; +interface Range extends AbstractRange { + /** + * Returns the node, furthest away from + * the document, that is an ancestor of both range's start node and end node. + */ readonly commonAncestorContainer: Node; - readonly endContainer: Node; - readonly endOffset: number; - readonly startContainer: Node; - readonly startOffset: number; cloneContents(): DocumentFragment; cloneRange(): Range; collapse(toStart?: boolean): void; compareBoundaryPoints(how: number, sourceRange: Range): number; - createContextualFragment(fragment: string): DocumentFragment; + /** + * Returns −1 if the point is before the range, 0 if the point is + * in the range, and 1 if the point is after the range. + */ + comparePoint(node: Node, offset: number): number; deleteContents(): void; detach(): void; - expand(Unit: ExpandGranularity): boolean; extractContents(): DocumentFragment; getBoundingClientRect(): ClientRect | DOMRect; getClientRects(): ClientRectList | DOMRectList; insertNode(node: Node): void; + /** + * Returns whether range intersects node. + */ + intersectsNode(node: Node): boolean; isPointInRange(node: Node, offset: number): boolean; selectNode(node: Node): void; selectNodeContents(node: Node): void; @@ -11639,7 +11726,6 @@ interface Range { setStartAfter(node: Node): void; setStartBefore(node: Node): void; surroundContents(newParent: Node): void; - toString(): string; readonly END_TO_END: number; readonly END_TO_START: number; readonly START_TO_END: number; @@ -11914,8 +12000,8 @@ declare var SVGAnimatedPreserveAspectRatio: { }; interface SVGAnimatedRect { - readonly animVal: SVGRect; - readonly baseVal: SVGRect; + readonly animVal: DOMRectReadOnly; + readonly baseVal: DOMRect; } declare var SVGAnimatedRect: { @@ -11958,7 +12044,7 @@ declare var SVGCircleElement: { new(): SVGCircleElement; }; -interface SVGClipPathElement extends SVGGraphicsElement, SVGUnitTypes { +interface SVGClipPathElement extends SVGGraphicsElement { readonly clipPathUnits: SVGAnimatedEnumeration; addEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; @@ -12026,35 +12112,14 @@ declare var SVGDescElement: { new(): SVGDescElement; }; -interface SVGElementEventMap extends ElementEventMap { - "click": MouseEvent; - "dblclick": MouseEvent; - "focusin": FocusEvent; - "focusout": FocusEvent; - "load": Event; - "mousedown": MouseEvent; - "mousemove": MouseEvent; - "mouseout": MouseEvent; - "mouseover": MouseEvent; - "mouseup": MouseEvent; +interface SVGElementEventMap extends GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap { } -interface SVGElement extends Element, ElementCSSInlineStyle { +interface SVGElement extends Element, GlobalEventHandlers, DocumentAndElementEventHandlers, SVGElementInstance, HTMLOrSVGElement { + /** @deprecated */ readonly className: any; - onclick: ((this: SVGElement, ev: MouseEvent) => any) | null; - ondblclick: ((this: SVGElement, ev: MouseEvent) => any) | null; - onfocusin: ((this: SVGElement, ev: FocusEvent) => any) | null; - onfocusout: ((this: SVGElement, ev: FocusEvent) => any) | null; - onload: ((this: SVGElement, ev: Event) => any) | null; - onmousedown: ((this: SVGElement, ev: MouseEvent) => any) | null; - onmousemove: ((this: SVGElement, ev: MouseEvent) => any) | null; - onmouseout: ((this: SVGElement, ev: MouseEvent) => any) | null; - onmouseover: ((this: SVGElement, ev: MouseEvent) => any) | null; - onmouseup: ((this: SVGElement, ev: MouseEvent) => any) | null; readonly ownerSVGElement: SVGSVGElement | null; readonly viewportElement: SVGElement | null; - /** @deprecated */ - xmlbase: string; addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12067,14 +12132,8 @@ declare var SVGElement: { }; interface SVGElementInstance extends EventTarget { - readonly childNodes: SVGElementInstanceList; readonly correspondingElement: SVGElement; readonly correspondingUseElement: SVGUseElement; - readonly firstChild: SVGElementInstance; - readonly lastChild: SVGElementInstance; - readonly nextSibling: SVGElementInstance; - readonly parentNode: SVGElementInstance; - readonly previousSibling: SVGElementInstance; } declare var SVGElementInstance: { @@ -12567,7 +12626,7 @@ declare var SVGFETurbulenceElement: { readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; }; -interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGURIReference { +interface SVGFilterElement extends SVGElement, SVGURIReference { /** @deprecated */ readonly filterResX: SVGAnimatedInteger; /** @deprecated */ @@ -12632,7 +12691,24 @@ declare var SVGGElement: { new(): SVGGElement; }; -interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGURIReference { +interface SVGGeometryElement extends SVGGraphicsElement { + readonly pathLength: SVGAnimatedNumber; + getPointAtLength(distance: number): DOMPoint; + getTotalLength(): number; + isPointInFill(point?: DOMPointInit): boolean; + isPointInStroke(point?: DOMPointInit): boolean; + addEventListener(type: K, listener: (this: SVGGeometryElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: SVGGeometryElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var SVGGeometryElement: { + prototype: SVGGeometryElement; + new(): SVGGeometryElement; +}; + +interface SVGGradientElement extends SVGElement, SVGURIReference { readonly gradientTransform: SVGAnimatedTransformList; readonly gradientUnits: SVGAnimatedEnumeration; readonly spreadMethod: SVGAnimatedEnumeration; @@ -12656,16 +12732,10 @@ declare var SVGGradientElement: { }; interface SVGGraphicsElement extends SVGElement, SVGTests { - /** @deprecated */ - readonly farthestViewportElement: SVGElement | null; - /** @deprecated */ - readonly nearestViewportElement: SVGElement | null; readonly transform: SVGAnimatedTransformList; - getBBox(): SVGRect; - getCTM(): SVGMatrix | null; - getScreenCTM(): SVGMatrix | null; - /** @deprecated */ - getTransformToElement(element: SVGElement): SVGMatrix; + getBBox(options?: SVGBoundingBoxOptions): DOMRect; + getCTM(): DOMMatrix | null; + getScreenCTM(): DOMMatrix | null; addEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12731,6 +12801,7 @@ declare var SVGLength: { }; interface SVGLengthList { + readonly length: number; readonly numberOfItems: number; appendItem(newItem: SVGLength): SVGLength; clear(): void; @@ -12739,6 +12810,7 @@ interface SVGLengthList { insertItemBefore(newItem: SVGLength, index: number): SVGLength; removeItem(index: number): SVGLength; replaceItem(newItem: SVGLength, index: number): SVGLength; + [index: number]: SVGLength; } declare var SVGLengthList: { @@ -12811,7 +12883,7 @@ declare var SVGMarkerElement: { readonly SVG_MARKER_ORIENT_UNKNOWN: number; }; -interface SVGMaskElement extends SVGElement, SVGTests, SVGUnitTypes { +interface SVGMaskElement extends SVGElement, SVGTests { readonly height: SVGAnimatedLength; readonly maskContentUnits: SVGAnimatedEnumeration; readonly maskUnits: SVGAnimatedEnumeration; @@ -12851,6 +12923,7 @@ declare var SVGNumber: { }; interface SVGNumberList { + readonly length: number; readonly numberOfItems: number; appendItem(newItem: SVGNumber): SVGNumber; clear(): void; @@ -12859,6 +12932,7 @@ interface SVGNumberList { insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; removeItem(index: number): SVGNumber; replaceItem(newItem: SVGNumber, index: number): SVGNumber; + [index: number]: SVGNumber; } declare var SVGNumberList: { @@ -13198,7 +13272,7 @@ declare var SVGPathSegMovetoRel: { new(): SVGPathSegMovetoRel; }; -interface SVGPatternElement extends SVGElement, SVGTests, SVGUnitTypes, SVGFitToViewBox, SVGURIReference { +interface SVGPatternElement extends SVGElement, SVGTests, SVGFitToViewBox, SVGURIReference { readonly height: SVGAnimatedLength; readonly patternContentUnits: SVGAnimatedEnumeration; readonly patternTransform: SVGAnimatedTransformList; @@ -13331,10 +13405,6 @@ declare var SVGRectElement: { }; interface SVGSVGElementEventMap extends SVGElementEventMap { - "SVGAbort": Event; - "SVGError": Event; - "resize": UIEvent; - "scroll": UIEvent; "SVGUnload": Event; "SVGZoom": SVGZoomEvent; } @@ -13347,10 +13417,6 @@ interface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewB currentScale: number; readonly currentTranslate: SVGPoint; readonly height: SVGAnimatedLength; - onabort: ((this: SVGSVGElement, ev: Event) => any) | null; - onerror: ((this: SVGSVGElement, ev: Event) => any) | null; - onresize: ((this: SVGSVGElement, ev: UIEvent) => any) | null; - onscroll: ((this: SVGSVGElement, ev: UIEvent) => any) | null; onunload: ((this: SVGSVGElement, ev: Event) => any) | null; onzoom: ((this: SVGSVGElement, ev: SVGZoomEvent) => any) | null; /** @deprecated */ @@ -13406,6 +13472,9 @@ interface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewB declare var SVGSVGElement: { prototype: SVGSVGElement; new(): SVGSVGElement; + readonly SVG_ZOOMANDPAN_DISABLE: number; + readonly SVG_ZOOMANDPAN_MAGNIFY: number; + readonly SVG_ZOOMANDPAN_UNKNOWN: number; }; interface SVGScriptElement extends SVGElement, SVGURIReference { @@ -13435,6 +13504,7 @@ declare var SVGStopElement: { }; interface SVGStringList { + readonly length: number; readonly numberOfItems: number; appendItem(newItem: string): string; clear(): void; @@ -13443,6 +13513,7 @@ interface SVGStringList { insertItemBefore(newItem: string, index: number): string; removeItem(index: number): string; replaceItem(newItem: string, index: number): string; + [index: number]: string; } declare var SVGStringList: { @@ -13504,11 +13575,7 @@ declare var SVGTSpanElement: { interface SVGTests { readonly requiredExtensions: SVGStringList; - /** @deprecated */ - readonly requiredFeatures: SVGStringList; readonly systemLanguage: SVGStringList; - /** @deprecated */ - hasExtension(extension: string): boolean; } interface SVGTextContentElement extends SVGGraphicsElement { @@ -13666,7 +13733,14 @@ interface SVGUnitTypes { readonly SVG_UNIT_TYPE_UNKNOWN: number; readonly SVG_UNIT_TYPE_USERSPACEONUSE: number; } -declare var SVGUnitTypes: SVGUnitTypes; + +declare var SVGUnitTypes: { + prototype: SVGUnitTypes; + new(): SVGUnitTypes; + readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; + readonly SVG_UNIT_TYPE_UNKNOWN: number; + readonly SVG_UNIT_TYPE_USERSPACEONUSE: number; +}; interface SVGUseElement extends SVGGraphicsElement, SVGURIReference { readonly animatedInstanceRoot: SVGElementInstance | null; @@ -13698,6 +13772,9 @@ interface SVGViewElement extends SVGElement, SVGFitToViewBox, SVGZoomAndPan { declare var SVGViewElement: { prototype: SVGViewElement; new(): SVGViewElement; + readonly SVG_ZOOMANDPAN_DISABLE: number; + readonly SVG_ZOOMANDPAN_MAGNIFY: number; + readonly SVG_ZOOMANDPAN_UNKNOWN: number; }; interface SVGZoomAndPan { @@ -13743,36 +13820,14 @@ declare var ScopedCredentialInfo: { new(): ScopedCredentialInfo; }; -interface ScreenEventMap { - "MSOrientationChange": Event; -} - -interface Screen extends EventTarget { +interface Screen { readonly availHeight: number; readonly availWidth: number; - /** @deprecated */ - bufferDepth: number; readonly colorDepth: number; - readonly deviceXDPI: number; - readonly deviceYDPI: number; - readonly fontSmoothingEnabled: boolean; readonly height: number; - readonly logicalXDPI: number; - readonly logicalYDPI: number; - readonly msOrientation: string; - onmsorientationchange: ((this: Screen, ev: Event) => any) | null; + readonly orientation: ScreenOrientation; readonly pixelDepth: number; - readonly systemXDPI: number; - readonly systemYDPI: number; readonly width: number; - lockOrientation(orientations: OrientationLockType | OrientationLockType[]): boolean; - msLockOrientation(orientations: string | string[]): boolean; - msUnlockOrientation(): void; - unlockOrientation(): void; - addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var Screen: { @@ -13780,6 +13835,27 @@ declare var Screen: { new(): Screen; }; +interface ScreenOrientationEventMap { + "change": Event; +} + +interface ScreenOrientation extends EventTarget { + readonly angle: number; + onchange: ((this: ScreenOrientation, ev: Event) => any) | null; + readonly type: OrientationType; + lock(orientation: OrientationLockType): Promise; + unlock(): void; + addEventListener(type: K, listener: (this: ScreenOrientation, ev: ScreenOrientationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: ScreenOrientation, ev: ScreenOrientationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var ScreenOrientation: { + prototype: ScreenOrientation; + new(): ScreenOrientation; +}; + interface ScriptProcessorNodeEventMap { "audioprocess": AudioProcessingEvent; } @@ -13866,7 +13942,7 @@ interface ServiceWorker extends EventTarget, AbstractWorker { onstatechange: ((this: ServiceWorker, ev: Event) => any) | null; readonly scriptURL: string; readonly state: ServiceWorkerState; - postMessage(message: any, transfer?: any[]): void; + postMessage(message: any, transfer?: Transferable[]): void; addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -13947,9 +14023,10 @@ declare var ServiceWorkerRegistration: { new(): ServiceWorkerRegistration; }; -interface ShadowRoot extends DocumentOrShadowRoot, DocumentFragment { +interface ShadowRoot extends DocumentOrShadowRoot, DocumentFragment, DocumentOrShadowRoot { readonly host: Element; innerHTML: string; + readonly mode: ShadowRootMode; } interface ShadowRootInit { @@ -13957,6 +14034,10 @@ interface ShadowRootInit { mode: "open" | "closed"; } +interface Slotable { + readonly assignedSlot: HTMLSlotElement | null; +} + interface SourceBuffer extends EventTarget { appendWindowEnd: number; appendWindowStart: number; @@ -13989,6 +14070,130 @@ declare var SourceBufferList: { new(): SourceBufferList; }; +interface SpeechGrammar { + src: string; + weight: number; +} + +declare var SpeechGrammar: { + prototype: SpeechGrammar; + new(): SpeechGrammar; +}; + +interface SpeechGrammarList { + readonly length: number; + addFromString(string: string, weight?: number): void; + addFromURI(src: string, weight?: number): void; + item(index: number): SpeechGrammar; + [index: number]: SpeechGrammar; +} + +declare var SpeechGrammarList: { + prototype: SpeechGrammarList; + new(): SpeechGrammarList; +}; + +interface SpeechRecognitionEventMap { + "audioend": Event; + "audiostart": Event; + "end": Event; + "error": SpeechRecognitionError; + "nomatch": SpeechRecognitionEvent; + "result": SpeechRecognitionEvent; + "soundend": Event; + "soundstart": Event; + "speechend": Event; + "speechstart": Event; + "start": Event; +} + +interface SpeechRecognition extends EventTarget { + continuous: boolean; + grammars: SpeechGrammarList; + interimResults: boolean; + lang: string; + maxAlternatives: number; + onaudioend: ((this: SpeechRecognition, ev: Event) => any) | null; + onaudiostart: ((this: SpeechRecognition, ev: Event) => any) | null; + onend: ((this: SpeechRecognition, ev: Event) => any) | null; + onerror: ((this: SpeechRecognition, ev: SpeechRecognitionError) => any) | null; + onnomatch: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null; + onresult: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null; + onsoundend: ((this: SpeechRecognition, ev: Event) => any) | null; + onsoundstart: ((this: SpeechRecognition, ev: Event) => any) | null; + onspeechend: ((this: SpeechRecognition, ev: Event) => any) | null; + onspeechstart: ((this: SpeechRecognition, ev: Event) => any) | null; + onstart: ((this: SpeechRecognition, ev: Event) => any) | null; + serviceURI: string; + abort(): void; + start(): void; + stop(): void; + addEventListener(type: K, listener: (this: SpeechRecognition, ev: SpeechRecognitionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: SpeechRecognition, ev: SpeechRecognitionEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var SpeechRecognition: { + prototype: SpeechRecognition; + new(): SpeechRecognition; +}; + +interface SpeechRecognitionAlternative { + readonly confidence: number; + readonly transcript: string; +} + +declare var SpeechRecognitionAlternative: { + prototype: SpeechRecognitionAlternative; + new(): SpeechRecognitionAlternative; +}; + +interface SpeechRecognitionError extends Event { + readonly error: SpeechRecognitionErrorCode; + readonly message: string; +} + +declare var SpeechRecognitionError: { + prototype: SpeechRecognitionError; + new(): SpeechRecognitionError; +}; + +interface SpeechRecognitionEvent extends Event { + readonly emma: Document | null; + readonly interpretation: any; + readonly resultIndex: number; + readonly results: SpeechRecognitionResultList; +} + +declare var SpeechRecognitionEvent: { + prototype: SpeechRecognitionEvent; + new(): SpeechRecognitionEvent; +}; + +interface SpeechRecognitionResult { + readonly isFinal: boolean; + readonly length: number; + item(index: number): SpeechRecognitionAlternative; + [index: number]: SpeechRecognitionAlternative; +} + +declare var SpeechRecognitionResult: { + prototype: SpeechRecognitionResult; + new(): SpeechRecognitionResult; +}; + +interface SpeechRecognitionResultList { + readonly length: number; + item(index: number): SpeechRecognitionResult; + [index: number]: SpeechRecognitionResult; +} + +declare var SpeechRecognitionResultList: { + prototype: SpeechRecognitionResultList; + new(): SpeechRecognitionResultList; +}; + interface SpeechSynthesisEventMap { "voiceschanged": Event; } @@ -14014,9 +14219,17 @@ declare var SpeechSynthesis: { new(): SpeechSynthesis; }; +interface SpeechSynthesisErrorEvent extends SpeechSynthesisEvent { + readonly error: SpeechSynthesisErrorCode; +} + +declare var SpeechSynthesisErrorEvent: { + prototype: SpeechSynthesisErrorEvent; + new(): SpeechSynthesisErrorEvent; +}; + interface SpeechSynthesisEvent extends Event { readonly charIndex: number; - readonly charLength: number; readonly elapsedTime: number; readonly name: string; readonly utterance: SpeechSynthesisUtterance; @@ -14024,28 +14237,28 @@ interface SpeechSynthesisEvent extends Event { declare var SpeechSynthesisEvent: { prototype: SpeechSynthesisEvent; - new(type: string, eventInitDict?: SpeechSynthesisEventInit): SpeechSynthesisEvent; + new(): SpeechSynthesisEvent; }; interface SpeechSynthesisUtteranceEventMap { - "boundary": Event; - "end": Event; - "error": Event; - "mark": Event; - "pause": Event; - "resume": Event; - "start": Event; + "boundary": SpeechSynthesisEvent; + "end": SpeechSynthesisEvent; + "error": SpeechSynthesisErrorEvent; + "mark": SpeechSynthesisEvent; + "pause": SpeechSynthesisEvent; + "resume": SpeechSynthesisEvent; + "start": SpeechSynthesisEvent; } interface SpeechSynthesisUtterance extends EventTarget { lang: string; - onboundary: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null; - onend: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null; - onerror: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null; - onmark: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null; - onpause: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null; - onresume: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null; - onstart: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null; + onboundary: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null; + onend: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null; + onerror: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisErrorEvent) => any) | null; + onmark: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null; + onpause: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null; + onresume: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null; + onstart: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null; pitch: number; rate: number; text: string; @@ -14076,6 +14289,14 @@ declare var SpeechSynthesisVoice: { new(): SpeechSynthesisVoice; }; +interface StaticRange extends AbstractRange { +} + +declare var StaticRange: { + prototype: StaticRange; + new(): StaticRange; +}; + interface StereoPannerNode extends AudioNode { readonly pan: AudioParam; } @@ -14111,7 +14332,8 @@ interface Storage { /** * storage[key] = value */ - setItem(key: string, value: string): void; + setItem(key: string, value: string): void; + [name: string]: any; } declare var Storage: { @@ -14230,9 +14452,15 @@ declare var SyncManager: { new(): SyncManager; }; -interface Text extends CharacterData { +interface Text extends CharacterData, Slotable { readonly assignedSlot: HTMLSlotElement | null; + /** + * Returns the combined data of all direct Text node siblings. + */ readonly wholeText: string; + /** + * Splits data at the given offset and returns the remainder as Text node. + */ splitText(offset: number): Text; } @@ -14323,6 +14551,20 @@ declare var TextEvent: { }; interface TextMetrics { + readonly actualBoundingBoxAscent: number; + readonly actualBoundingBoxDescent: number; + readonly actualBoundingBoxLeft: number; + readonly actualBoundingBoxRight: number; + readonly alphabeticBaseline: number; + readonly emHeightAscent: number; + readonly emHeightDescent: number; + readonly fontBoundingBoxAscent: number; + readonly fontBoundingBoxDescent: number; + readonly hangingBaseline: number; + /** + * Returns the measurement described below. + */ + readonly ideographicBaseline: number; readonly width: number; } @@ -14516,8 +14758,6 @@ declare var TransitionEvent: { interface TreeWalker { currentNode: Node; - /** @deprecated */ - readonly expandEntityReferences: boolean; readonly filter: NodeFilter | null; readonly root: Node; readonly whatToShow: number; @@ -14710,6 +14950,45 @@ declare var VRPose: { new(): VRPose; }; +interface VTTCue extends TextTrackCue { + align: AlignSetting; + line: LineAndPositionSetting; + lineAlign: LineAlignSetting; + position: LineAndPositionSetting; + positionAlign: PositionAlignSetting; + region: VTTRegion | null; + size: number; + snapToLines: boolean; + text: string; + vertical: DirectionSetting; + getCueAsHTML(): DocumentFragment; + addEventListener(type: K, listener: (this: VTTCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: VTTCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var VTTCue: { + prototype: VTTCue; + new(startTime: number, endTime: number, text: string): VTTCue; +}; + +interface VTTRegion { + id: string; + lines: number; + regionAnchorX: number; + regionAnchorY: number; + scroll: ScrollSetting; + viewportAnchorX: number; + viewportAnchorY: number; + width: number; +} + +declare var VTTRegion: { + prototype: VTTRegion; + new(): VTTRegion; +}; + interface ValidityState { readonly badInput: boolean; readonly customError: boolean; @@ -15880,7 +16159,7 @@ declare var WheelEvent: { readonly DOM_DELTA_PIXEL: number; }; -interface WindowEventMap extends GlobalEventHandlersEventMap { +interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandlersEventMap { "abort": UIEvent; "afterprint": Event; "beforeprint": Event; @@ -15891,7 +16170,7 @@ interface WindowEventMap extends GlobalEventHandlersEventMap { "change": Event; "click": MouseEvent; "compassneedscalibration": Event; - "contextmenu": PointerEvent; + "contextmenu": MouseEvent; "dblclick": MouseEvent; "devicelight": DeviceLightEvent; "devicemotion": DeviceMotionEvent; @@ -15926,7 +16205,7 @@ interface WindowEventMap extends GlobalEventHandlersEventMap { "mouseout": MouseEvent; "mouseover": MouseEvent; "mouseup": MouseEvent; - "mousewheel": WheelEvent; + "mousewheel": Event; "MSGestureChange": Event; "MSGestureDoubleTap": Event; "MSGestureEnd": Event; @@ -15979,7 +16258,7 @@ interface WindowEventMap extends GlobalEventHandlersEventMap { "waiting": Event; } -interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64, GlobalFetch { +interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64, GlobalFetch, WindowOrWorkerGlobalScope, WindowEventHandlers { Blob: typeof Blob; URL: typeof URL; URLSearchParams: typeof URLSearchParams; @@ -15993,7 +16272,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window readonly devicePixelRatio: number; readonly doNotTrack: string; readonly document: Document; - event: Event | undefined; + readonly event: Event | undefined; /** @deprecated */ readonly external: External; readonly frameElement: Element; @@ -16007,56 +16286,14 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window readonly locationbar: BarProp; readonly menubar: BarProp; readonly msContentScript: ExtensionScriptApis; - readonly msCredentials: MSCredentials; name: string; readonly navigator: Navigator; offscreenBuffering: string | boolean; - onabort: ((this: Window, ev: UIEvent) => any) | null; - onafterprint: ((this: Window, ev: Event) => any) | null; - onbeforeprint: ((this: Window, ev: Event) => any) | null; - onbeforeunload: ((this: Window, ev: BeforeUnloadEvent) => any) | null; - onblur: ((this: Window, ev: FocusEvent) => any) | null; - oncanplay: ((this: Window, ev: Event) => any) | null; - oncanplaythrough: ((this: Window, ev: Event) => any) | null; - onchange: ((this: Window, ev: Event) => any) | null; - onclick: ((this: Window, ev: MouseEvent) => any) | null; oncompassneedscalibration: ((this: Window, ev: Event) => any) | null; - oncontextmenu: ((this: Window, ev: PointerEvent) => any) | null; - ondblclick: ((this: Window, ev: MouseEvent) => any) | null; ondevicelight: ((this: Window, ev: DeviceLightEvent) => any) | null; ondevicemotion: ((this: Window, ev: DeviceMotionEvent) => any) | null; ondeviceorientation: ((this: Window, ev: DeviceOrientationEvent) => any) | null; - ondrag: ((this: Window, ev: DragEvent) => any) | null; - ondragend: ((this: Window, ev: DragEvent) => any) | null; - ondragenter: ((this: Window, ev: DragEvent) => any) | null; - ondragleave: ((this: Window, ev: DragEvent) => any) | null; - ondragover: ((this: Window, ev: DragEvent) => any) | null; - ondragstart: ((this: Window, ev: DragEvent) => any) | null; - ondrop: ((this: Window, ev: DragEvent) => any) | null; - ondurationchange: ((this: Window, ev: Event) => any) | null; - onemptied: ((this: Window, ev: Event) => any) | null; - onended: ((this: Window, ev: Event) => any) | null; - onerror: ErrorEventHandler; - onfocus: ((this: Window, ev: FocusEvent) => any) | null; - onhashchange: ((this: Window, ev: HashChangeEvent) => any) | null; - oninput: ((this: Window, ev: Event) => any) | null; - oninvalid: ((this: Window, ev: Event) => any) | null; - onkeydown: ((this: Window, ev: KeyboardEvent) => any) | null; - onkeypress: ((this: Window, ev: KeyboardEvent) => any) | null; - onkeyup: ((this: Window, ev: KeyboardEvent) => any) | null; - onload: ((this: Window, ev: Event) => any) | null; - onloadeddata: ((this: Window, ev: Event) => any) | null; - onloadedmetadata: ((this: Window, ev: Event) => any) | null; - onloadstart: ((this: Window, ev: Event) => any) | null; - onmessage: ((this: Window, ev: MessageEvent) => any) | null; - onmousedown: ((this: Window, ev: MouseEvent) => any) | null; - onmouseenter: ((this: Window, ev: MouseEvent) => any) | null; - onmouseleave: ((this: Window, ev: MouseEvent) => any) | null; - onmousemove: ((this: Window, ev: MouseEvent) => any) | null; - onmouseout: ((this: Window, ev: MouseEvent) => any) | null; - onmouseover: ((this: Window, ev: MouseEvent) => any) | null; - onmouseup: ((this: Window, ev: MouseEvent) => any) | null; - onmousewheel: ((this: Window, ev: WheelEvent) => any) | null; + onmousewheel: ((this: Window, ev: Event) => any) | null; onmsgesturechange: ((this: Window, ev: Event) => any) | null; onmsgesturedoubletap: ((this: Window, ev: Event) => any) | null; onmsgestureend: ((this: Window, ev: Event) => any) | null; @@ -16072,31 +16309,9 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window onmspointerout: ((this: Window, ev: Event) => any) | null; onmspointerover: ((this: Window, ev: Event) => any) | null; onmspointerup: ((this: Window, ev: Event) => any) | null; - onoffline: ((this: Window, ev: Event) => any) | null; - ononline: ((this: Window, ev: Event) => any) | null; + /** @deprecated */ onorientationchange: ((this: Window, ev: Event) => any) | null; - onpagehide: ((this: Window, ev: PageTransitionEvent) => any) | null; - onpageshow: ((this: Window, ev: PageTransitionEvent) => any) | null; - onpause: ((this: Window, ev: Event) => any) | null; - onplay: ((this: Window, ev: Event) => any) | null; - onplaying: ((this: Window, ev: Event) => any) | null; - onpopstate: ((this: Window, ev: PopStateEvent) => any) | null; - onprogress: ((this: Window, ev: ProgressEvent) => any) | null; - onratechange: ((this: Window, ev: Event) => any) | null; onreadystatechange: ((this: Window, ev: ProgressEvent) => any) | null; - onreset: ((this: Window, ev: Event) => any) | null; - onresize: ((this: Window, ev: UIEvent) => any) | null; - onscroll: ((this: Window, ev: UIEvent) => any) | null; - onseeked: ((this: Window, ev: Event) => any) | null; - onseeking: ((this: Window, ev: Event) => any) | null; - onselect: ((this: Window, ev: UIEvent) => any) | null; - onstalled: ((this: Window, ev: Event) => any) | null; - onstorage: ((this: Window, ev: StorageEvent) => any) | null; - onsubmit: ((this: Window, ev: Event) => any) | null; - onsuspend: ((this: Window, ev: Event) => any) | null; - ontimeupdate: ((this: Window, ev: Event) => any) | null; - onunload: ((this: Window, ev: Event) => any) | null; - onvolumechange: ((this: Window, ev: Event) => any) | null; onvrdisplayactivate: ((this: Window, ev: Event) => any) | null; onvrdisplayblur: ((this: Window, ev: Event) => any) | null; onvrdisplayconnect: ((this: Window, ev: Event) => any) | null; @@ -16106,8 +16321,8 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window onvrdisplaypointerrestricted: ((this: Window, ev: Event) => any) | null; onvrdisplaypointerunrestricted: ((this: Window, ev: Event) => any) | null; onvrdisplaypresentchange: ((this: Window, ev: Event) => any) | null; - onwaiting: ((this: Window, ev: Event) => any) | null; opener: any; + /** @deprecated */ readonly orientation: string | number; readonly outerHeight: number; readonly outerWidth: number; @@ -16139,32 +16354,30 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window captureEvents(): void; close(): void; confirm(message?: string): boolean; - createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise; - createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise; departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void; focus(): void; getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration; getMatchedCSSRules(elt: Element, pseudoElt?: string | null): CSSRuleList; getSelection(): Selection; - matchMedia(mediaQuery: string): MediaQueryList; - moveBy(x?: number, y?: number): void; - moveTo(x?: number, y?: number): void; + matchMedia(query: string): MediaQueryList; + moveBy(x: number, y: number): void; + moveTo(x: number, y: number): void; msWriteProfilerMark(profilerMarkName: string): void; open(url?: string, target?: string, features?: string, replace?: boolean): Window | null; - postMessage(message: any, targetOrigin: string, transfer?: any[]): void; + postMessage(message: any, targetOrigin: string, transfer?: Transferable[]): void; print(): void; prompt(message?: string, _default?: string): string | null; /** @deprecated */ releaseEvents(): void; requestAnimationFrame(callback: FrameRequestCallback): number; - resizeBy(x?: number, y?: number): void; - resizeTo(x?: number, y?: number): void; + resizeBy(x: number, y: number): void; + resizeTo(x: number, y: number): void; scroll(options?: ScrollToOptions): void; - scroll(x?: number, y?: number): void; + scroll(x: number, y: number): void; scrollBy(options?: ScrollToOptions): void; - scrollBy(x?: number, y?: number): void; + scrollBy(x: number, y: number): void; scrollTo(options?: ScrollToOptions): void; - scrollTo(x?: number, y?: number): void; + scrollTo(x: number, y: number): void; stop(): void; webkitCancelAnimationFrame(handle: number): void; webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; @@ -16195,13 +16408,17 @@ interface WindowEventHandlersEventMap { "beforeprint": Event; "beforeunload": BeforeUnloadEvent; "hashchange": HashChangeEvent; + "languagechange": Event; "message": MessageEvent; + "messageerror": MessageEvent; "offline": Event; "online": Event; "pagehide": PageTransitionEvent; "pageshow": PageTransitionEvent; "popstate": PopStateEvent; + "rejectionhandled": Event; "storage": StorageEvent; + "unhandledrejection": PromiseRejectionEvent; "unload": Event; } @@ -16210,13 +16427,17 @@ interface WindowEventHandlers { onbeforeprint: ((this: WindowEventHandlers, ev: Event) => any) | null; onbeforeunload: ((this: WindowEventHandlers, ev: BeforeUnloadEvent) => any) | null; onhashchange: ((this: WindowEventHandlers, ev: HashChangeEvent) => any) | null; + onlanguagechange: ((this: WindowEventHandlers, ev: Event) => any) | null; onmessage: ((this: WindowEventHandlers, ev: MessageEvent) => any) | null; + onmessageerror: ((this: WindowEventHandlers, ev: MessageEvent) => any) | null; onoffline: ((this: WindowEventHandlers, ev: Event) => any) | null; ononline: ((this: WindowEventHandlers, ev: Event) => any) | null; onpagehide: ((this: WindowEventHandlers, ev: PageTransitionEvent) => any) | null; onpageshow: ((this: WindowEventHandlers, ev: PageTransitionEvent) => any) | null; onpopstate: ((this: WindowEventHandlers, ev: PopStateEvent) => any) | null; + onrejectionhandled: ((this: WindowEventHandlers, ev: Event) => any) | null; onstorage: ((this: WindowEventHandlers, ev: StorageEvent) => any) | null; + onunhandledrejection: ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any) | null; onunload: ((this: WindowEventHandlers, ev: Event) => any) | null; addEventListener(type: K, listener: (this: WindowEventHandlers, ev: WindowEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; @@ -16230,28 +16451,26 @@ interface WindowLocalStorage { interface WindowOrWorkerGlobalScope { readonly caches: CacheStorage; + readonly crypto: Crypto; readonly indexedDB: IDBFactory; + readonly origin: string; readonly performance: Performance; + atob(data: string): string; + btoa(data: string): string; + clearInterval(handle?: number): void; + clearTimeout(handle?: number): void; + createImageBitmap(image: ImageBitmapSource): Promise; + createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number): Promise; fetch(input: RequestInfo, init?: RequestInit): Promise; + setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number; + setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number; } interface WindowSessionStorage { readonly sessionStorage: Storage; } -interface WindowTimers extends WindowTimersExtension { - clearInterval(handle?: number): void; - clearTimeout(handle?: number): void; - setInterval(handler: (...args: any[]) => void, timeout: number): number; - setInterval(handler: any, timeout?: any, ...args: any[]): number; - setTimeout(handler: (...args: any[]) => void, timeout: number): number; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; -} - -interface WindowTimersExtension { - clearImmediate(handle: number): void; - setImmediate(handler: (...args: any[]) => void): number; - setImmediate(handler: any, ...args: any[]): number; +interface WindowTimers { } interface WorkerEventMap extends AbstractWorkerEventMap { @@ -16260,7 +16479,7 @@ interface WorkerEventMap extends AbstractWorkerEventMap { interface Worker extends EventTarget, AbstractWorker { onmessage: ((this: Worker, ev: MessageEvent) => any) | null; - postMessage(message: any, transfer?: any[]): void; + postMessage(message: any, transfer?: Transferable[]): void; terminate(): void; addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; @@ -16415,7 +16634,7 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { * Initiates the request. The optional argument provides the request body. The argument is ignored if request method is GET or HEAD. * Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set. */ - send(body?: Document | BodyInit): void; + send(body?: Document | BodyInit | null): void; /** * Combines a header in author request headers. * Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set. @@ -16590,6 +16809,10 @@ declare var webkitRTCPeerConnection: { declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; +interface BlobCallback { + (blob: Blob | null): void; +} + interface DecodeErrorCallback { (error: DOMException): void; } @@ -16618,10 +16841,6 @@ interface FunctionStringCallback { (data: string): void; } -interface GenerateAssertionCallback { - (contents: string, origin: string, options: RTCIdentityProviderOptions): Promise; -} - interface IntersectionObserverCallback { (entries: IntersectionObserverEntry[], observer: IntersectionObserver): void; } @@ -16630,10 +16849,6 @@ interface MSLaunchUriCallback { (): void; } -interface MediaQueryListListener { - (mql: MediaQueryList): void; -} - interface MutationCallback { (mutations: MutationRecord[], observer: MutationObserver): void; } @@ -16650,6 +16865,14 @@ interface NotificationPermissionCallback { (permission: NotificationPermission): void; } +interface OnBeforeUnloadEventHandlerNonNull { + (event: Event): string | null; +} + +interface OnErrorEventHandlerNonNull { + (event: Event | string, source?: string, lineno?: number, colno?: number, error?: any): any; +} + interface PerformanceObserverCallback { (entries: PerformanceObserverEntryList, observer: PerformanceObserver): void; } @@ -16674,10 +16897,6 @@ interface RTCStatsCallback { (report: RTCStatsReport): void; } -interface ValidateAssertionCallback { - (assertion: string, origin: string): Promise; -} - interface VoidFunction { (): void; } @@ -16697,7 +16916,6 @@ interface WritableStreamErrorCallback { interface HTMLElementTagNameMap { "a": HTMLAnchorElement; "abbr": HTMLElement; - "acronym": HTMLElement; "address": HTMLElement; "applet": HTMLAppletElement; "area": HTMLAreaElement; @@ -16708,14 +16926,12 @@ interface HTMLElementTagNameMap { "base": HTMLBaseElement; "basefont": HTMLBaseFontElement; "bdo": HTMLElement; - "big": HTMLElement; "blockquote": HTMLQuoteElement; "body": HTMLBodyElement; "br": HTMLBRElement; "button": HTMLButtonElement; "canvas": HTMLCanvasElement; "caption": HTMLTableCaptionElement; - "center": HTMLElement; "cite": HTMLElement; "code": HTMLElement; "col": HTMLTableColElement; @@ -16724,6 +16940,7 @@ interface HTMLElementTagNameMap { "datalist": HTMLDataListElement; "dd": HTMLElement; "del": HTMLModElement; + "details": HTMLDetailsElement; "dfn": HTMLElement; "dir": HTMLDirectoryElement; "div": HTMLDivElement; @@ -16755,14 +16972,11 @@ interface HTMLElementTagNameMap { "img": HTMLImageElement; "input": HTMLInputElement; "ins": HTMLModElement; - "isindex": HTMLUnknownElement; "kbd": HTMLElement; - "keygen": HTMLElement; "label": HTMLLabelElement; "legend": HTMLLegendElement; "li": HTMLLIElement; "link": HTMLLinkElement; - "listing": HTMLPreElement; "map": HTMLMapElement; "mark": HTMLElement; "marquee": HTMLMarqueeElement; @@ -16770,9 +16984,6 @@ interface HTMLElementTagNameMap { "meta": HTMLMetaElement; "meter": HTMLMeterElement; "nav": HTMLElement; - "nextid": HTMLUnknownElement; - "nobr": HTMLElement; - "noframes": HTMLElement; "noscript": HTMLElement; "object": HTMLObjectElement; "ol": HTMLOListElement; @@ -16782,7 +16993,6 @@ interface HTMLElementTagNameMap { "p": HTMLParagraphElement; "param": HTMLParamElement; "picture": HTMLPictureElement; - "plaintext": HTMLElement; "pre": HTMLPreElement; "progress": HTMLProgressElement; "q": HTMLQuoteElement; @@ -16797,7 +17007,6 @@ interface HTMLElementTagNameMap { "small": HTMLElement; "source": HTMLSourceElement; "span": HTMLSpanElement; - "strike": HTMLElement; "strong": HTMLElement; "style": HTMLStyleElement; "sub": HTMLElement; @@ -16814,12 +17023,15 @@ interface HTMLElementTagNameMap { "title": HTMLTitleElement; "tr": HTMLTableRowElement; "track": HTMLTrackElement; - "tt": HTMLElement; "u": HTMLElement; "ul": HTMLUListElement; "var": HTMLElement; "video": HTMLVideoElement; "wbr": HTMLElement; +} + +interface HTMLElementDeprecatedTagNameMap { + "listing": HTMLPreElement; "xmp": HTMLPreElement; } @@ -16918,56 +17130,14 @@ declare var location: Location; declare var locationbar: BarProp; declare var menubar: BarProp; declare var msContentScript: ExtensionScriptApis; -declare var msCredentials: MSCredentials; declare const name: never; declare var navigator: Navigator; declare var offscreenBuffering: string | boolean; -declare var onabort: ((this: Window, ev: UIEvent) => any) | null; -declare var onafterprint: ((this: Window, ev: Event) => any) | null; -declare var onbeforeprint: ((this: Window, ev: Event) => any) | null; -declare var onbeforeunload: ((this: Window, ev: BeforeUnloadEvent) => any) | null; -declare var onblur: ((this: Window, ev: FocusEvent) => any) | null; -declare var oncanplay: ((this: Window, ev: Event) => any) | null; -declare var oncanplaythrough: ((this: Window, ev: Event) => any) | null; -declare var onchange: ((this: Window, ev: Event) => any) | null; -declare var onclick: ((this: Window, ev: MouseEvent) => any) | null; declare var oncompassneedscalibration: ((this: Window, ev: Event) => any) | null; -declare var oncontextmenu: ((this: Window, ev: PointerEvent) => any) | null; -declare var ondblclick: ((this: Window, ev: MouseEvent) => any) | null; declare var ondevicelight: ((this: Window, ev: DeviceLightEvent) => any) | null; declare var ondevicemotion: ((this: Window, ev: DeviceMotionEvent) => any) | null; declare var ondeviceorientation: ((this: Window, ev: DeviceOrientationEvent) => any) | null; -declare var ondrag: ((this: Window, ev: DragEvent) => any) | null; -declare var ondragend: ((this: Window, ev: DragEvent) => any) | null; -declare var ondragenter: ((this: Window, ev: DragEvent) => any) | null; -declare var ondragleave: ((this: Window, ev: DragEvent) => any) | null; -declare var ondragover: ((this: Window, ev: DragEvent) => any) | null; -declare var ondragstart: ((this: Window, ev: DragEvent) => any) | null; -declare var ondrop: ((this: Window, ev: DragEvent) => any) | null; -declare var ondurationchange: ((this: Window, ev: Event) => any) | null; -declare var onemptied: ((this: Window, ev: Event) => any) | null; -declare var onended: ((this: Window, ev: Event) => any) | null; -declare var onerror: ErrorEventHandler; -declare var onfocus: ((this: Window, ev: FocusEvent) => any) | null; -declare var onhashchange: ((this: Window, ev: HashChangeEvent) => any) | null; -declare var oninput: ((this: Window, ev: Event) => any) | null; -declare var oninvalid: ((this: Window, ev: Event) => any) | null; -declare var onkeydown: ((this: Window, ev: KeyboardEvent) => any) | null; -declare var onkeypress: ((this: Window, ev: KeyboardEvent) => any) | null; -declare var onkeyup: ((this: Window, ev: KeyboardEvent) => any) | null; -declare var onload: ((this: Window, ev: Event) => any) | null; -declare var onloadeddata: ((this: Window, ev: Event) => any) | null; -declare var onloadedmetadata: ((this: Window, ev: Event) => any) | null; -declare var onloadstart: ((this: Window, ev: Event) => any) | null; -declare var onmessage: ((this: Window, ev: MessageEvent) => any) | null; -declare var onmousedown: ((this: Window, ev: MouseEvent) => any) | null; -declare var onmouseenter: ((this: Window, ev: MouseEvent) => any) | null; -declare var onmouseleave: ((this: Window, ev: MouseEvent) => any) | null; -declare var onmousemove: ((this: Window, ev: MouseEvent) => any) | null; -declare var onmouseout: ((this: Window, ev: MouseEvent) => any) | null; -declare var onmouseover: ((this: Window, ev: MouseEvent) => any) | null; -declare var onmouseup: ((this: Window, ev: MouseEvent) => any) | null; -declare var onmousewheel: ((this: Window, ev: WheelEvent) => any) | null; +declare var onmousewheel: ((this: Window, ev: Event) => any) | null; declare var onmsgesturechange: ((this: Window, ev: Event) => any) | null; declare var onmsgesturedoubletap: ((this: Window, ev: Event) => any) | null; declare var onmsgestureend: ((this: Window, ev: Event) => any) | null; @@ -16983,31 +17153,9 @@ declare var onmspointermove: ((this: Window, ev: Event) => any) | null; declare var onmspointerout: ((this: Window, ev: Event) => any) | null; declare var onmspointerover: ((this: Window, ev: Event) => any) | null; declare var onmspointerup: ((this: Window, ev: Event) => any) | null; -declare var onoffline: ((this: Window, ev: Event) => any) | null; -declare var ononline: ((this: Window, ev: Event) => any) | null; +/** @deprecated */ declare var onorientationchange: ((this: Window, ev: Event) => any) | null; -declare var onpagehide: ((this: Window, ev: PageTransitionEvent) => any) | null; -declare var onpageshow: ((this: Window, ev: PageTransitionEvent) => any) | null; -declare var onpause: ((this: Window, ev: Event) => any) | null; -declare var onplay: ((this: Window, ev: Event) => any) | null; -declare var onplaying: ((this: Window, ev: Event) => any) | null; -declare var onpopstate: ((this: Window, ev: PopStateEvent) => any) | null; -declare var onprogress: ((this: Window, ev: ProgressEvent) => any) | null; -declare var onratechange: ((this: Window, ev: Event) => any) | null; declare var onreadystatechange: ((this: Window, ev: ProgressEvent) => any) | null; -declare var onreset: ((this: Window, ev: Event) => any) | null; -declare var onresize: ((this: Window, ev: UIEvent) => any) | null; -declare var onscroll: ((this: Window, ev: UIEvent) => any) | null; -declare var onseeked: ((this: Window, ev: Event) => any) | null; -declare var onseeking: ((this: Window, ev: Event) => any) | null; -declare var onselect: ((this: Window, ev: UIEvent) => any) | null; -declare var onstalled: ((this: Window, ev: Event) => any) | null; -declare var onstorage: ((this: Window, ev: StorageEvent) => any) | null; -declare var onsubmit: ((this: Window, ev: Event) => any) | null; -declare var onsuspend: ((this: Window, ev: Event) => any) | null; -declare var ontimeupdate: ((this: Window, ev: Event) => any) | null; -declare var onunload: ((this: Window, ev: Event) => any) | null; -declare var onvolumechange: ((this: Window, ev: Event) => any) | null; declare var onvrdisplayactivate: ((this: Window, ev: Event) => any) | null; declare var onvrdisplayblur: ((this: Window, ev: Event) => any) | null; declare var onvrdisplayconnect: ((this: Window, ev: Event) => any) | null; @@ -17017,8 +17165,8 @@ declare var onvrdisplayfocus: ((this: Window, ev: Event) => any) | null; declare var onvrdisplaypointerrestricted: ((this: Window, ev: Event) => any) | null; declare var onvrdisplaypointerunrestricted: ((this: Window, ev: Event) => any) | null; declare var onvrdisplaypresentchange: ((this: Window, ev: Event) => any) | null; -declare var onwaiting: ((this: Window, ev: Event) => any) | null; declare var opener: any; +/** @deprecated */ declare var orientation: string | number; declare var outerHeight: number; declare var outerWidth: number; @@ -17050,57 +17198,227 @@ declare function cancelAnimationFrame(handle: number): void; declare function captureEvents(): void; declare function close(): void; declare function confirm(message?: string): boolean; -declare function createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise; -declare function createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise; declare function departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void; declare function focus(): void; declare function getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration; declare function getMatchedCSSRules(elt: Element, pseudoElt?: string | null): CSSRuleList; declare function getSelection(): Selection; -declare function matchMedia(mediaQuery: string): MediaQueryList; -declare function moveBy(x?: number, y?: number): void; -declare function moveTo(x?: number, y?: number): void; +declare function matchMedia(query: string): MediaQueryList; +declare function moveBy(x: number, y: number): void; +declare function moveTo(x: number, y: number): void; declare function msWriteProfilerMark(profilerMarkName: string): void; declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window | null; -declare function postMessage(message: any, targetOrigin: string, transfer?: any[]): void; +declare function postMessage(message: any, targetOrigin: string, transfer?: Transferable[]): void; declare function print(): void; declare function prompt(message?: string, _default?: string): string | null; /** @deprecated */ declare function releaseEvents(): void; declare function requestAnimationFrame(callback: FrameRequestCallback): number; -declare function resizeBy(x?: number, y?: number): void; -declare function resizeTo(x?: number, y?: number): void; +declare function resizeBy(x: number, y: number): void; +declare function resizeTo(x: number, y: number): void; declare function scroll(options?: ScrollToOptions): void; -declare function scroll(x?: number, y?: number): void; +declare function scroll(x: number, y: number): void; declare function scrollBy(options?: ScrollToOptions): void; -declare function scrollBy(x?: number, y?: number): void; +declare function scrollBy(x: number, y: number): void; declare function scrollTo(options?: ScrollToOptions): void; -declare function scrollTo(x?: number, y?: number): void; +declare function scrollTo(x: number, y: number): void; declare function stop(): void; declare function webkitCancelAnimationFrame(handle: number): void; declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; declare function webkitRequestAnimationFrame(callback: FrameRequestCallback): number; declare function toString(): string; -declare function dispatchEvent(evt: Event): boolean; -declare function clearInterval(handle?: number): void; -declare function clearTimeout(handle?: number): void; -declare function setInterval(handler: (...args: any[]) => void, timeout: number): number; -declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function setTimeout(handler: (...args: any[]) => void, timeout: number): number; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; -declare function clearImmediate(handle: number): void; -declare function setImmediate(handler: (...args: any[]) => void): number; -declare function setImmediate(handler: any, ...args: any[]): number; +/** + * Dispatches a synthetic event event to target and returns true + * if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. + */ +declare function dispatchEvent(event: Event): boolean; declare var sessionStorage: Storage; declare var localStorage: Storage; declare var console: Console; +/** + * Fires when the user aborts the download. + * @param ev The event. + */ +declare var onabort: ((this: Window, ev: UIEvent) => any) | null; declare var onanimationcancel: ((this: Window, ev: AnimationEvent) => any) | null; declare var onanimationend: ((this: Window, ev: AnimationEvent) => any) | null; declare var onanimationiteration: ((this: Window, ev: AnimationEvent) => any) | null; declare var onanimationstart: ((this: Window, ev: AnimationEvent) => any) | null; +declare var onauxclick: ((this: Window, ev: Event) => any) | null; +/** + * Fires when the object loses the input focus. + * @param ev The focus event. + */ +declare var onblur: ((this: Window, ev: FocusEvent) => any) | null; +declare var oncancel: ((this: Window, ev: Event) => any) | null; +/** + * Occurs when playback is possible, but would require further buffering. + * @param ev The event. + */ +declare var oncanplay: ((this: Window, ev: Event) => any) | null; +declare var oncanplaythrough: ((this: Window, ev: Event) => any) | null; +/** + * Fires when the contents of the object or selection have changed. + * @param ev The event. + */ +declare var onchange: ((this: Window, ev: Event) => any) | null; +/** + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. + */ +declare var onclick: ((this: Window, ev: MouseEvent) => any) | null; +declare var onclose: ((this: Window, ev: Event) => any) | null; +/** + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. + */ +declare var oncontextmenu: ((this: Window, ev: MouseEvent) => any) | null; +declare var oncuechange: ((this: Window, ev: Event) => any) | null; +/** + * Fires when the user double-clicks the object. + * @param ev The mouse event. + */ +declare var ondblclick: ((this: Window, ev: MouseEvent) => any) | null; +/** + * Fires on the source object continuously during a drag operation. + * @param ev The event. + */ +declare var ondrag: ((this: Window, ev: DragEvent) => any) | null; +/** + * Fires on the source object when the user releases the mouse at the close of a drag operation. + * @param ev The event. + */ +declare var ondragend: ((this: Window, ev: DragEvent) => any) | null; +/** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. + */ +declare var ondragenter: ((this: Window, ev: DragEvent) => any) | null; +declare var ondragexit: ((this: Window, ev: Event) => any) | null; +/** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. + */ +declare var ondragleave: ((this: Window, ev: DragEvent) => any) | null; +/** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. + */ +declare var ondragover: ((this: Window, ev: DragEvent) => any) | null; +/** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. + */ +declare var ondragstart: ((this: Window, ev: DragEvent) => any) | null; +declare var ondrop: ((this: Window, ev: DragEvent) => any) | null; +/** + * Occurs when the duration attribute is updated. + * @param ev The event. + */ +declare var ondurationchange: ((this: Window, ev: Event) => any) | null; +/** + * Occurs when the media element is reset to its initial state. + * @param ev The event. + */ +declare var onemptied: ((this: Window, ev: Event) => any) | null; +/** + * Occurs when the end of playback is reached. + * @param ev The event + */ +declare var onended: ((this: Window, ev: Event) => any) | null; +/** + * Fires when an error occurs during object loading. + * @param ev The event. + */ +declare var onerror: ((this: Window, ev: ErrorEvent) => any) | null; +/** + * Fires when the object receives focus. + * @param ev The event. + */ +declare var onfocus: ((this: Window, ev: FocusEvent) => any) | null; declare var ongotpointercapture: ((this: Window, ev: PointerEvent) => any) | null; +declare var oninput: ((this: Window, ev: Event) => any) | null; +declare var oninvalid: ((this: Window, ev: Event) => any) | null; +/** + * Fires when the user presses a key. + * @param ev The keyboard event + */ +declare var onkeydown: ((this: Window, ev: KeyboardEvent) => any) | null; +/** + * Fires when the user presses an alphanumeric key. + * @param ev The event. + */ +declare var onkeypress: ((this: Window, ev: KeyboardEvent) => any) | null; +/** + * Fires when the user releases a key. + * @param ev The keyboard event + */ +declare var onkeyup: ((this: Window, ev: KeyboardEvent) => any) | null; +/** + * Fires immediately after the browser loads the object. + * @param ev The event. + */ +declare var onload: ((this: Window, ev: Event) => any) | null; +/** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. + */ +declare var onloadeddata: ((this: Window, ev: Event) => any) | null; +/** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. + */ +declare var onloadedmetadata: ((this: Window, ev: Event) => any) | null; +declare var onloadend: ((this: Window, ev: ProgressEvent) => any) | null; +/** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. + */ +declare var onloadstart: ((this: Window, ev: Event) => any) | null; declare var onlostpointercapture: ((this: Window, ev: PointerEvent) => any) | null; +/** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. + */ +declare var onmousedown: ((this: Window, ev: MouseEvent) => any) | null; +declare var onmouseenter: ((this: Window, ev: MouseEvent) => any) | null; +declare var onmouseleave: ((this: Window, ev: MouseEvent) => any) | null; +/** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. + */ +declare var onmousemove: ((this: Window, ev: MouseEvent) => any) | null; +/** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. + */ +declare var onmouseout: ((this: Window, ev: MouseEvent) => any) | null; +/** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. + */ +declare var onmouseover: ((this: Window, ev: MouseEvent) => any) | null; +/** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. + */ +declare var onmouseup: ((this: Window, ev: MouseEvent) => any) | null; +/** + * Occurs when playback is paused. + * @param ev The event. + */ +declare var onpause: ((this: Window, ev: Event) => any) | null; +/** + * Occurs when the play method is requested. + * @param ev The event. + */ +declare var onplay: ((this: Window, ev: Event) => any) | null; +/** + * Occurs when the audio or video has started playing. + * @param ev The event. + */ +declare var onplaying: ((this: Window, ev: Event) => any) | null; declare var onpointercancel: ((this: Window, ev: PointerEvent) => any) | null; declare var onpointerdown: ((this: Window, ev: PointerEvent) => any) | null; declare var onpointerenter: ((this: Window, ev: PointerEvent) => any) | null; @@ -17109,6 +17427,60 @@ declare var onpointermove: ((this: Window, ev: PointerEvent) => any) | null; declare var onpointerout: ((this: Window, ev: PointerEvent) => any) | null; declare var onpointerover: ((this: Window, ev: PointerEvent) => any) | null; declare var onpointerup: ((this: Window, ev: PointerEvent) => any) | null; +/** + * Occurs to indicate progress while downloading media data. + * @param ev The event. + */ +declare var onprogress: ((this: Window, ev: ProgressEvent) => any) | null; +/** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. + */ +declare var onratechange: ((this: Window, ev: Event) => any) | null; +/** + * Fires when the user resets a form. + * @param ev The event. + */ +declare var onreset: ((this: Window, ev: Event) => any) | null; +declare var onresize: ((this: Window, ev: UIEvent) => any) | null; +/** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. + */ +declare var onscroll: ((this: Window, ev: UIEvent) => any) | null; +declare var onsecuritypolicyviolation: ((this: Window, ev: SecurityPolicyViolationEvent) => any) | null; +/** + * Occurs when the seek operation ends. + * @param ev The event. + */ +declare var onseeked: ((this: Window, ev: Event) => any) | null; +/** + * Occurs when the current playback position is moved. + * @param ev The event. + */ +declare var onseeking: ((this: Window, ev: Event) => any) | null; +/** + * Fires when the current selection changes. + * @param ev The event. + */ +declare var onselect: ((this: Window, ev: UIEvent) => any) | null; +/** + * Occurs when the download has stopped. + * @param ev The event. + */ +declare var onstalled: ((this: Window, ev: Event) => any) | null; +declare var onsubmit: ((this: Window, ev: Event) => any) | null; +/** + * Occurs if the load operation has been intentionally halted. + * @param ev The event. + */ +declare var onsuspend: ((this: Window, ev: Event) => any) | null; +/** + * Occurs to indicate the current playback position. + * @param ev The event. + */ +declare var ontimeupdate: ((this: Window, ev: Event) => any) | null; +declare var ontoggle: ((this: Window, ev: Event) => any) | null; declare var ontouchcancel: ((this: Window, ev: TouchEvent) => any) | null; declare var ontouchend: ((this: Window, ev: TouchEvent) => any) | null; declare var ontouchmove: ((this: Window, ev: TouchEvent) => any) | null; @@ -17117,13 +17489,53 @@ declare var ontransitioncancel: ((this: Window, ev: TransitionEvent) => any) | n declare var ontransitionend: ((this: Window, ev: TransitionEvent) => any) | null; declare var ontransitionrun: ((this: Window, ev: TransitionEvent) => any) | null; declare var ontransitionstart: ((this: Window, ev: TransitionEvent) => any) | null; +/** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. + */ +declare var onvolumechange: ((this: Window, ev: Event) => any) | null; +/** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. + */ +declare var onwaiting: ((this: Window, ev: Event) => any) | null; declare var onwheel: ((this: Window, ev: WheelEvent) => any) | null; declare var indexedDB: IDBFactory; declare function atob(encodedString: string): string; declare function btoa(rawString: string): string; -declare function fetch(input?: Request | string, init?: RequestInit): Promise; +declare function fetch(input: RequestInfo, init?: RequestInit): Promise; +declare var caches: CacheStorage; +declare var crypto: Crypto; +declare var indexedDB: IDBFactory; +declare var origin: string; +declare var performance: Performance; +declare function atob(data: string): string; +declare function btoa(data: string): string; +declare function clearInterval(handle?: number): void; +declare function clearTimeout(handle?: number): void; +declare function createImageBitmap(image: ImageBitmapSource): Promise; +declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number): Promise; +declare function fetch(input: RequestInfo, init?: RequestInit): Promise; +declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number; +declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number; declare var sessionStorage: Storage; declare var localStorage: Storage; +declare var onafterprint: ((this: Window, ev: Event) => any) | null; +declare var onbeforeprint: ((this: Window, ev: Event) => any) | null; +declare var onbeforeunload: ((this: Window, ev: BeforeUnloadEvent) => any) | null; +declare var onhashchange: ((this: Window, ev: HashChangeEvent) => any) | null; +declare var onlanguagechange: ((this: Window, ev: Event) => any) | null; +declare var onmessage: ((this: Window, ev: MessageEvent) => any) | null; +declare var onmessageerror: ((this: Window, ev: MessageEvent) => any) | null; +declare var onoffline: ((this: Window, ev: Event) => any) | null; +declare var ononline: ((this: Window, ev: Event) => any) | null; +declare var onpagehide: ((this: Window, ev: PageTransitionEvent) => any) | null; +declare var onpageshow: ((this: Window, ev: PageTransitionEvent) => any) | null; +declare var onpopstate: ((this: Window, ev: PopStateEvent) => any) | null; +declare var onrejectionhandled: ((this: Window, ev: Event) => any) | null; +declare var onstorage: ((this: Window, ev: StorageEvent) => any) | null; +declare var onunhandledrejection: ((this: Window, ev: PromiseRejectionEvent) => any) | null; +declare var onunload: ((this: Window, ev: Event) => any) | null; declare function addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; declare function removeEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -17133,69 +17545,62 @@ type HeadersInit = Headers | string[][] | Record; type BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream | string; type RequestInfo = Request | string; type DOMHighResTimeStamp = number; +type RenderingContext = CanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext; +type HTMLOrSVGImageElement = HTMLImageElement | SVGImageElement; +type CanvasImageSource = HTMLOrSVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap; +type MessageEventSource = WindowProxy | MessagePort | ServiceWorker; +type HTMLOrSVGScriptElement = HTMLScriptElement | SVGScriptElement; +type ImageBitmapSource = CanvasImageSource | Blob | ImageData; +type OnErrorEventHandler = OnErrorEventHandlerNonNull | null; +type OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull | null; +type TimerHandler = string | Function; type PerformanceEntryList = PerformanceEntry[]; -type PushMessageDataInit = BufferSource | string; type VibratePattern = number | number[]; +type AlgorithmIdentifier = string | Algorithm; +type HashAlgorithmIdentifier = AlgorithmIdentifier; +type BigInteger = Uint8Array; +type NamedCurve = string; type BufferSource = ArrayBufferView | ArrayBuffer; type DOMTimeStamp = number; +type LineAndPositionSetting = number | AutoKeyword; type FormDataEntryValue = File | string; -type ScrollBehavior = "auto" | "instant" | "smooth"; -type ScrollLogicalPosition = "start" | "center" | "end" | "nearest"; -type MouseWheelEvent = WheelEvent; -type ScrollRestoration = "auto" | "manual"; type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend"; -type OrientationLockType = "any" | "natural" | "portrait" | "landscape" | "portrait-primary" | "portrait-secondary" | "landscape-primary"| "landscape-secondary"; type IDBValidKey = number | string | Date | BufferSource | IDBArrayKey; -type AlgorithmIdentifier = string | Algorithm; type MutationRecordType = "attributes" | "characterData" | "childList"; -type AAGUID = string; -type ByteString = string; type ConstrainBoolean = boolean | ConstrainBooleanParameters; type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; type ConstrainDouble = number | ConstrainDoubleRange; type ConstrainLong = number | ConstrainLongRange; -type CryptoOperationData = ArrayBufferView; -type GLbitfield = number; -type GLboolean = boolean; -type GLbyte = number; -type GLclampf = number; -type GLenum = number; -type GLfloat = number; -type GLint = number; -type GLintptr = number; -type GLshort = number; -type GLsizei = number; -type GLsizeiptr = number; -type GLubyte = number; -type GLuint = number; -type GLushort = number; type IDBKeyPath = string; -type MSInboundPayload = MSVideoRecvPayload | MSAudioRecvPayload; -type MSLocalClientEvent = MSLocalClientEventBase | MSAudioLocalClientEvent; -type MSOutboundPayload = MSVideoSendPayload | MSAudioSendPayload; +type Transferable = ArrayBuffer | MessagePort | ImageBitmap; type RTCIceGatherCandidate = RTCIceCandidateDictionary | RTCIceCandidateComplete; type RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport; -type USVString = string; -type payloadtype = number; -type MessageEventSource = Window | MessagePort | ServiceWorker; +type WindowProxy = Window; +type AlignSetting = "start" | "center" | "end" | "left" | "right"; type AnimationPlayState = "idle" | "running" | "paused" | "finished"; type AppendMode = "segments" | "sequence"; type AudioContextLatencyCategory = "balanced" | "interactive" | "playback"; type AudioContextState = "suspended" | "running" | "closed"; +type AutoKeyword = "auto"; type AutomationRate = "a-rate" | "k-rate"; type BinaryType = "blob" | "arraybuffer"; type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass"; type CanPlayTypeResult = "" | "maybe" | "probably"; +type CanvasDirection = "ltr" | "rtl" | "inherit"; type CanvasFillRule = "nonzero" | "evenodd"; +type CanvasLineCap = "butt" | "round" | "square"; +type CanvasLineJoin = "round" | "bevel" | "miter"; +type CanvasTextAlign = "start" | "end" | "left" | "right" | "center"; +type CanvasTextBaseline = "top" | "hanging" | "middle" | "alphabetic" | "ideographic" | "bottom"; type ChannelCountMode = "max" | "clamped-max" | "explicit"; type ChannelInterpretation = "speakers" | "discrete"; type ClientTypes = "window" | "worker" | "sharedworker" | "all"; type CompositeOperation = "replace" | "add" | "accumulate"; +type DirectionSetting = "" | "rl" | "lr"; type DisplayCaptureSurfaceType = "monitor" | "window" | "application" | "browser"; type DistanceModelType = "linear" | "inverse" | "exponential"; type DocumentReadyState = "loading" | "interactive" | "complete"; type EndOfStreamError = "network" | "decode"; -type ExpandGranularity = "character" | "word" | "sentence" | "textedit"; type FillMode = "none" | "forwards" | "backwards" | "both" | "auto"; type GamepadHand = "" | "left" | "right"; type GamepadHapticActuatorType = "vibration"; @@ -17204,15 +17609,14 @@ type GamepadMappingType = "" | "standard"; type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique"; type IDBRequestReadyState = "pending" | "done"; type IDBTransactionMode = "readonly" | "readwrite" | "versionchange"; +type ImageSmoothingQuality = "low" | "medium" | "high"; type IterationCompositeOperation = "replace" | "accumulate"; type KeyFormat = "raw" | "spki" | "pkcs8" | "jwk"; type KeyType = "public" | "private" | "secret"; type KeyUsage = "encrypt" | "decrypt" | "sign" | "verify" | "deriveKey" | "deriveBits" | "wrapKey" | "unwrapKey"; +type LineAlignSetting = "start" | "center" | "end"; type ListeningState = "inactive" | "active" | "disambiguation"; type MSCredentialType = "FIDO_2_0"; -type MSIceAddrType = "os" | "stun" | "turn" | "peer-derived"; -type MSIceType = "failed" | "direct" | "relay"; -type MSStatsType = "description" | "localclientevent" | "inbound-network" | "outbound-network" | "inbound-payload" | "outbound-payload" | "transportdiagnostics"; type MSTransportType = "Embedded" | "USB" | "NFC" | "BT"; type MSWebViewPermissionState = "unknown" | "defer" | "allow" | "deny"; type MSWebViewPermissionType = "geolocation" | "unlimitedIndexedDBQuota" | "media" | "pointerlock" | "webnotifications"; @@ -17226,12 +17630,15 @@ type NavigationReason = "up" | "down" | "left" | "right"; type NavigationType = "navigate" | "reload" | "back_forward" | "prerender"; type NotificationDirection = "auto" | "ltr" | "rtl"; type NotificationPermission = "default" | "denied" | "granted"; +type OrientationLockType = "any" | "natural" | "landscape" | "portrait" | "portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary"; +type OrientationType = "portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary"; type OscillatorType = "sine" | "square" | "sawtooth" | "triangle" | "custom"; type OverSampleType = "none" | "2x" | "4x"; type PanningModelType = "equalpower" | "HRTF"; type PaymentComplete = "success" | "fail" | "unknown"; type PaymentShippingType = "shipping" | "delivery" | "pickup"; type PlaybackDirection = "normal" | "reverse" | "alternate" | "alternate-reverse"; +type PositionAlignSetting = "line-left" | "center" | "line-right" | "auto"; type PushEncryptionKeyName = "p256dh" | "auth"; type PushPermissionState = "denied" | "granted" | "prompt"; type RTCBundlePolicy = "balanced" | "max-compat" | "max-bundle"; @@ -17257,7 +17664,7 @@ type RTCPeerConnectionState = "new" | "connecting" | "connected" | "disconnected type RTCPriorityType = "very-low" | "low" | "medium" | "high"; type RTCRtcpMuxPolicy = "negotiate" | "require"; type RTCRtpTransceiverDirection = "sendrecv" | "sendonly" | "recvonly" | "inactive"; -type RTCSctpTransportState = "new" | "connecting" | "connected" | "closed"; +type RTCSctpTransportState = "connecting" | "connected" | "closed"; type RTCSdpType = "offer" | "pranswer" | "answer" | "rollback"; type RTCSignalingState = "stable" | "have-local-offer" | "have-remote-offer" | "have-local-pranswer" | "have-remote-pranswer" | "closed"; type RTCStatsIceCandidatePairState = "frozen" | "waiting" | "inprogress" | "failed" | "succeeded" | "cancelled"; @@ -17272,16 +17679,22 @@ type RequestMode = "navigate" | "same-origin" | "no-cors" | "cors"; type RequestRedirect = "follow" | "error" | "manual"; type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect"; type ScopedCredentialType = "ScopedCred"; +type ScrollBehavior = "auto" | "instant" | "smooth"; +type ScrollLogicalPosition = "start" | "center" | "end" | "nearest"; +type ScrollRestoration = "auto" | "manual"; +type ScrollSetting = "" | "up"; type SelectionMode = "select" | "start" | "end" | "preserve"; type ServiceWorkerState = "installing" | "installed" | "activating" | "activated" | "redundant"; type ServiceWorkerUpdateViaCache = "imports" | "all" | "none"; +type ShadowRootMode = "open" | "closed"; +type SpeechRecognitionErrorCode = "no-speech" | "aborted" | "audio-capture" | "network" | "not-allowed" | "service-not-allowed" | "bad-grammar" | "language-not-supported"; +type SpeechSynthesisErrorCode = "canceled" | "interrupted" | "audio-busy" | "audio-hardware" | "network" | "synthesis-unavailable" | "synthesis-failed" | "language-unavailable" | "voice-unavailable" | "text-too-long" | "invalid-argument"; type TextTrackKind = "subtitles" | "captions" | "descriptions" | "chapters" | "metadata"; type TextTrackMode = "disabled" | "hidden" | "showing"; type TouchType = "direct" | "stylus"; type Transport = "usb" | "nfc" | "ble"; type VRDisplayEventReason = "mounted" | "navigation" | "requested" | "unmounted"; -type VREye = "left" | "right"; type VideoFacingModeEnum = "user" | "environment" | "left" | "right"; -type VisibilityState = "hidden" | "visible" | "prerender" | "unloaded"; +type VisibilityState = "hidden" | "visible" | "prerender"; type WorkerType = "classic" | "module"; -type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text"; \ No newline at end of file +type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text"; diff --git a/src/lib/dom.iterable.generated.d.ts b/src/lib/dom.iterable.generated.d.ts index 2bb1df54f55..9e4d71380c5 100644 --- a/src/lib/dom.iterable.generated.d.ts +++ b/src/lib/dom.iterable.generated.d.ts @@ -31,10 +31,13 @@ interface DOMStringList { interface DOMTokenList { [Symbol.iterator](): IterableIterator; + entries(): IterableIterator<[number, string]>; + keys(): IterableIterator; + values(): IterableIterator; } interface DataTransferItemList { - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): IterableIterator; } interface FileList { @@ -67,9 +70,10 @@ interface HTMLCollectionBase { interface HTMLCollectionOf { [Symbol.iterator](): IterableIterator; - entries(): IterableIterator<[number, T]>; - keys(): IterableIterator; - values(): IterableIterator; +} + +interface HTMLFormElement { + [Symbol.iterator](): IterableIterator; } interface HTMLSelectElement { @@ -147,10 +151,34 @@ interface PluginArray { interface RTCStatsReport extends ReadonlyMap { } +interface SVGLengthList { + [Symbol.iterator](): IterableIterator; +} + +interface SVGNumberList { + [Symbol.iterator](): IterableIterator; +} + +interface SVGStringList { + [Symbol.iterator](): IterableIterator; +} + interface SourceBufferList { [Symbol.iterator](): IterableIterator; } +interface SpeechGrammarList { + [Symbol.iterator](): IterableIterator; +} + +interface SpeechRecognitionResult { + [Symbol.iterator](): IterableIterator; +} + +interface SpeechRecognitionResultList { + [Symbol.iterator](): IterableIterator; +} + interface StyleSheetList { [Symbol.iterator](): IterableIterator; } diff --git a/src/lib/webworker.generated.d.ts b/src/lib/webworker.generated.d.ts index b177115395b..8e180bcec19 100644 --- a/src/lib/webworker.generated.d.ts +++ b/src/lib/webworker.generated.d.ts @@ -7,6 +7,33 @@ interface AddEventListenerOptions extends EventListenerOptions { passive?: boolean; } +interface AesCbcParams extends Algorithm { + iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; +} + +interface AesCtrParams extends Algorithm { + counter: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; + length: number; +} + +interface AesDerivedKeyParams extends Algorithm { + length: number; +} + +interface AesGcmParams extends Algorithm { + additionalData?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; + iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; + tagLength?: number; +} + +interface AesKeyAlgorithm extends KeyAlgorithm { + length: number; +} + +interface AesKeyGenParams extends Algorithm { + length: number; +} + interface Algorithm { name: string; } @@ -33,6 +60,15 @@ interface CloseEventInit extends EventInit { wasClean?: boolean; } +interface CryptoKeyPair { + privateKey?: CryptoKey; + publicKey?: CryptoKey; +} + +interface CustomEventInit extends EventInit { + detail?: T; +} + interface DOMMatrix2DInit { a?: number; b?: number; @@ -83,6 +119,22 @@ interface DOMRectInit { y?: number; } +interface EcKeyGenParams extends Algorithm { + namedCurve: NamedCurve; +} + +interface EcKeyImportParams extends Algorithm { + namedCurve: NamedCurve; +} + +interface EcdhKeyDeriveParams extends Algorithm { + public: CryptoKey; +} + +interface EcdsaParams extends Algorithm { + hash: HashAlgorithmIdentifier; +} + interface ErrorEventInit extends EventInit { colno?: number; error?: any; @@ -109,12 +161,12 @@ interface ExtendableMessageEventInit extends ExtendableEventInit { lastEventId?: string; origin?: string; ports?: MessagePort[]; - source?: Client | ServiceWorker | MessagePort; + source?: Client | ServiceWorker | MessagePort | null; } interface FetchEventInit extends ExtendableEventInit { clientId?: string; - preloadResponse: Promise; + preloadResponse?: Promise; request: Request; resultingClientId?: string; targetClientId?: string; @@ -128,6 +180,16 @@ interface GetNotificationOptions { tag?: string; } +interface HmacImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; +} + +interface HmacKeyGenParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; +} + interface IDBIndexParameters { multiEntry?: boolean; unique?: boolean; @@ -135,7 +197,7 @@ interface IDBIndexParameters { interface IDBObjectStoreParameters { autoIncrement?: boolean; - keyPath?: string | string[]; + keyPath?: string | string[] | null; } interface IDBVersionChangeEventInit extends EventInit { @@ -143,17 +205,37 @@ interface IDBVersionChangeEventInit extends EventInit { oldVersion?: number; } +interface JsonWebKey { + alg?: string; + crv?: string; + d?: string; + dp?: string; + dq?: string; + e?: string; + ext?: boolean; + k?: string; + key_ops?: string[]; + kty?: string; + n?: string; + oth?: RsaOtherPrimesInfo[]; + p?: string; + q?: string; + qi?: string; + use?: string; + x?: string; + y?: string; +} + interface KeyAlgorithm { name: string; } interface MessageEventInit extends EventInit { - channel?: string; data?: any; lastEventId?: string; origin?: string; ports?: MessagePort[]; - source?: object | null; + source?: MessageEventSource | null; } interface NavigationPreloadState { @@ -189,6 +271,12 @@ interface NotificationOptions { vibrate?: VibratePattern; } +interface Pbkdf2Params extends Algorithm { + hash: HashAlgorithmIdentifier; + iterations: number; + salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; +} + interface PerformanceObserverInit { buffered?: boolean; entryTypes: string[]; @@ -221,7 +309,7 @@ interface PushSubscriptionJSON { } interface PushSubscriptionOptionsInit { - applicationServerKey?: BufferSource | string; + applicationServerKey?: BufferSource | string | null; userVisibleOnly?: boolean; } @@ -243,7 +331,7 @@ interface RequestInit { redirect?: RequestRedirect; referrer?: string; referrerPolicy?: ReferrerPolicy; - signal?: object | null; + signal?: AbortSignal | null; window?: any; } @@ -253,6 +341,33 @@ interface ResponseInit { statusText?: string; } +interface RsaHashedImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; +} + +interface RsaHashedKeyGenParams extends RsaKeyGenParams { + hash: HashAlgorithmIdentifier; +} + +interface RsaKeyGenParams extends Algorithm { + modulusLength: number; + publicExponent: BigInteger; +} + +interface RsaOaepParams extends Algorithm { + label?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer; +} + +interface RsaOtherPrimesInfo { + d?: string; + r?: string; + t?: string; +} + +interface RsaPssParams extends Algorithm { + saltLength: number; +} + interface StorageEstimate { quota?: number; usage?: number; @@ -276,6 +391,45 @@ interface EventListener { (evt: Event): void; } +interface AbortController { + /** + * Returns the AbortSignal object associated with this object. + */ + readonly signal: AbortSignal; + /** + * Invoking this method will set this object's AbortSignal's aborted flag and + * signal to any observers that the associated activity is to be aborted. + */ + abort(): void; +} + +declare var AbortController: { + prototype: AbortController; + new(): AbortController; +}; + +interface AbortSignalEventMap { + "abort": ProgressEvent; +} + +interface AbortSignal extends EventTarget { + /** + * Returns true if this AbortSignal's AbortController has signaled to abort, and false + * otherwise. + */ + readonly aborted: boolean; + onabort: ((this: AbortSignal, ev: ProgressEvent) => any) | null; + addEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var AbortSignal: { + prototype: AbortSignal; + new(): AbortSignal; +}; + interface AbstractWorkerEventMap { "error": ErrorEvent; } @@ -381,11 +535,52 @@ declare var CacheStorage: { new(): CacheStorage; }; +interface CanvasGradient { + /** + * Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset + * at one end of the gradient, 1.0 is the offset at the other end. + * Throws an "IndexSizeError" DOMException if the offset + * is out of range. Throws a "SyntaxError" DOMException if + * the color cannot be parsed. + */ + addColorStop(offset: number, color: string): void; +} + +declare var CanvasGradient: { + prototype: CanvasGradient; + new(): CanvasGradient; +}; + +interface CanvasPath { + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + closePath(): void; + ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + lineTo(x: number, y: number): void; + moveTo(x: number, y: number): void; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + rect(x: number, y: number, w: number, h: number): void; +} + +interface CanvasPattern { + /** + * Sets the transformation matrix that will be used when rendering the pattern during a fill or + * stroke painting operation. + */ + setTransform(transform?: DOMMatrix2DInit): void; +} + +declare var CanvasPattern: { + prototype: CanvasPattern; + new(): CanvasPattern; +}; + interface Client { readonly id: string; readonly type: ClientTypes; readonly url: string; - postMessage(message: any, transfer?: any[]): void; + postMessage(message: any, transfer?: Transferable[]): void; } declare var Client: { @@ -443,10 +638,8 @@ interface Console { info(message?: any, ...optionalParams: any[]): void; log(message?: any, ...optionalParams: any[]): void; markTimeline(label?: string): void; - msIsIndependentlyComposed(element: object): boolean; profile(reportName?: string): void; - profileEnd(): void; - select(element: object): void; + profileEnd(reportName?: string): void; table(...tabularData: any[]): void; time(label?: string): void; timeEnd(label?: string): void; @@ -462,11 +655,21 @@ declare var Console: { new(): Console; }; +interface Crypto { + readonly subtle: SubtleCrypto; + getRandomValues(array: T): T; +} + +declare var Crypto: { + prototype: Crypto; + new(): Crypto; +}; + interface CryptoKey { readonly algorithm: KeyAlgorithm; readonly extractable: boolean; - readonly type: string; - readonly usages: string[]; + readonly type: KeyType; + readonly usages: KeyUsage[]; } declare var CryptoKey: { @@ -474,6 +677,20 @@ declare var CryptoKey: { new(): CryptoKey; }; +interface CustomEvent extends Event { + /** + * Returns any custom data event was created with. + * Typically used for synthetic events. + */ + readonly detail: T; + initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: T): void; +} + +declare var CustomEvent: { + prototype: CustomEvent; + new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent; +}; + interface DOMException { readonly code: number; readonly message: string; @@ -734,7 +951,7 @@ interface DedicatedWorkerGlobalScopeEventMap extends WorkerGlobalScopeEventMap { interface DedicatedWorkerGlobalScope extends WorkerGlobalScope { onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null; close(): void; - postMessage(message: any, transfer?: any[]): void; + postMessage(message: any, transfer?: Transferable[]): void; addEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -771,32 +988,64 @@ interface ErrorEvent extends Event { readonly filename: string; readonly lineno: number; readonly message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; } declare var ErrorEvent: { prototype: ErrorEvent; - new(typeArg: string, eventInitDict?: ErrorEventInit): ErrorEvent; + new(type: string, eventInitDict?: ErrorEventInit): ErrorEvent; }; interface Event { + /** + * Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. + */ readonly bubbles: boolean; cancelBubble: boolean; readonly cancelable: boolean; + /** + * Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. + */ readonly composed: boolean; + /** + * Returns the object whose event listener's callback is currently being + * invoked. + */ readonly currentTarget: EventTarget | null; readonly defaultPrevented: boolean; readonly eventPhase: number; + /** + * Returns true if event was dispatched by the user agent, and + * false otherwise. + */ readonly isTrusted: boolean; returnValue: boolean; - readonly srcElement: object | null; + /** + * Returns the object to which event is dispatched (its target). + */ readonly target: EventTarget | null; + /** + * Returns the event's timestamp as the number of milliseconds measured relative to + * the time origin. + */ readonly timeStamp: number; + /** + * Returns the type of event, e.g. + * "click", "hashchange", or + * "submit". + */ readonly type: string; - deepPath(): EventTarget[]; + composedPath(): EventTarget[]; initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void; preventDefault(): void; + /** + * Invoking this method prevents event from reaching + * any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any + * other objects. + */ stopImmediatePropagation(): void; + /** + * When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. + */ stopPropagation(): void; readonly AT_TARGET: number; readonly BUBBLING_PHASE: number; @@ -806,7 +1055,7 @@ interface Event { declare var Event: { prototype: Event; - new(typeArg: string, eventInitDict?: EventInit): Event; + new(type: string, eventInitDict?: EventInit): Event; readonly AT_TARGET: number; readonly BUBBLING_PHASE: number; readonly CAPTURING_PHASE: number; @@ -840,9 +1089,26 @@ interface EventSourceInit { } interface EventTarget { + /** + * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched. + * The options argument sets listener-specific options. For compatibility this can be a + * boolean, in which case the method behaves exactly as if the value was specified as options's capture. + * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET. + * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in §2.8 Observing event listeners. + * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will + * be removed. + * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. + */ addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void; - dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; + /** + * Dispatches a synthetic event event to target and returns true + * if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. + */ + dispatchEvent(event: Event): boolean; + /** + * Removes the event listener in target's event listener list with the same type, callback, and options. + */ + removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; } declare var EventTarget: { @@ -972,11 +1238,11 @@ interface FormData { declare var FormData: { prototype: FormData; - new(form?: object): FormData; + new(): FormData; }; interface GlobalFetch { - fetch(input?: Request | string, init?: RequestInit): Promise; + fetch(input: RequestInfo, init?: RequestInit): Promise; } interface Headers { @@ -1041,13 +1307,13 @@ interface IDBCursor { * Delete the record pointed at by the cursor with a new value. * If successful, request's result will be undefined. */ - delete(): IDBRequest; + delete(): IDBRequest; /** * Updated the record pointed at by the cursor with a new value. * Throws a "DataError" DOMException if the effective object store uses in-line keys and the key would have changed. * If successful, request's result will be the record's key. */ - update(value: any): IDBRequest; + update(value: any): IDBRequest; } declare var IDBCursor: { @@ -1169,40 +1435,40 @@ interface IDBIndex { * If successful, request's result will be the * count. */ - count(key?: IDBValidKey | IDBKeyRange): IDBRequest; + count(key?: IDBValidKey | IDBKeyRange): IDBRequest; /** * Retrieves the value of the first record matching the * given key or key range in query. * If successful, request's result will be the value, or undefined if there was no matching record. */ - get(key: IDBValidKey | IDBKeyRange): IDBRequest; + get(key: IDBValidKey | IDBKeyRange): IDBRequest; /** * Retrieves the values of the records matching the given key or key range in query (up to count if given). * If successful, request's result will be an Array of the values. */ - getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest; + getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest; /** * Retrieves the keys of records matching the given key or key range in query (up to count if given). * If successful, request's result will be an Array of the keys. */ - getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest; + getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest; /** * Retrieves the key of the first record matching the * given key or key range in query. * If successful, request's result will be the key, or undefined if there was no matching record. */ - getKey(key: IDBValidKey | IDBKeyRange): IDBRequest; + getKey(key: IDBValidKey | IDBKeyRange): IDBRequest; /** * Opens a cursor over the records matching query, * ordered by direction. If query is null, all records in index are matched. * If successful, request's result will be an IDBCursorWithValue, or null if there were no matching records. */ - openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest; + openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest; /** * Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in index are matched. * If successful, request's result will be an IDBCursor, or null if there were no matching records. */ - openKeyCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest; + openKeyCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest; } declare var IDBIndex: { @@ -1281,19 +1547,19 @@ interface IDBObjectStore { * Returns the associated transaction. */ readonly transaction: IDBTransaction; - add(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest; + add(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest; /** * Deletes all records in store. * If successful, request's result will * be undefined. */ - clear(): IDBRequest; + clear(): IDBRequest; /** * Retrieves the number of records matching the * given key or key range in query. * If successful, request's result will be the count. */ - count(key?: IDBValidKey | IDBKeyRange): IDBRequest; + count(key?: IDBValidKey | IDBKeyRange): IDBRequest; /** * Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be * satisfied with the data already in store the upgrade @@ -1308,7 +1574,7 @@ interface IDBObjectStore { * If successful, request's result will * be undefined. */ - delete(key: IDBValidKey | IDBKeyRange): IDBRequest; + delete(key: IDBValidKey | IDBKeyRange): IDBRequest; /** * Deletes the index in store with the given name. * Throws an "InvalidStateError" DOMException if not called within an upgrade @@ -1320,41 +1586,41 @@ interface IDBObjectStore { * given key or key range in query. * If successful, request's result will be the value, or undefined if there was no matching record. */ - get(query: IDBValidKey | IDBKeyRange): IDBRequest; + get(query: IDBValidKey | IDBKeyRange): IDBRequest; /** * Retrieves the values of the records matching the * given key or key range in query (up to count if given). * If successful, request's result will * be an Array of the values. */ - getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest; + getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest; /** * Retrieves the keys of records matching the * given key or key range in query (up to count if given). * If successful, request's result will * be an Array of the keys. */ - getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest; + getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest; /** * Retrieves the key of the first record matching the * given key or key range in query. * If successful, request's result will be the key, or undefined if there was no matching record. */ - getKey(query: IDBValidKey | IDBKeyRange): IDBRequest; + getKey(query: IDBValidKey | IDBKeyRange): IDBRequest; index(name: string): IDBIndex; /** * Opens a cursor over the records matching query, * ordered by direction. If query is null, all records in store are matched. * If successful, request's result will be an IDBCursorWithValue pointing at the first matching record, or null if there were no matching records. */ - openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest; + openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest; /** * Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in store are matched. * If successful, request's result will be an IDBCursor pointing at the first matching record, or * null if there were no matching records. */ - openKeyCursor(query?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest; - put(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest; + openKeyCursor(query?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest; + put(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest; } declare var IDBObjectStore: { @@ -1367,7 +1633,7 @@ interface IDBOpenDBRequestEventMap extends IDBRequestEventMap { "upgradeneeded": IDBVersionChangeEvent; } -interface IDBOpenDBRequest extends IDBRequest { +interface IDBOpenDBRequest extends IDBRequest { onblocked: ((this: IDBOpenDBRequest, ev: Event) => any) | null; onupgradeneeded: ((this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any) | null; addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; @@ -1386,14 +1652,14 @@ interface IDBRequestEventMap { "success": Event; } -interface IDBRequest extends EventTarget { +interface IDBRequest extends EventTarget { /** * When a request is completed, returns the error (a DOMException), or null if the request succeeded. Throws * a "InvalidStateError" DOMException if the request is still pending. */ readonly error: DOMException | null; - onerror: ((this: IDBRequest, ev: Event) => any) | null; - onsuccess: ((this: IDBRequest, ev: Event) => any) | null; + onerror: ((this: IDBRequest, ev: Event) => any) | null; + onsuccess: ((this: IDBRequest, ev: Event) => any) | null; /** * Returns "pending" until a request is complete, * then returns "done". @@ -1404,7 +1670,7 @@ interface IDBRequest extends EventTarget { * or undefined if the request failed. Throws a * "InvalidStateError" DOMException if the request is still pending. */ - readonly result: any; + readonly result: T; /** * Returns the IDBObjectStore, IDBIndex, or IDBCursor the request was made against, or null if is was an open * request. @@ -1415,9 +1681,9 @@ interface IDBRequest extends EventTarget { * If this as an open request, then it returns an upgrade transaction while it is running, or null otherwise. */ readonly transaction: IDBTransaction | null; - addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; - removeEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } @@ -1488,11 +1754,27 @@ declare var IDBVersionChangeEvent: { }; interface ImageBitmap { + /** + * Returns the intrinsic height of the image, in CSS + * pixels. + */ readonly height: number; + /** + * Returns the intrinsic width of the image, in CSS + * pixels. + */ readonly width: number; + /** + * Releases imageBitmap's underlying bitmap data. + */ close(): void; } +declare var ImageBitmap: { + prototype: ImageBitmap; + new(): ImageBitmap; +}; + interface ImageBitmapOptions { colorSpaceConversion?: "none" | "default"; imageOrientation?: "none" | "flipY"; @@ -1503,6 +1785,17 @@ interface ImageBitmapOptions { } interface ImageData { + /** + * Returns the one-dimensional array containing the data in RGBA order, as integers in the + * range 0 to 255. + */ + readonly data: Uint8ClampedArray; + /** + * Returns the actual dimensions of the data in the ImageData object, in + * pixels. + */ + readonly height: number; + readonly width: number; } declare var ImageData: { @@ -1522,11 +1815,31 @@ declare var MessageChannel: { }; interface MessageEvent extends Event { + /** + * Returns the data of the message. + */ readonly data: any; + /** + * Returns the last event ID string, for + * server-sent events. + */ + readonly lastEventId: string; + /** + * Returns the origin of the message, for server-sent events and + * cross-document messaging. + */ readonly origin: string; + /** + * Returns the MessagePort array sent with the message, for cross-document + * messaging and channel messaging. + */ readonly ports: ReadonlyArray; - readonly source: MessageEventSource; - initMessageEvent(type: string, bubbles: boolean, cancelable: boolean, data: any, origin: string, lastEventId: string, source: object): void; + /** + * Returns the WindowProxy of the source window, for cross-document + * messaging, and the MessagePort being attached, in the connect event fired at + * SharedWorkerGlobalScope objects. + */ + readonly source: MessageEventSource | null; } declare var MessageEvent: { @@ -1553,7 +1866,7 @@ interface MessagePort extends EventTarget { * transfer contains duplicate objects or port, or if message * could not be cloned. */ - postMessage(message: any, transfer?: any[]): void; + postMessage(message: any, transfer?: Transferable[]): void; /** * Begins dispatching messages received on the port. */ @@ -1660,6 +1973,15 @@ declare var NotificationEvent: { new(type: string, eventInitDict: NotificationEventInit): NotificationEvent; }; +interface Path2D extends CanvasPath { + addPath(path: Path2D, transform?: DOMMatrix2DInit): void; +} + +declare var Path2D: { + prototype: Path2D; + new(path?: Path2D | string): Path2D; +}; + interface PerformanceEventMap { "resourcetimingbufferfull": Event; } @@ -1778,7 +2100,7 @@ declare var ProgressEvent: { }; interface PromiseRejectionEvent extends Event { - readonly promise: PromiseLike; + readonly promise: Promise; readonly reason: any; } @@ -1948,7 +2270,7 @@ interface Request extends Body { * Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort * event handler. */ - readonly signal: object; + readonly signal: AbortSignal; /** * Returns the URL of request as a string. */ @@ -1988,7 +2310,7 @@ interface ServiceWorker extends EventTarget, AbstractWorker { onstatechange: ((this: ServiceWorker, ev: Event) => any) | null; readonly scriptURL: string; readonly state: ServiceWorkerState; - postMessage(message: any, transfer?: any[]): void; + postMessage(message: any, transfer?: Transferable[]): void; addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -2104,6 +2426,32 @@ declare var StorageManager: { new(): StorageManager; }; +interface SubtleCrypto { + decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike; + deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike; + deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike; + digest(algorithm: string | Algorithm, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike; + encrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike; + exportKey(format: "jwk", key: CryptoKey): PromiseLike; + exportKey(format: "raw" | "pkcs8" | "spki", key: CryptoKey): PromiseLike; + exportKey(format: string, key: CryptoKey): PromiseLike; + generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): PromiseLike; + generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): PromiseLike; + generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike; + importKey(format: "jwk", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: string[]): PromiseLike; + importKey(format: "raw" | "pkcs8" | "spki", keyData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: string[]): PromiseLike; + importKey(format: string, keyData: JsonWebKey | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: string[]): PromiseLike; + sign(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike; + unwrapKey(format: string, wrappedKey: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, unwrappingKey: CryptoKey, unwrapAlgorithm: string | Algorithm, unwrappedKeyAlgorithm: string | Algorithm, extractable: boolean, keyUsages: string[]): PromiseLike; + verify(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike; + wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | Algorithm): PromiseLike; +} + +declare var SubtleCrypto: { + prototype: SubtleCrypto; + new(): SubtleCrypto; +}; + interface SyncEvent extends ExtendableEvent { readonly lastChance: boolean; readonly tag: string; @@ -2199,28 +2547,28 @@ declare var URL: { }; interface URLSearchParams { - /** - * Appends a specified key/value pair as a new search parameter. + /** + * Appends a specified key/value pair as a new search parameter. */ append(name: string, value: string): void; - /** - * Deletes the given search parameter, and its associated value, from the list of all search parameters. + /** + * Deletes the given search parameter, and its associated value, from the list of all search parameters. */ delete(name: string): void; - /** - * Returns the first value associated to the given search parameter. + /** + * Returns the first value associated to the given search parameter. */ get(name: string): string | null; - /** - * Returns all the values association with a given search parameter. + /** + * Returns all the values association with a given search parameter. */ getAll(name: string): string[]; - /** - * Returns a Boolean indicating if such a search parameter exists. + /** + * Returns a Boolean indicating if such a search parameter exists. */ has(name: string): boolean; - /** - * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others. + /** + * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others. */ set(name: string, value: string): void; sort(): void; @@ -2293,13 +2641,30 @@ interface WindowConsole { readonly console: Console; } +interface WindowOrWorkerGlobalScope { + readonly caches: CacheStorage; + readonly crypto: Crypto; + readonly indexedDB: IDBFactory; + readonly origin: string; + readonly performance: Performance; + atob(data: string): string; + btoa(data: string): string; + clearInterval(handle?: number): void; + clearTimeout(handle?: number): void; + createImageBitmap(image: ImageBitmapSource): Promise; + createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number): Promise; + fetch(input: RequestInfo, init?: RequestInit): Promise; + setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number; + setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number; +} + interface WorkerEventMap extends AbstractWorkerEventMap { "message": MessageEvent; } interface Worker extends EventTarget, AbstractWorker { onmessage: ((this: Worker, ev: MessageEvent) => any) | null; - postMessage(message: any, transfer?: any[]): void; + postMessage(message: any, transfer?: Transferable[]): void; terminate(): void; addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; @@ -2316,15 +2681,13 @@ interface WorkerGlobalScopeEventMap { "error": ErrorEvent; } -interface WorkerGlobalScope extends EventTarget, WorkerUtils, WindowConsole, GlobalFetch { +interface WorkerGlobalScope extends EventTarget, WorkerUtils, WindowConsole, GlobalFetch, WindowOrWorkerGlobalScope { readonly caches: CacheStorage; readonly isSecureContext: boolean; readonly location: WorkerLocation; onerror: ((this: WorkerGlobalScope, ev: ErrorEvent) => any) | null; readonly performance: Performance; readonly self: WorkerGlobalScope; - createImageBitmap(image: ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise; - createImageBitmap(image: ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise; msWriteProfilerMark(profilerMarkName: string): void; addEventListener(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; @@ -2368,13 +2731,7 @@ interface WorkerUtils extends WindowBase64 { readonly indexedDB: IDBFactory; readonly msIndexedDB: IDBFactory; readonly navigator: WorkerNavigator; - clearImmediate(handle: number): void; - clearInterval(handle: number): void; - clearTimeout(handle: number): void; importScripts(...urls: string[]): void; - setImmediate(handler: any, ...args: any[]): number; - setInterval(handler: any, timeout?: any, ...args: any[]): number; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; } interface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap { @@ -2458,7 +2815,7 @@ interface XMLHttpRequest extends XMLHttpRequestEventTarget { * Initiates the request. The optional argument provides the request body. The argument is ignored if request method is GET or HEAD. * Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set. */ - send(body?: object | BodyInit): void; + send(body?: BodyInit | null): void; /** * Combines a header in author request headers. * Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set. @@ -2540,31 +2897,46 @@ interface PerformanceObserverCallback { declare var onmessage: ((this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any) | null; declare function close(): void; -declare function postMessage(message: any, transfer?: any[]): void; -declare function dispatchEvent(evt: Event): boolean; +declare function postMessage(message: any, transfer?: Transferable[]): void; +/** + * Dispatches a synthetic event event to target and returns true + * if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. + */ +declare function dispatchEvent(event: Event): boolean; declare var caches: CacheStorage; declare var isSecureContext: boolean; declare var location: WorkerLocation; declare var onerror: ((this: DedicatedWorkerGlobalScope, ev: ErrorEvent) => any) | null; declare var performance: Performance; declare var self: WorkerGlobalScope; -declare function createImageBitmap(image: ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise; -declare function createImageBitmap(image: ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise; declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function dispatchEvent(evt: Event): boolean; +/** + * Dispatches a synthetic event event to target and returns true + * if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. + */ +declare function dispatchEvent(event: Event): boolean; declare var indexedDB: IDBFactory; declare var msIndexedDB: IDBFactory; declare var navigator: WorkerNavigator; -declare function clearImmediate(handle: number): void; -declare function clearInterval(handle: number): void; -declare function clearTimeout(handle: number): void; -declare function setImmediate(handler: any, ...args: any[]): number; -declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function importScripts(...urls: string[]): void; declare function atob(encodedString: string): string; declare function btoa(rawString: string): string; declare var console: Console; -declare function fetch(input?: Request | string, init?: RequestInit): Promise; +declare function fetch(input: RequestInfo, init?: RequestInit): Promise; +declare var caches: CacheStorage; +declare var crypto: Crypto; +declare var indexedDB: IDBFactory; +declare var origin: string; +declare var performance: Performance; +declare function atob(data: string): string; +declare function btoa(data: string): string; +declare function clearInterval(handle?: number): void; +declare function clearTimeout(handle?: number): void; +declare function createImageBitmap(image: ImageBitmapSource): Promise; +declare function createImageBitmap(image: ImageBitmapSource, sx: number, sy: number, sw: number, sh: number): Promise; +declare function fetch(input: RequestInfo, init?: RequestInit): Promise; +declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number; +declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number; declare function addEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; declare function removeEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -2574,19 +2946,30 @@ type HeadersInit = Headers | string[][] | Record; type BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream | string; type RequestInfo = Request | string; type DOMHighResTimeStamp = number; +type CanvasImageSource = ImageBitmap; +type MessageEventSource = MessagePort | ServiceWorker; +type ImageBitmapSource = CanvasImageSource | Blob | ImageData; +type TimerHandler = string | Function; type PerformanceEntryList = PerformanceEntry[]; type PushMessageDataInit = BufferSource | string; type VibratePattern = number | number[]; +type AlgorithmIdentifier = string | Algorithm; +type HashAlgorithmIdentifier = AlgorithmIdentifier; +type BigInteger = Uint8Array; +type NamedCurve = string; type BufferSource = ArrayBufferView | ArrayBuffer; type DOMTimeStamp = number; type FormDataEntryValue = File | string; type IDBValidKey = number | string | Date | BufferSource | IDBArrayKey; -type MessageEventSource = object | MessagePort | ServiceWorker; +type Transferable = ArrayBuffer | MessagePort | ImageBitmap; type BinaryType = "blob" | "arraybuffer"; type ClientTypes = "window" | "worker" | "sharedworker" | "all"; type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique"; type IDBRequestReadyState = "pending" | "done"; type IDBTransactionMode = "readonly" | "readwrite" | "versionchange"; +type KeyFormat = "raw" | "spki" | "pkcs8" | "jwk"; +type KeyType = "public" | "private" | "secret"; +type KeyUsage = "encrypt" | "decrypt" | "sign" | "verify" | "deriveKey" | "deriveBits" | "wrapKey" | "unwrapKey"; type NotificationDirection = "auto" | "ltr" | "rtl"; type NotificationPermission = "default" | "denied" | "granted"; type PushEncryptionKeyName = "p256dh" | "auth"; @@ -2600,6 +2983,6 @@ type RequestRedirect = "follow" | "error" | "manual"; type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect"; type ServiceWorkerState = "installing" | "installed" | "activating" | "activated" | "redundant"; type ServiceWorkerUpdateViaCache = "imports" | "all" | "none"; -type VisibilityState = "hidden" | "visible" | "prerender" | "unloaded"; +type VisibilityState = "hidden" | "visible" | "prerender"; type WorkerType = "classic" | "module"; -type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text"; \ No newline at end of file +type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text"; diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index be4f2290bcc..3ea6b45047c 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -326,6 +326,13 @@ namespace ts.server { syntaxOnly?: boolean; } + interface OriginalFileInfo { fileName: NormalizedPath; path: Path; } + type OpenScriptInfoOrClosedFileInfo = ScriptInfo | OriginalFileInfo; + + function isOpenScriptInfo(infoOrFileName: OpenScriptInfoOrClosedFileInfo): infoOrFileName is ScriptInfo { + return !!(infoOrFileName as ScriptInfo).containingProjects; + } + function getDetailWatchInfo(watchType: WatchType, project: Project | undefined) { return `Project: ${project ? project.getProjectName() : ""} WatchType: ${watchType}`; } @@ -700,7 +707,7 @@ namespace ts.server { /* @internal */ private forEachProject(cb: (project: Project) => void) { - for (const p of this.inferredProjects) cb(p); + this.inferredProjects.forEach(cb); this.configuredProjects.forEach(cb); this.externalProjects.forEach(cb); } @@ -1044,12 +1051,12 @@ namespace ts.server { } } - private configFileExists(configFileName: NormalizedPath, canonicalConfigFilePath: string, info: ScriptInfo) { + private configFileExists(configFileName: NormalizedPath, canonicalConfigFilePath: string, info: OpenScriptInfoOrClosedFileInfo) { let configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); if (configFileExistenceInfo) { // By default the info would get impacted by presence of config file since its in the detection path // Only adding the info as a root to inferred project will need the existence to be watched by file watcher - if (!configFileExistenceInfo.openFilesImpactedByConfigFile.has(info.path)) { + if (isOpenScriptInfo(info) && !configFileExistenceInfo.openFilesImpactedByConfigFile.has(info.path)) { configFileExistenceInfo.openFilesImpactedByConfigFile.set(info.path, false); this.logConfigFileWatchUpdate(configFileName, canonicalConfigFilePath, configFileExistenceInfo, ConfigFileWatcherStatus.OpenFilesImpactedByConfigFileAdd); } @@ -1066,9 +1073,11 @@ namespace ts.server { // Or the whole chain of config files for the roots of the inferred projects // Cache the host value of file exists and add the info to map of open files impacted by this config file - const openFilesImpactedByConfigFile = createMap(); - openFilesImpactedByConfigFile.set(info.path, false); const exists = this.host.fileExists(configFileName); + const openFilesImpactedByConfigFile = createMap(); + if (isOpenScriptInfo(info)) { + openFilesImpactedByConfigFile.set(info.path, false); + } configFileExistenceInfo = { exists, openFilesImpactedByConfigFile }; this.configFileExistenceInfoCache.set(canonicalConfigFilePath, configFileExistenceInfo); this.logConfigFileWatchUpdate(configFileName, canonicalConfigFilePath, configFileExistenceInfo, ConfigFileWatcherStatus.OpenFilesImpactedByConfigFileAdd); @@ -1180,7 +1189,7 @@ namespace ts.server { */ private stopWatchingConfigFilesForClosedScriptInfo(info: ScriptInfo) { Debug.assert(!info.isScriptOpen()); - this.forEachConfigFileLocation(info, /*infoShouldBeOpen*/ true, (configFileName, canonicalConfigFilePath) => { + this.forEachConfigFileLocation(info, (configFileName, canonicalConfigFilePath) => { const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); if (configFileExistenceInfo) { const infoIsRootOfInferredProject = configFileExistenceInfo.openFilesImpactedByConfigFile.get(info.path); @@ -1214,7 +1223,7 @@ namespace ts.server { /* @internal */ startWatchingConfigFilesForInferredProjectRoot(info: ScriptInfo) { Debug.assert(info.isScriptOpen()); - this.forEachConfigFileLocation(info, /*infoShouldBeOpen*/ true, (configFileName, canonicalConfigFilePath) => { + this.forEachConfigFileLocation(info, (configFileName, canonicalConfigFilePath) => { let configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); if (!configFileExistenceInfo) { // Create the cache @@ -1242,7 +1251,7 @@ namespace ts.server { */ /* @internal */ stopWatchingConfigFilesForInferredProjectRoot(info: ScriptInfo) { - this.forEachConfigFileLocation(info, /*infoShouldBeOpen*/ true, (configFileName, canonicalConfigFilePath) => { + this.forEachConfigFileLocation(info, (configFileName, canonicalConfigFilePath) => { const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); if (configFileExistenceInfo && configFileExistenceInfo.openFilesImpactedByConfigFile.has(info.path)) { Debug.assert(info.isScriptOpen()); @@ -1265,12 +1274,12 @@ namespace ts.server { * The server must start searching from the directory containing * the newly opened file. */ - private forEachConfigFileLocation(info: ScriptInfo, infoShouldBeOpen: boolean, action: (configFileName: NormalizedPath, canonicalConfigFilePath: string) => boolean | void) { + private forEachConfigFileLocation(info: OpenScriptInfoOrClosedFileInfo, action: (configFileName: NormalizedPath, canonicalConfigFilePath: string) => boolean | void) { if (this.syntaxOnly) { return undefined; } - Debug.assert(!infoShouldBeOpen || this.openFiles.has(info.path)); + Debug.assert(!isOpenScriptInfo(info) || this.openFiles.has(info.path)); const projectRootPath = this.openFiles.get(info.path); let searchPath = asNormalizedPath(getDirectoryPath(info.fileName)); @@ -1309,11 +1318,13 @@ namespace ts.server { * current directory (the directory in which tsc was invoked). * The server must start searching from the directory containing * the newly opened file. + * If script info is passed in, it is asserted to be open script info + * otherwise just file name */ - private getConfigFileNameForFile(info: ScriptInfo, infoShouldBeOpen: boolean) { - if (infoShouldBeOpen) Debug.assert(info.isScriptOpen()); + private getConfigFileNameForFile(info: OpenScriptInfoOrClosedFileInfo) { + if (isOpenScriptInfo(info)) Debug.assert(info.isScriptOpen()); this.logger.info(`Search path: ${getDirectoryPath(info.fileName)}`); - const configFileName = this.forEachConfigFileLocation(info, infoShouldBeOpen, (configFileName, canonicalConfigFilePath) => + const configFileName = this.forEachConfigFileLocation(info, (configFileName, canonicalConfigFilePath) => this.configFileExists(configFileName, canonicalConfigFilePath, info)); if (configFileName) { this.logger.info(`For info: ${info.fileName} :: Config file name: ${configFileName}`); @@ -1683,10 +1694,12 @@ namespace ts.server { if (!this.eventHandler || this.suppressDiagnosticEvents) { return; } + const diagnostics = project.getLanguageService().getCompilerOptionsDiagnostics(); + diagnostics.push(...project.getAllProjectErrors()); this.eventHandler({ eventName: ConfigFileDiagEvent, - data: { configFileName: project.getConfigFilePath(), diagnostics: project.getAllProjectErrors(), triggerFile } + data: { configFileName: project.getConfigFilePath(), diagnostics, triggerFile } }); } @@ -2003,7 +2016,7 @@ namespace ts.server { // we first detect if there is already a configured project created for it: if so, // we re- read the tsconfig file content and update the project only if we havent already done so // otherwise we create a new one. - const configFileName = this.getConfigFileNameForFile(info, /*infoShouldBeOpen*/ true); + const configFileName = this.getConfigFileNameForFile(info); if (configFileName) { const project = this.findConfiguredProjectByProjectName(configFileName); if (!project) { @@ -2091,17 +2104,40 @@ namespace ts.server { return this.openClientFileWithNormalizedPath(toNormalizedPath(fileName), fileContent, scriptKind, /*hasMixedContent*/ false, projectRootPath ? toNormalizedPath(projectRootPath) : undefined); } - /** @internal */ - getProjectForFileWithoutOpening(fileName: NormalizedPath): { readonly scriptInfo: ScriptInfo, readonly projects: ReadonlyArray } | undefined { - const scriptInfo = this.filenameToScriptInfo.get(fileName) || - this.getOrCreateScriptInfoNotOpenedByClientForNormalizedPath(fileName, this.currentDirectory, /*fileContent*/ undefined, /*scriptKind*/ undefined, /*hasMixedContent*/ undefined); - if (!scriptInfo) return undefined; - if (scriptInfo.containingProjects.length) { - return { scriptInfo, projects: scriptInfo.containingProjects }; + /*@internal*/ + getOriginalLocationEnsuringConfiguredProject(project: Project, location: sourcemaps.SourceMappableLocation): sourcemaps.SourceMappableLocation | undefined { + const originalLocation = project.getSourceMapper().tryGetOriginalLocation(location); + if (!originalLocation) return undefined; + + const { fileName } = originalLocation; + if (!this.getScriptInfo(fileName) && !this.host.fileExists(fileName)) return undefined; + + const originalFileInfo: OriginalFileInfo = { fileName: toNormalizedPath(fileName), path: this.toPath(fileName) }; + const configFileName = this.getConfigFileNameForFile(originalFileInfo); + if (!configFileName) return undefined; + + const configuredProject = this.findConfiguredProjectByProjectName(configFileName) || this.createConfiguredProject(configFileName); + updateProjectIfDirty(configuredProject); + // Keep this configured project as referenced from project + addOriginalConfiguredProject(configuredProject); + + const originalScriptInfo = this.getScriptInfo(fileName); + if (!originalScriptInfo || !originalScriptInfo.containingProjects.length) return undefined; + + // Add configured projects as referenced + originalScriptInfo.containingProjects.forEach(project => { + if (project.projectKind === ProjectKind.Configured) { + addOriginalConfiguredProject(project as ConfiguredProject); + } + }); + return originalLocation; + + function addOriginalConfiguredProject(originalProject: ConfiguredProject) { + if (!project.originalConfiguredProjects) { + project.originalConfiguredProjects = createMap(); + } + project.originalConfiguredProjects.set(originalProject.canonicalConfigFilePath, true); } - const configFileName = this.getConfigFileNameForFile(scriptInfo, /*infoShouldBeOpen*/ false); - const project = configFileName === undefined ? undefined : this.findConfiguredProjectByProjectName(configFileName) || this.createConfiguredProject(configFileName); - return project && project.containsScriptInfo(scriptInfo) ? { scriptInfo, projects: [project] } : undefined; } /** @internal */ @@ -2126,7 +2162,7 @@ namespace ts.server { this.openFiles.set(info.path, projectRootPath); let project: ConfiguredProject | ExternalProject | undefined = this.findExternalProjectContainingOpenScriptInfo(info); if (!project && !this.syntaxOnly) { // Checking syntaxOnly is an optimization - configFileName = this.getConfigFileNameForFile(info, /*infoShouldBeOpen*/ true); + configFileName = this.getConfigFileNameForFile(info); if (configFileName) { project = this.findConfiguredProjectByProjectName(configFileName); if (!project) { @@ -2164,14 +2200,9 @@ namespace ts.server { } Debug.assert(!info.isOrphan()); - // Remove the configured projects that have zero references from open files. // This was postponed from closeOpenFile to after opening next file, // so that we can reuse the project if we need to right away - this.configuredProjects.forEach(project => { - if (!project.hasOpenRef()) { - this.removeProject(project); - } - }); + this.removeOrphanConfiguredProjects(); // Remove orphan inferred projects now that we have reused projects // We need to create a duplicate because we cant guarantee order after removal @@ -2199,6 +2230,30 @@ namespace ts.server { return { configFileName, configFileErrors }; } + private removeOrphanConfiguredProjects() { + const toRemoveConfiguredProjects = cloneMap(this.configuredProjects); + + // Do not remove configured projects that are used as original projects of other + this.inferredProjects.forEach(markOriginalProjectsAsUsed); + this.externalProjects.forEach(markOriginalProjectsAsUsed); + this.configuredProjects.forEach(project => { + // If project has open ref (there are more than zero references from external project/open file), keep it alive as well as any project it references + if (project.hasOpenRef()) { + toRemoveConfiguredProjects.delete(project.canonicalConfigFilePath); + markOriginalProjectsAsUsed(project); + } + }); + + // Remove all the non marked projects + toRemoveConfiguredProjects.forEach(project => this.removeProject(project)); + + function markOriginalProjectsAsUsed(project: Project) { + if (!project.isOrphan() && project.originalConfiguredProjects) { + project.originalConfiguredProjects.forEach((_value, configuredProjectPath) => toRemoveConfiguredProjects.delete(configuredProjectPath)); + } + } + } + private telemetryOnOpenFile(scriptInfo: ScriptInfo): void { if (this.syntaxOnly || !this.eventHandler || !scriptInfo.isJavaScript() || !addToSeen(this.allJsFilesForOpenFileTelemetry, scriptInfo.path)) { return; diff --git a/src/server/project.ts b/src/server/project.ts index 08b08eae04c..d26ee5d79e5 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -158,6 +158,9 @@ namespace ts.server { /*@internal*/ typingFiles: SortedReadonlyArray = emptyArray; + /*@internal*/ + originalConfiguredProjects: Map | undefined; + private readonly cancellationToken: ThrottledCancellationToken; public isNonTsProject() { @@ -711,7 +714,7 @@ namespace ts.server { } containsFile(filename: NormalizedPath, requireOpen?: boolean): boolean { - const info = this.projectService.getScriptInfoForPath(this.toPath(filename)); + const info = this.projectService.getScriptInfoForNormalizedPath(filename); if (info && (info.isScriptOpen() || !requireOpen)) { return this.containsScriptInfo(info); } diff --git a/src/server/session.ts b/src/server/session.ts index aae9ab8980f..d2fefb16430 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -258,10 +258,6 @@ namespace ts.server { readonly symLinkedProjects: MultiMap; }; - function isProjectsArray(projects: Projects): projects is ReadonlyArray { - return !!(>projects).length; - } - /** * This helper function processes a list of projects and return the concatenated, sortd and deduplicated output of processing each project. */ @@ -273,8 +269,8 @@ namespace ts.server { comparer?: (a: U, b: U) => number, areEqual?: (a: U, b: U) => boolean, ): U[] { - const outputs = flatMap(isProjectsArray(projects) ? projects : projects.projects, project => action(project, defaultValue)); - if (!isProjectsArray(projects) && projects.symLinkedProjects) { + const outputs = flatMap(isArray(projects) ? projects : projects.projects, project => action(project, defaultValue)); + if (!isArray(projects) && projects.symLinkedProjects) { projects.symLinkedProjects.forEach((projects, path) => { const value = getValue(path as Path); outputs.push(...flatMap(projects, project => action(project, value))); @@ -370,7 +366,7 @@ namespace ts.server { } function forEachProjectInProjects(projects: Projects, path: string | undefined, cb: (project: Project, path: string | undefined) => void): void { - for (const project of isProjectsArray(projects) ? projects : projects.projects) { + for (const project of isArray(projects) ? projects : projects.projects) { cb(project, path); } if (!isArray(projects) && projects.symLinkedProjects) { @@ -431,23 +427,20 @@ namespace ts.server { if (projectAndLocation.project.getCancellationToken().isCancellationRequested()) return undefined; // Skip rest of toDo if cancelled cb(projectAndLocation, (project, location) => { seenProjects.set(projectAndLocation.project.projectName, true); - const originalLocation = project.getSourceMapper().tryGetOriginalLocation(location); + const originalLocation = projectService.getOriginalLocationEnsuringConfiguredProject(project, location); if (!originalLocation) return false; - const originalProjectAndScriptInfo = projectService.getProjectForFileWithoutOpening(toNormalizedPath(originalLocation.fileName)); - if (!originalProjectAndScriptInfo) return false; - if (originalProjectAndScriptInfo) { - toDo = toDo || []; + const originalScriptInfo = projectService.getScriptInfo(originalLocation.fileName)!; + toDo = toDo || []; - for (const project of originalProjectAndScriptInfo.projects) { - addToTodo({ project, location: originalLocation as TLocation }, toDo, seenProjects); - } - const symlinkedProjectsMap = projectService.getSymlinkedProjects(originalProjectAndScriptInfo.scriptInfo); - if (symlinkedProjectsMap) { - symlinkedProjectsMap.forEach((symlinkedProjects) => { - for (const symlinkedProject of symlinkedProjects) addToTodo({ project: symlinkedProject, location: originalLocation as TLocation }, toDo!, seenProjects); - }); - } + for (const project of originalScriptInfo.containingProjects) { + addToTodo({ project, location: originalLocation as TLocation }, toDo, seenProjects); + } + const symlinkedProjectsMap = projectService.getSymlinkedProjects(originalScriptInfo); + if (symlinkedProjectsMap) { + symlinkedProjectsMap.forEach((symlinkedProjects) => { + for (const symlinkedProject of symlinkedProjects) addToTodo({ project: symlinkedProject, location: originalLocation as TLocation }, toDo!, seenProjects); + }); } return true; }); @@ -1106,7 +1099,7 @@ namespace ts.server { return project.getLanguageService().getRenameInfo(file, position); } - private getProjects(args: protocol.FileRequestArgs): Projects { + private getProjects(args: protocol.FileRequestArgs, getScriptInfoEnsuringProjectsUptoDate?: boolean, ignoreNoProjectError?: boolean): Projects { let projects: ReadonlyArray | undefined; let symLinkedProjects: MultiMap | undefined; if (args.projectFileName) { @@ -1116,13 +1109,18 @@ namespace ts.server { } } else { - const scriptInfo = this.projectService.getScriptInfo(args.file)!; + const scriptInfo = getScriptInfoEnsuringProjectsUptoDate ? + this.projectService.getScriptInfoEnsuringProjectsUptoDate(args.file) : + this.projectService.getScriptInfo(args.file); + if (!scriptInfo) { + return ignoreNoProjectError ? emptyArray : Errors.ThrowNoProject(); + } projects = scriptInfo.containingProjects; symLinkedProjects = this.projectService.getSymlinkedProjects(scriptInfo); } // filter handles case when 'projects' is undefined projects = filter(projects, p => p.languageServiceEnabled && !p.isOrphan()); - if ((!projects || !projects.length) && !symLinkedProjects) { + if (!ignoreNoProjectError && (!projects || !projects.length) && !symLinkedProjects) { return Errors.ThrowNoProject(); } return symLinkedProjects ? { projects: projects!, symLinkedProjects } : projects!; // TODO: GH#18217 @@ -1465,18 +1463,16 @@ namespace ts.server { } private getCompileOnSaveAffectedFileList(args: protocol.FileRequestArgs): ReadonlyArray { - const info = this.projectService.getScriptInfoEnsuringProjectsUptoDate(args.file); + const projects = this.getProjects(args, /*getScriptInfoEnsuringProjectsUptoDate*/ true, /*ignoreNoProjectError*/ true); + const info = this.projectService.getScriptInfo(args.file); if (!info) { return emptyArray; } - // if specified a project, we only return affected file list in this project - const projects = args.projectFileName ? [this.projectService.findProject(args.projectFileName)!] : info.containingProjects; - const symLinkedProjects = !args.projectFileName && this.projectService.getSymlinkedProjects(info); return combineProjectOutput( info, path => this.projectService.getScriptInfoForPath(path)!, - symLinkedProjects ? { projects, symLinkedProjects } : projects, + projects, (project, info) => { let result: protocol.CompileOnSaveAffectedFileListSingleProject | undefined; if (project.compileOnSaveEnabled && project.languageServiceEnabled && !project.isOrphan() && !project.getCompilationSettings().noEmit) { diff --git a/src/services/codefixes/fixUnusedIdentifier.ts b/src/services/codefixes/fixUnusedIdentifier.ts index f70c9ce6482..2905f0b131b 100644 --- a/src/services/codefixes/fixUnusedIdentifier.ts +++ b/src/services/codefixes/fixUnusedIdentifier.ts @@ -3,6 +3,7 @@ namespace ts.codefix { const fixName = "unusedIdentifier"; const fixIdPrefix = "unusedIdentifier_prefix"; const fixIdDelete = "unusedIdentifier_delete"; + const fixIdInfer = "unusedIdentifier_infer"; const errorCodes = [ Diagnostics._0_is_declared_but_its_value_is_never_read.code, Diagnostics._0_is_declared_but_never_used.code, @@ -10,6 +11,7 @@ namespace ts.codefix { Diagnostics.All_imports_in_import_declaration_are_unused.code, Diagnostics.All_destructured_elements_are_unused.code, Diagnostics.All_variables_are_unused.code, + Diagnostics.All_type_parameters_are_unused.code, ]; registerCodeFix({ @@ -20,28 +22,42 @@ namespace ts.codefix { const sourceFiles = program.getSourceFiles(); const token = getTokenAtPosition(sourceFile, context.span.start); + if (isJSDocTemplateTag(token)) { + return [createDeleteFix(textChanges.ChangeTracker.with(context, t => t.delete(sourceFile, token)), Diagnostics.Remove_template_tag)]; + } + if (token.kind === SyntaxKind.LessThanToken) { + const changes = textChanges.ChangeTracker.with(context, t => deleteTypeParameters(t, sourceFile, token)); + return [createDeleteFix(changes, Diagnostics.Remove_type_parameters)]; + } const importDecl = tryGetFullImport(token); if (importDecl) { const changes = textChanges.ChangeTracker.with(context, t => t.delete(sourceFile, importDecl)); - return [createCodeFixAction(fixName, changes, [Diagnostics.Remove_import_from_0, showModuleSpecifier(importDecl)], fixIdDelete, Diagnostics.Delete_all_unused_declarations)]; + return [createDeleteFix(changes, [Diagnostics.Remove_import_from_0, showModuleSpecifier(importDecl)])]; } const delDestructure = textChanges.ChangeTracker.with(context, t => tryDeleteFullDestructure(token, t, sourceFile, checker, sourceFiles, /*isFixAll*/ false)); if (delDestructure.length) { - return [createCodeFixAction(fixName, delDestructure, Diagnostics.Remove_destructuring, fixIdDelete, Diagnostics.Delete_all_unused_declarations)]; + return [createDeleteFix(delDestructure, Diagnostics.Remove_destructuring)]; } const delVar = textChanges.ChangeTracker.with(context, t => tryDeleteFullVariableStatement(sourceFile, token, t)); if (delVar.length) { - return [createCodeFixAction(fixName, delVar, Diagnostics.Remove_variable_statement, fixIdDelete, Diagnostics.Delete_all_unused_declarations)]; + return [createDeleteFix(delVar, Diagnostics.Remove_variable_statement)]; } const result: CodeFixAction[] = []; - const deletion = textChanges.ChangeTracker.with(context, t => - tryDeleteDeclaration(sourceFile, token, t, checker, sourceFiles, /*isFixAll*/ false)); - if (deletion.length) { - const name = isComputedPropertyName(token.parent) ? token.parent : token; - result.push(createCodeFixAction(fixName, deletion, [Diagnostics.Remove_declaration_for_Colon_0, name.getText(sourceFile)], fixIdDelete, Diagnostics.Delete_all_unused_declarations)); + if (token.kind === SyntaxKind.InferKeyword) { + const changes = textChanges.ChangeTracker.with(context, t => changeInferToUnknown(t, sourceFile, token)); + const name = cast(token.parent, isInferTypeNode).typeParameter.name.text; + result.push(createCodeFixAction(fixName, changes, [Diagnostics.Replace_infer_0_with_unknown, name], fixIdInfer, Diagnostics.Replace_all_unused_infer_with_unknown)); + } + else { + const deletion = textChanges.ChangeTracker.with(context, t => + tryDeleteDeclaration(sourceFile, token, t, checker, sourceFiles, /*isFixAll*/ false)); + if (deletion.length) { + const name = isComputedPropertyName(token.parent) ? token.parent : token; + result.push(createDeleteFix(deletion, [Diagnostics.Remove_declaration_for_Colon_0, name.getText(sourceFile)])); + } } const prefix = textChanges.ChangeTracker.with(context, t => tryPrefixDeclaration(t, errorCode, sourceFile, token)); @@ -51,7 +67,7 @@ namespace ts.codefix { return result; }, - fixIds: [fixIdPrefix, fixIdDelete], + fixIds: [fixIdPrefix, fixIdDelete, fixIdInfer], getAllCodeActions: context => { const { sourceFile, program } = context; const checker = program.getTypeChecker(); @@ -60,21 +76,31 @@ namespace ts.codefix { const token = getTokenAtPosition(sourceFile, diag.start); switch (context.fixId) { case fixIdPrefix: - if (isIdentifier(token) && canPrefix(token)) { - tryPrefixDeclaration(changes, diag.code, sourceFile, token); - } + tryPrefixDeclaration(changes, diag.code, sourceFile, token); break; case fixIdDelete: { + if (token.kind === SyntaxKind.InferKeyword) break; // Can't delete const importDecl = tryGetFullImport(token); if (importDecl) { changes.delete(sourceFile, importDecl); } + else if (isJSDocTemplateTag(token)) { + changes.delete(sourceFile, token); + } + else if (token.kind === SyntaxKind.LessThanToken) { + deleteTypeParameters(changes, sourceFile, token); + } else if (!tryDeleteFullDestructure(token, changes, sourceFile, checker, sourceFiles, /*isFixAll*/ true) && !tryDeleteFullVariableStatement(sourceFile, token, changes)) { tryDeleteDeclaration(sourceFile, token, changes, checker, sourceFiles, /*isFixAll*/ true); } break; } + case fixIdInfer: + if (token.kind === SyntaxKind.InferKeyword) { + changeInferToUnknown(changes, sourceFile, token); + } + break; default: Debug.fail(JSON.stringify(context.fixId)); } @@ -82,6 +108,18 @@ namespace ts.codefix { }, }); + function changeInferToUnknown(changes: textChanges.ChangeTracker, sourceFile: SourceFile, token: Node): void { + changes.replaceNode(sourceFile, token.parent, createKeywordTypeNode(SyntaxKind.UnknownKeyword)); + } + + function createDeleteFix(changes: FileTextChanges[], diag: DiagnosticAndArguments): CodeFixAction { + return createCodeFixAction(fixName, changes, diag, fixIdDelete, Diagnostics.Delete_all_unused_declarations); + } + + function deleteTypeParameters(changes: textChanges.ChangeTracker, sourceFile: SourceFile, token: Node): void { + changes.delete(sourceFile, Debug.assertDefined(cast(token.parent, isDeclarationWithTypeParameterChildren).typeParameters)); + } + // Sometimes the diagnostic span is an entire ImportDeclaration, so we should remove the whole thing. function tryGetFullImport(token: Node): ImportDeclaration | undefined { return token.kind === SyntaxKind.ImportKeyword ? tryCast(token.parent, isImportDeclaration) : undefined; @@ -110,7 +148,11 @@ namespace ts.codefix { function tryPrefixDeclaration(changes: textChanges.ChangeTracker, errorCode: number, sourceFile: SourceFile, token: Node): void { // Don't offer to prefix a property. - if (errorCode !== Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code && isIdentifier(token) && canPrefix(token)) { + if (errorCode === Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code) return; + if (token.kind === SyntaxKind.InferKeyword) { + token = cast(token.parent, isInferTypeNode).typeParameter.name; + } + if (isIdentifier(token) && canPrefix(token)) { changes.replaceNode(sourceFile, token, createIdentifier(`_${token.text}`)); } } @@ -118,6 +160,7 @@ namespace ts.codefix { function canPrefix(token: Identifier): boolean { switch (token.parent.kind) { case SyntaxKind.Parameter: + case SyntaxKind.TypeParameter: return true; case SyntaxKind.VariableDeclaration: { const varDecl = token.parent as VariableDeclaration; diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index bd1a50ac5f9..f8d1976ab77 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -275,7 +275,7 @@ namespace ts.codefix { ): ReadonlyArray { const isJs = isSourceFileJavaScript(sourceFile); const choicesForEachExportingModule = flatMap>(moduleSymbols, ({ moduleSymbol, importKind, exportedSymbolIsTypeOnly }) => { - const modulePathsGroups = moduleSpecifiers.getModuleSpecifiers(moduleSymbol, program.getCompilerOptions(), sourceFile, host, program.getSourceFiles(), preferences); + const modulePathsGroups = moduleSpecifiers.getModuleSpecifiers(moduleSymbol, program.getCompilerOptions(), sourceFile, host, program.getSourceFiles(), preferences, program.redirectTargetsMap); return modulePathsGroups.map(group => group.map((moduleSpecifier): FixAddNewImport | FixUseImportType => // `position` should only be undefined at a missing jsx namespace, in which case we shouldn't be looking for pure types. exportedSymbolIsTypeOnly && isJs ? { kind: ImportFixKind.ImportType, moduleSpecifier, position: Debug.assertDefined(position) } : { kind: ImportFixKind.AddNew, moduleSpecifier, importKind })); @@ -465,14 +465,14 @@ namespace ts.codefix { const { importClause, importKind } = fix; doAddExistingFix(changes, sourceFile, importClause, importKind === ImportKind.Default ? symbolName : undefined, importKind === ImportKind.Named ? [symbolName] : emptyArray); const moduleSpecifierWithoutQuotes = stripQuotes(importClause.parent.moduleSpecifier.getText()); - return [Diagnostics.Add_0_to_existing_import_declaration_from_1, symbolName, moduleSpecifierWithoutQuotes]; + return [importKind === ImportKind.Default ? Diagnostics.Add_default_import_0_to_existing_import_declaration_from_1 : Diagnostics.Add_0_to_existing_import_declaration_from_1, symbolName, moduleSpecifierWithoutQuotes]; // you too! } case ImportFixKind.AddNew: { const { importKind, moduleSpecifier } = fix; addNewImports(changes, sourceFile, moduleSpecifier, quotePreference, importKind === ImportKind.Default ? { defaultImport: symbolName, namedImports: emptyArray, namespaceLikeImport: undefined } : importKind === ImportKind.Named ? { defaultImport: undefined, namedImports: [symbolName], namespaceLikeImport: undefined } : { defaultImport: undefined, namedImports: emptyArray, namespaceLikeImport: { importKind, name: symbolName } }); - return [Diagnostics.Import_0_from_module_1, symbolName, moduleSpecifier]; + return [importKind === ImportKind.Default ? Diagnostics.Import_default_0_from_module_1 : Diagnostics.Import_0_from_module_1, symbolName, moduleSpecifier]; } default: return Debug.assertNever(fix); diff --git a/src/services/documentHighlights.ts b/src/services/documentHighlights.ts index 6976cd2ea20..f0f3c165d7e 100644 --- a/src/services/documentHighlights.ts +++ b/src/services/documentHighlights.ts @@ -28,7 +28,7 @@ namespace ts.DocumentHighlights { const map = arrayToMultiMap(referenceEntries.map(FindAllReferences.toHighlightSpan), e => e.fileName, e => e.span); return arrayFrom(map.entries(), ([fileName, highlightSpans]) => { if (!sourceFilesSet.has(fileName)) { - Debug.assert(program.redirectTargetsSet.has(fileName)); + Debug.assert(program.redirectTargetsMap.has(fileName)); const redirectTarget = program.getSourceFile(fileName); const redirect = find(sourceFilesToSearch, f => !!f.redirectInfo && f.redirectInfo.redirectTarget === redirectTarget)!; fileName = redirect.fileName; diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index b506dd5269f..c5554afd45e 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -354,12 +354,15 @@ namespace ts.formatting { case SyntaxKind.ClassExpression: case SyntaxKind.InterfaceDeclaration: case SyntaxKind.TypeAliasDeclaration: - return getListIfStartEndIsInListRange((node.parent).typeParameters, node.getStart(sourceFile), end); + case SyntaxKind.JSDocTemplateTag: { + const { typeParameters } = node.parent; + return getListIfStartEndIsInListRange(typeParameters, node.getStart(sourceFile), end); + } case SyntaxKind.NewExpression: case SyntaxKind.CallExpression: { const start = node.getStart(sourceFile); - return getListIfStartEndIsInListRange((node.parent).typeArguments, start, end) || - getListIfStartEndIsInListRange((node.parent).arguments, start, end); + return getListIfStartEndIsInListRange((node.parent).typeArguments, start, end) || + getListIfStartEndIsInListRange((node.parent).arguments, start, end); } case SyntaxKind.VariableDeclarationList: return getListIfStartEndIsInListRange((node.parent).declarations, node.getStart(sourceFile), end); diff --git a/src/services/getEditsForFileRename.ts b/src/services/getEditsForFileRename.ts index 75dd608e6c4..bd00ce5dd9e 100644 --- a/src/services/getEditsForFileRename.ts +++ b/src/services/getEditsForFileRename.ts @@ -156,7 +156,7 @@ namespace ts { // Need an update if the imported file moved, or the importing file moved and was using a relative path. return toImport !== undefined && (toImport.updated || (importingSourceFileMoved && pathIsRelative(importLiteral.text))) - ? moduleSpecifiers.getModuleSpecifier(program.getCompilerOptions(), sourceFile, newImportFromPath, toImport.newFileName, host, allFiles, preferences) + ? moduleSpecifiers.getModuleSpecifier(program.getCompilerOptions(), sourceFile, newImportFromPath, toImport.newFileName, host, allFiles, preferences, program.redirectTargetsMap) : undefined; }); } diff --git a/src/services/jsDoc.ts b/src/services/jsDoc.ts index 23fe3e63a9d..773d0b8b846 100644 --- a/src/services/jsDoc.ts +++ b/src/services/jsDoc.ts @@ -272,14 +272,16 @@ namespace ts.JsDoc { */ export function getDocCommentTemplateAtPosition(newLine: string, sourceFile: SourceFile, position: number): TextInsertion | undefined { - // Check if in a context where we don't want to perform any insertion - if (isInString(sourceFile, position) || isInComment(sourceFile, position) || hasDocComment(sourceFile, position)) { + const tokenAtPos = getTokenAtPosition(sourceFile, position); + const existingDocComment = findAncestor(tokenAtPos, isJSDoc); + if (existingDocComment && (existingDocComment.comment !== undefined || length(existingDocComment.tags))) { + // Non-empty comment already exists. return undefined; } - const tokenAtPos = getTokenAtPosition(sourceFile, position); const tokenStart = tokenAtPos.getStart(sourceFile); - if (!tokenAtPos || tokenStart < position) { + // Don't provide a doc comment template based on a *previous* node. (But an existing empty jsdoc comment will likely start before `position`.) + if (!existingDocComment && tokenStart < position) { return undefined; } diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index 653d9d0c59e..93baf2b4209 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -1240,7 +1240,7 @@ namespace ts.refactor.extractSymbol { return scope.members; } else { - assertTypeIsNever(scope); + assertType(scope); } return emptyArray; diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index 4db7f51fe61..6b06e411e2c 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -66,7 +66,7 @@ namespace ts.SignatureHelp { return undefined; } const candidates: Signature[] = []; - const resolvedSignature = checker.getResolvedSignature(invocation.node, candidates, argumentInfo.argumentCount)!; // TODO: GH#18217 + const resolvedSignature = checker.getResolvedSignatureForSignatureHelp(invocation.node, candidates, argumentInfo.argumentCount)!; // TODO: GH#18217 return candidates.length === 0 ? undefined : { candidates, resolvedSignature }; } else if (invocation.kind === InvocationKind.TypeArgs) { @@ -101,31 +101,16 @@ namespace ts.SignatureHelp { function createJavaScriptSignatureHelpItems(argumentInfo: ArgumentListInfo, program: Program, cancellationToken: CancellationToken): SignatureHelpItems | undefined { // See if we can find some symbol with the call expression name that has call signatures. const expression = getExpressionFromInvocation(argumentInfo.invocation); - const name = isIdentifier(expression) ? expression : isPropertyAccessExpression(expression) ? expression.name : undefined; - if (!name || !name.escapedText) { - return undefined; - } - + const name = isIdentifier(expression) ? expression.text : isPropertyAccessExpression(expression) ? expression.name.text : undefined; const typeChecker = program.getTypeChecker(); - for (const sourceFile of program.getSourceFiles()) { - const nameToDeclarations = sourceFile.getNamedDeclarations(); - const declarations = nameToDeclarations.get(name.text); - - if (declarations) { - for (const declaration of declarations) { - const symbol = declaration.symbol; - if (symbol) { - const type = typeChecker.getTypeOfSymbolAtLocation(symbol, declaration); - if (type) { - const callSignatures = type.getCallSignatures(); - if (callSignatures && callSignatures.length) { - return typeChecker.runWithCancellationToken(cancellationToken, typeChecker => createSignatureHelpItems(callSignatures, callSignatures[0], argumentInfo, sourceFile, typeChecker)); - } - } - } + return name === undefined ? undefined : firstDefined(program.getSourceFiles(), sourceFile => + firstDefined(sourceFile.getNamedDeclarations().get(name), declaration => { + const type = declaration.symbol && typeChecker.getTypeOfSymbolAtLocation(declaration.symbol, declaration); + const callSignatures = type && type.getCallSignatures(); + if (callSignatures && callSignatures.length) { + return typeChecker.runWithCancellationToken(cancellationToken, typeChecker => createSignatureHelpItems(callSignatures, callSignatures[0], argumentInfo, sourceFile, typeChecker)); } - } - } + })); } function lessThanFollowsCalledExpression(startingToken: Node, sourceFile: SourceFile, calledExpression: Expression) { diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index 670e1dc99a9..b297e8ae9c5 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -213,7 +213,7 @@ namespace ts.textChanges { private readonly changes: Change[] = []; private readonly newFiles: { readonly oldFile: SourceFile, readonly fileName: string, readonly statements: ReadonlyArray }[] = []; private readonly classesWithNodesInsertedAtStart = createMap(); // Set implemented as Map - private readonly deletedNodes: { readonly sourceFile: SourceFile, readonly node: Node }[] = []; + private readonly deletedNodes: { readonly sourceFile: SourceFile, readonly node: Node | NodeArray }[] = []; public static fromContext(context: TextChangesContext): ChangeTracker { return new ChangeTracker(getNewLineOrDefaultFromHost(context.host, context.formatContext.options), context.formatContext); @@ -233,8 +233,8 @@ namespace ts.textChanges { return this; } - delete(sourceFile: SourceFile, node: Node): void { - this.deletedNodes.push({ sourceFile, node, }); + delete(sourceFile: SourceFile, node: Node | NodeArray): void { + this.deletedNodes.push({ sourceFile, node }); } public deleteModifier(sourceFile: SourceFile, modifier: Modifier): void { @@ -661,7 +661,12 @@ namespace ts.textChanges { const deletedNodesInLists = new NodeSet(); // Stores ids of nodes in lists that we already deleted. Used to avoid deleting `, ` twice in `a, b`. for (const { sourceFile, node } of this.deletedNodes) { if (!this.deletedNodes.some(d => d.sourceFile === sourceFile && rangeContainsRangeExclusive(d.node, node))) { - deleteDeclaration.deleteDeclaration(this, deletedNodesInLists, sourceFile, node); + if (isArray(node)) { + this.deleteRange(sourceFile, rangeOfTypeParameters(node)); + } + else { + deleteDeclaration.deleteDeclaration(this, deletedNodesInLists, sourceFile, node); + } } } @@ -1001,7 +1006,7 @@ namespace ts.textChanges { } namespace deleteDeclaration { - export function deleteDeclaration(changes: ChangeTracker, deletedNodesInLists: NodeSet, sourceFile: SourceFile, node: Node): void { + export function deleteDeclaration(changes: ChangeTracker, deletedNodesInLists: NodeSet, sourceFile: SourceFile, node: Node): void { switch (node.kind) { case SyntaxKind.Parameter: { const oldFunction = node.parent; @@ -1052,33 +1057,9 @@ namespace ts.textChanges { deleteVariableDeclaration(changes, deletedNodesInLists, sourceFile, node as VariableDeclaration); break; - case SyntaxKind.TypeParameter: { - const typeParam = node as TypeParameterDeclaration; - switch (typeParam.parent.kind) { - case SyntaxKind.JSDocTemplateTag: - changes.deleteRange(sourceFile, getRangeToDeleteJsDocTag(typeParam.parent, sourceFile)); - break; - case SyntaxKind.InferType: - // TODO: GH#25594 - break; - default: { - const typeParameters = getEffectiveTypeParameterDeclarations(typeParam.parent); - if (typeParameters.length === 1) { - const { pos, end } = cast(typeParameters, isNodeArray); - const previousToken = getTokenAtPosition(sourceFile, pos - 1); - const nextToken = getTokenAtPosition(sourceFile, end); - Debug.assert(previousToken.kind === SyntaxKind.LessThanToken); - Debug.assert(nextToken.kind === SyntaxKind.GreaterThanToken); - - changes.deleteNodeRange(sourceFile, previousToken, nextToken); - } - else { - deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); - } - } - } + case SyntaxKind.TypeParameter: + deleteNodeInList(changes, deletedNodesInLists, sourceFile, node); break; - } case SyntaxKind.ImportSpecifier: const namedImports = (node as ImportSpecifier).parent; @@ -1144,7 +1125,7 @@ namespace ts.textChanges { } } - function deleteVariableDeclaration(changes: ChangeTracker, deletedNodesInLists: NodeSet, sourceFile: SourceFile, node: VariableDeclaration): void { + function deleteVariableDeclaration(changes: ChangeTracker, deletedNodesInLists: NodeSet, sourceFile: SourceFile, node: VariableDeclaration): void { const { parent } = node; if (parent.kind === SyntaxKind.CatchClause) { @@ -1177,12 +1158,6 @@ namespace ts.textChanges { Debug.assertNever(gp); } } - - function getRangeToDeleteJsDocTag(node: JSDocTag, sourceFile: SourceFile): TextRange { - const { parent } = node; - const toDelete = parent.kind === SyntaxKind.JSDocComment && parent.comment === undefined && parent.tags!.length === 1 ? parent : node; - return createTextRangeFromNode(toDelete, sourceFile); - } } /** Warning: This deletes comments too. See `copyComments` in `convertFunctionToEs6Class`. */ @@ -1193,7 +1168,7 @@ namespace ts.textChanges { changes.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); } - function deleteNodeInList(changes: ChangeTracker, deletedNodesInLists: NodeSet, sourceFile: SourceFile, node: Node): void { + function deleteNodeInList(changes: ChangeTracker, deletedNodesInLists: NodeSet, sourceFile: SourceFile, node: Node): void { const containingList = Debug.assertDefined(formatting.SmartIndenter.getContainingList(node, sourceFile)); const index = indexOfNode(containingList, node); Debug.assert(index !== -1); diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 283f8e18e0b..41037ed95c9 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -374,7 +374,7 @@ namespace ts { case SpecialPropertyAssignmentKind.Prototype: return ScriptElementKind.localClassElement; default: { - assertTypeIsNever(kind); + assertType(kind); return ScriptElementKind.unknown; } } @@ -1358,63 +1358,6 @@ namespace ts { return getPropertySymbolsFromBaseTypes(memberSymbol.parent!, memberSymbol.name, checker, _ => true) || false; } - export interface ReadonlyNodeSet { - has(node: Node): boolean; - forEach(cb: (node: Node) => void): void; - some(pred: (node: Node) => boolean): boolean; - } - - export class NodeSet implements ReadonlyNodeSet { - private map = createMap(); - - add(node: Node): void { - this.map.set(String(getNodeId(node)), node); - } - has(node: Node): boolean { - return this.map.has(String(getNodeId(node))); - } - forEach(cb: (node: Node) => void): void { - this.map.forEach(cb); - } - some(pred: (node: Node) => boolean): boolean { - return forEachEntry(this.map, pred) || false; - } - } - - export interface ReadonlyNodeMap { - get(node: TNode): TValue | undefined; - has(node: TNode): boolean; - } - - export class NodeMap implements ReadonlyNodeMap { - private map = createMap<{ node: TNode, value: TValue }>(); - - get(node: TNode): TValue | undefined { - const res = this.map.get(String(getNodeId(node))); - return res && res.value; - } - - getOrUpdate(node: TNode, setValue: () => TValue): TValue { - const res = this.get(node); - if (res) return res; - const value = setValue(); - this.set(node, value); - return value; - } - - set(node: TNode, value: TValue): void { - this.map.set(String(getNodeId(node)), { node, value }); - } - - has(node: TNode): boolean { - return this.map.has(String(getNodeId(node))); - } - - forEach(cb: (value: TValue, node: TNode) => void): void { - this.map.forEach(({ node, value }) => cb(value, node)); - } - } - export function getParentNodeInSpan(node: Node | undefined, file: SourceFile, span: TextSpan): Node | undefined { if (!node) return undefined; diff --git a/src/testRunner/unittests/factory.ts b/src/testRunner/unittests/factory.ts index e17311147ad..402c399d728 100644 --- a/src/testRunner/unittests/factory.ts +++ b/src/testRunner/unittests/factory.ts @@ -1,5 +1,8 @@ namespace ts { describe("FactoryAPI", () => { + function assertSyntaxKind(node: Node, expected: SyntaxKind) { + assert.strictEqual(node.kind, expected, `Actual: ${Debug.showSyntaxKind(node)} Expected: ${(ts as any).SyntaxKind[expected]}`); + } describe("createExportAssignment", () => { it("parenthesizes default export if necessary", () => { function checkExpression(expression: Expression) { @@ -9,7 +12,7 @@ namespace ts { /*isExportEquals*/ false, expression, ); - assert.strictEqual(node.expression.kind, SyntaxKind.ParenthesizedExpression); + assertSyntaxKind(node.expression, SyntaxKind.ParenthesizedExpression); } const clazz = createClassExpression(/*modifiers*/ undefined, "C", /*typeParameters*/ undefined, /*heritageClauses*/ undefined, [ @@ -39,7 +42,7 @@ namespace ts { /*equalsGreaterThanToken*/ undefined, body, ); - assert.strictEqual(node.body.kind, SyntaxKind.ParenthesizedExpression); + assertSyntaxKind(node.body, SyntaxKind.ParenthesizedExpression); } checkBody(createObjectLiteral()); @@ -50,5 +53,30 @@ namespace ts { checkBody(createBinary(createLiteral("a"), SyntaxKind.CommaToken, createLiteral("b"))); }); }); + + describe("createBinaryExpression", () => { + it("parenthesizes arrow function in RHS if necessary", () => { + const lhs = createIdentifier("foo"); + const rhs = createArrowFunction( + /*modifiers*/ undefined, + /*typeParameters*/ undefined, + [], + /*type*/ undefined, + /*equalsGreaterThanToken*/ undefined, + createBlock([]), + ); + function checkRhs(operator: BinaryOperator, expectParens: boolean) { + const node = createBinary(lhs, operator, rhs); + assertSyntaxKind(node.right, expectParens ? SyntaxKind.ParenthesizedExpression : SyntaxKind.ArrowFunction); + } + + checkRhs(SyntaxKind.CommaToken, /*expectParens*/ false); + checkRhs(SyntaxKind.EqualsToken, /*expectParens*/ false); + checkRhs(SyntaxKind.PlusEqualsToken, /*expectParens*/ false); + checkRhs(SyntaxKind.BarBarToken, /*expectParens*/ true); + checkRhs(SyntaxKind.AmpersandAmpersandToken, /*expectParens*/ true); + checkRhs(SyntaxKind.EqualsEqualsToken, /*expectParens*/ true); + }); + }); }); } diff --git a/src/testRunner/unittests/tscWatchMode.ts b/src/testRunner/unittests/tscWatchMode.ts index e6c805148ee..880c494645a 100644 --- a/src/testRunner/unittests/tscWatchMode.ts +++ b/src/testRunner/unittests/tscWatchMode.ts @@ -2262,8 +2262,11 @@ declare module "fs" { const files = [file, module, libFile]; const host = createWatchedSystem(files, { currentDirectory }); const watch = createWatchOfFilesAndCompilerOptions([file.path], host); + checkProgramActualFiles(watch(), [file.path, libFile.path]); checkOutputErrorsInitial(host, [getDiagnosticModuleNotFoundOfFile(watch(), file, "qqq")]); + checkWatchedDirectories(host, emptyArray, /*recursive*/ false); + checkWatchedDirectories(host, [`${currentDirectory}/node_modules`, `${currentDirectory}/node_modules/@types`], /*recursive*/ true); host.renameFolder(`${currentDirectory}/node_modules2`, `${currentDirectory}/node_modules`); host.runQueuedTimeoutCallbacks(); @@ -2622,7 +2625,7 @@ declare module "fs" { createWatchOfConfigFile("tsconfig.json", host); checkWatchedFilesDetailed(host, [libFile.path, mainFile.path, config.path, linkedPackageIndex.path, linkedPackageOther.path], 1); checkWatchedDirectories(host, emptyArray, /*recursive*/ false); - checkWatchedDirectoriesDetailed(host, [mainPackageRoot, linkedPackageRoot, `${mainPackageRoot}/node_modules/@types`, `${projectRoot}/node_modules/@types`], 1, /*recursive*/ true); + checkWatchedDirectoriesDetailed(host, [`${mainPackageRoot}/@scoped`, `${mainPackageRoot}/node_modules`, linkedPackageRoot, `${mainPackageRoot}/node_modules/@types`, `${projectRoot}/node_modules/@types`], 1, /*recursive*/ true); }); }); diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 309107923e9..7ae8fea9d59 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -176,6 +176,18 @@ namespace ts.projectSystem { return { ts: 0, tsx: 0, dts: 0, js: 0, jsx: 0, deferred: 0, ...nonZeroStats }; } + export interface ConfigFileDiagnostic { + fileName: string | undefined; + start: number | undefined; + length: number | undefined; + messageText: string; + category: DiagnosticCategory; + code: number; + reportsUnnecessary?: {}; + source?: string; + relatedInformation?: DiagnosticRelatedInformation[]; + } + export class TestServerEventManager { private events: server.ProjectServiceEvent[] = []; readonly session: TestSession; @@ -216,10 +228,14 @@ namespace ts.projectSystem { this.events.forEach(event => assert.notEqual(event.eventName, eventName)); } - checkSingleConfigFileDiagEvent(configFileName: string, triggerFile: string) { + checkSingleConfigFileDiagEvent(configFileName: string, triggerFile: string, errors: ReadonlyArray) { const eventData = this.getEvent(server.ConfigFileDiagEvent); assert.equal(eventData.configFileName, configFileName); assert.equal(eventData.triggerFile, triggerFile); + const actual = eventData.diagnostics.map(({ file, messageText, ...rest }) => ({ fileName: file && file.fileName, messageText: isString(messageText) ? messageText : "", ...rest })); + if (errors) { + assert.deepEqual(actual, errors); + } } assertProjectInfoTelemetryEvent(partial: Partial, configFile = "/tsconfig.json"): void { @@ -622,8 +638,8 @@ namespace ts.projectSystem { const configFileLocations = ["/a/b/c/", "/a/b/", "/a/", "/"]; const configFiles = flatMap(configFileLocations, location => [location + "tsconfig.json", location + "jsconfig.json"]); checkWatchedFiles(host, configFiles.concat(libFile.path, moduleFile.path)); - checkWatchedDirectories(host, [], /*recursive*/ false); - checkWatchedDirectories(host, ["/a/b/c", combinePaths(getDirectoryPath(appFile.path), nodeModulesAtTypes)], /*recursive*/ true); + checkWatchedDirectories(host, ["/a/b/c"], /*recursive*/ false); + checkWatchedDirectories(host, [combinePaths(getDirectoryPath(appFile.path), nodeModulesAtTypes)], /*recursive*/ true); }); it("can handle tsconfig file name with difference casing", () => { @@ -3035,21 +3051,18 @@ namespace ts.projectSystem { assert.isDefined(project); checkProjectActualFiles(project, map(files, file => file.path)); checkWatchedFiles(host, mapDefined(files, file => file === file1 ? undefined : file.path)); - checkWatchedDirectories(host, [], /*recursive*/ false); - const watchedRecursiveDirectories = ["/a/b/node_modules/@types"]; - watchedRecursiveDirectories.push("/a/b"); - checkWatchedDirectories(host, watchedRecursiveDirectories, /*recursive*/ true); + checkWatchedDirectoriesDetailed(host, ["/a/b"], 1, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, ["/a/b/node_modules/@types"], 1, /*recursive*/ true); files.push(file2); host.reloadFS(files); host.runQueuedTimeoutCallbacks(); - watchedRecursiveDirectories.pop(); checkNumberOfProjects(projectService, { configuredProjects: 1 }); assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); checkProjectActualFiles(project, mapDefined(files, file => file === file2a ? undefined : file.path)); checkWatchedFiles(host, mapDefined(files, file => file === file1 ? undefined : file.path)); - checkWatchedDirectories(host, [], /*recursive*/ false); - checkWatchedDirectories(host, watchedRecursiveDirectories, /*recursive*/ true); + checkWatchedDirectories(host, emptyArray, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, ["/a/b/node_modules/@types"], 1, /*recursive*/ true); // On next file open the files file2a should be closed and not watched any more projectService.openClientFile(file2.path); @@ -3057,8 +3070,8 @@ namespace ts.projectSystem { assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); checkProjectActualFiles(project, mapDefined(files, file => file === file2a ? undefined : file.path)); checkWatchedFiles(host, [libFile.path, configFile.path]); - checkWatchedDirectories(host, [], /*recursive*/ false); - checkWatchedDirectories(host, watchedRecursiveDirectories, /*recursive*/ true); + checkWatchedDirectories(host, emptyArray, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, ["/a/b/node_modules/@types"], 1, /*recursive*/ true); }); @@ -3098,7 +3111,7 @@ namespace ts.projectSystem { checkWatchedFiles(host, [libFile.path, module1.path, module2.path, configFile.path]); checkWatchedDirectories(host, [], /*recursive*/ false); const watchedRecursiveDirectories = getTypeRootsFromLocation(root + "/a/b/src"); - watchedRecursiveDirectories.push(`${root}/a/b/src`, `${root}/a/b/node_modules`); + watchedRecursiveDirectories.push(`${root}/a/b/src/node_modules`, `${root}/a/b/node_modules`); checkWatchedDirectories(host, watchedRecursiveDirectories, /*recursive*/ true); }); @@ -3479,6 +3492,102 @@ namespace ts.projectSystem { openFilesForSession([{ file, projectRootPath }], session); } }); + + describe("CompileOnSaveAffectedFileListRequest with and without projectFileName in request", () => { + const projectRoot = "/user/username/projects/myproject"; + const core: File = { + path: `${projectRoot}/core/core.ts`, + content: "let z = 10;" + }; + const app1: File = { + path: `${projectRoot}/app1/app.ts`, + content: "let x = 10;" + }; + const app2: File = { + path: `${projectRoot}/app2/app.ts`, + content: "let y = 10;" + }; + const app1Config: File = { + path: `${projectRoot}/app1/tsconfig.json`, + content: JSON.stringify({ + files: ["app.ts", "../core/core.ts"], + compilerOptions: { outFile : "build/output.js" }, + compileOnSave: true + }) + }; + const app2Config: File = { + path: `${projectRoot}/app2/tsconfig.json`, + content: JSON.stringify({ + files: ["app.ts", "../core/core.ts"], + compilerOptions: { outFile: "build/output.js" }, + compileOnSave: true + }) + }; + const files = [libFile, core, app1, app2, app1Config, app2Config]; + + function insertString(session: TestSession, file: File) { + session.executeCommandSeq({ + command: protocol.CommandTypes.Change, + arguments: { + file: file.path, + line: 1, + offset: 1, + endLine: 1, + endOffset: 1, + insertString: "let k = 1" + } + }); + } + + function getSession() { + const host = createServerHost(files); + const session = createSession(host); + openFilesForSession([app1, app2, core], session); + const service = session.getProjectService(); + checkNumberOfProjects(session.getProjectService(), { configuredProjects: 2 }); + const project1 = service.configuredProjects.get(app1Config.path)!; + const project2 = service.configuredProjects.get(app2Config.path)!; + checkProjectActualFiles(project1, [libFile.path, app1.path, core.path, app1Config.path]); + checkProjectActualFiles(project2, [libFile.path, app2.path, core.path, app2Config.path]); + insertString(session, app1); + insertString(session, app2); + assert.equal(project1.dirty, true); + assert.equal(project2.dirty, true); + return session; + } + + it("when projectFile is specified", () => { + const session = getSession(); + const response = session.executeCommandSeq({ + command: protocol.CommandTypes.CompileOnSaveAffectedFileList, + arguments: { + file: core.path, + projectFileName: app1Config.path + } + }).response; + assert.deepEqual(response, [ + { projectFileName: app1Config.path, fileNames: [core.path, app1.path], projectUsesOutFile: true } + ]); + assert.equal(session.getProjectService().configuredProjects.get(app1Config.path)!.dirty, false); + assert.equal(session.getProjectService().configuredProjects.get(app2Config.path)!.dirty, true); + }); + + it("when projectFile is not specified", () => { + const session = getSession(); + const response = session.executeCommandSeq({ + command: protocol.CommandTypes.CompileOnSaveAffectedFileList, + arguments: { + file: core.path + } + }).response; + assert.deepEqual(response, [ + { projectFileName: app1Config.path, fileNames: [core.path, app1.path], projectUsesOutFile: true }, + { projectFileName: app2Config.path, fileNames: [core.path, app2.path], projectUsesOutFile: true } + ]); + assert.equal(session.getProjectService().configuredProjects.get(app1Config.path)!.dirty, false); + assert.equal(session.getProjectService().configuredProjects.get(app2Config.path)!.dirty, false); + }); + }); }); describe("tsserverProjectSystem Proper errors", () => { @@ -4698,13 +4807,41 @@ namespace ts.projectSystem { }); describe("tsserverProjectSystem Configure file diagnostics events", () => { + function getUnknownCompilerOptionDiagnostic(configFile: File, prop: string): ConfigFileDiagnostic { + const d = Diagnostics.Unknown_compiler_option_0; + const start = configFile.content.indexOf(prop) - 1; // start at "prop" + return { + fileName: configFile.path, + start, + length: prop.length + 2, + messageText: formatStringFromArgs(d.message, [prop]), + category: d.category, + code: d.code, + reportsUnnecessary: undefined + }; + } + + function getFileNotFoundDiagnostic(configFile: File, relativeFileName: string): ConfigFileDiagnostic { + const findString = `{"path":"./${relativeFileName}"}`; + const d = Diagnostics.File_0_does_not_exist; + const start = configFile.content.indexOf(findString); + return { + fileName: configFile.path, + start, + length: findString.length, + messageText: formatStringFromArgs(d.message, [`${getDirectoryPath(configFile.path)}/${relativeFileName}`]), + category: d.category, + code: d.code, + reportsUnnecessary: undefined + }; + } it("are generated when the config file has errors", () => { - const file = { + const file: File = { path: "/a/b/app.ts", content: "let x = 10" }; - const configFile = { + const configFile: File = { path: "/a/b/tsconfig.json", content: `{ "compilerOptions": { @@ -4713,29 +4850,32 @@ namespace ts.projectSystem { } }` }; - const serverEventManager = new TestServerEventManager([file, configFile]); + const serverEventManager = new TestServerEventManager([file, libFile, configFile]); openFilesForSession([file], serverEventManager.session); - serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path, [ + getUnknownCompilerOptionDiagnostic(configFile, "foo"), + getUnknownCompilerOptionDiagnostic(configFile, "allowJS") + ]); }); it("are generated when the config file doesn't have errors", () => { - const file = { + const file: File = { path: "/a/b/app.ts", content: "let x = 10" }; - const configFile = { + const configFile: File = { path: "/a/b/tsconfig.json", content: `{ "compilerOptions": {} }` }; - const serverEventManager = new TestServerEventManager([file, configFile]); + const serverEventManager = new TestServerEventManager([file, libFile, configFile]); openFilesForSession([file], serverEventManager.session); - serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path, emptyArray); }); it("are generated when the config file changes", () => { - const file = { + const file: File = { path: "/a/b/app.ts", content: "let x = 10" }; @@ -4746,37 +4886,40 @@ namespace ts.projectSystem { }` }; - const serverEventManager = new TestServerEventManager([file, configFile]); + const files = [file, libFile, configFile]; + const serverEventManager = new TestServerEventManager(files); openFilesForSession([file], serverEventManager.session); - serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path, emptyArray); configFile.content = `{ "compilerOptions": { "haha": 123 } }`; - serverEventManager.host.reloadFS([file, configFile]); + serverEventManager.host.reloadFS(files); serverEventManager.host.runQueuedTimeoutCallbacks(); - serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, configFile.path); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, configFile.path, [ + getUnknownCompilerOptionDiagnostic(configFile, "haha") + ]); configFile.content = `{ "compilerOptions": {} }`; - serverEventManager.host.reloadFS([file, configFile]); + serverEventManager.host.reloadFS(files); serverEventManager.host.runQueuedTimeoutCallbacks(); - serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, configFile.path); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, configFile.path, emptyArray); }); it("are not generated when the config file does not include file opened and config file has errors", () => { - const file = { + const file: File = { path: "/a/b/app.ts", content: "let x = 10" }; - const file2 = { + const file2: File = { path: "/a/b/test.ts", content: "let x = 10" }; - const configFile = { + const configFile: File = { path: "/a/b/tsconfig.json", content: `{ "compilerOptions": { @@ -4792,11 +4935,11 @@ namespace ts.projectSystem { }); it("are not generated when the config file has errors but suppressDiagnosticEvents is true", () => { - const file = { + const file: File = { path: "/a/b/app.ts", content: "let x = 10" }; - const configFile = { + const configFile: File = { path: "/a/b/tsconfig.json", content: `{ "compilerOptions": { @@ -4805,21 +4948,21 @@ namespace ts.projectSystem { } }` }; - const serverEventManager = new TestServerEventManager([file, configFile], /*suppressDiagnosticEvents*/ true); + const serverEventManager = new TestServerEventManager([file, libFile, configFile], /*suppressDiagnosticEvents*/ true); openFilesForSession([file], serverEventManager.session); serverEventManager.hasZeroEvent("configFileDiag"); }); it("are not generated when the config file does not include file opened and doesnt contain any errors", () => { - const file = { + const file: File = { path: "/a/b/app.ts", content: "let x = 10" }; - const file2 = { + const file2: File = { path: "/a/b/test.ts", content: "let x = 10" }; - const configFile = { + const configFile: File = { path: "/a/b/tsconfig.json", content: `{ "files": ["app.ts"] @@ -4830,6 +4973,27 @@ namespace ts.projectSystem { openFilesForSession([file2], serverEventManager.session); serverEventManager.hasZeroEvent("configFileDiag"); }); + + it("contains the project reference errors", () => { + const file: File = { + path: "/a/b/app.ts", + content: "let x = 10" + }; + const noSuchTsconfig = "no-such-tsconfig.json"; + const configFile: File = { + path: "/a/b/tsconfig.json", + content: `{ + "files": ["app.ts"], + "references": [{"path":"./${noSuchTsconfig}"}] + }` + }; + + const serverEventManager = new TestServerEventManager([file, libFile, configFile]); + openFilesForSession([file], serverEventManager.session); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path, [ + getFileNotFoundDiagnostic(configFile, noSuchTsconfig) + ]); + }); }); describe("tsserverProjectSystem skipLibCheck", () => { @@ -6780,7 +6944,7 @@ namespace ts.projectSystem { const { configFileName } = projectService.openClientFile(file1.path); assert.equal(configFileName, tsconfigFile.path as server.NormalizedPath, `should find config`); // tslint:disable-line no-unnecessary-type-assertion (TODO: GH#18217) checkNumberOfConfiguredProjects(projectService, 1); - const watchingRecursiveDirectories = [`${canonicalFrontendDir}/src`, canonicalFrontendDir].concat(getNodeModuleDirectories(getDirectoryPath(canonicalFrontendDir))); + const watchingRecursiveDirectories = [`${canonicalFrontendDir}/src`, `${canonicalFrontendDir}/types`, `${canonicalFrontendDir}/node_modules`].concat(getNodeModuleDirectories(getDirectoryPath(canonicalFrontendDir))); const project = projectService.configuredProjects.get(canonicalConfigPath)!; verifyProjectAndWatchedDirectories(); @@ -6934,7 +7098,7 @@ namespace ts.projectSystem { const projectService = createProjectService(host); const { configFileName } = projectService.openClientFile(app.path); assert.equal(configFileName, tsconfigJson.path as server.NormalizedPath, `should find config`); // TODO: GH#18217 - const recursiveWatchedDirectories: string[] = [appFolder].concat(getNodeModuleDirectories(getDirectoryPath(appFolder))); + const recursiveWatchedDirectories: string[] = [`${appFolder}`, `${appFolder}/node_modules`].concat(getNodeModuleDirectories(getDirectoryPath(appFolder))); verifyProject(); let timeoutAfterReloadFs = timeoutDuringPartialInstallation; @@ -7014,7 +7178,7 @@ namespace ts.projectSystem { const lodashIndexPath = root + "/a/b/node_modules/@types/lodash/index.d.ts"; projectFiles.push(find(filesAndFoldersToAdd, f => f.path === lodashIndexPath)!); // we would now not have failed lookup in the parent of appFolder since lodash is available - recursiveWatchedDirectories.length = 1; + recursiveWatchedDirectories.length = 2; // npm installation complete, timeout after reload fs timeoutAfterReloadFs = true; verifyAfterPartialOrCompleteNpmInstall(2); @@ -7534,9 +7698,9 @@ namespace ts.projectSystem { const openFiles = [file1.path]; const watchedRecursiveDirectories = useSlashRootAsSomeNotRootFolderInUserDirectory ? // Folders of node_modules lookup not in changedRoot - ["a/b/project", "a/b/node_modules", "a/node_modules", "node_modules"].map(v => rootFolder + v) : + ["a/b/project", "a/b/project/node_modules", "a/b/node_modules", "a/node_modules", "node_modules"].map(v => rootFolder + v) : // Folder of tsconfig - ["/a/b/project"]; + ["/a/b/project", "/a/b/project/node_modules"]; const host = createServerHost(projectFiles); const { session, verifyInitialOpen, verifyProjectsUpdatedInBackgroundEventHandler } = createSession(host); const projectService = session.getProjectService(); @@ -7565,7 +7729,7 @@ namespace ts.projectSystem { host.reloadFS(projectFiles); host.runQueuedTimeoutCallbacks(); if (useSlashRootAsSomeNotRootFolderInUserDirectory) { - watchedRecursiveDirectories.length = 2; + watchedRecursiveDirectories.length = 3; } else { // file2 addition wont be detected @@ -7993,10 +8157,10 @@ new C();` checkCompleteEvent(session, 2, expectedSequenceId); } - function verifyWatchedFilesAndDirectories(host: TestServerHost, files: string[], recursiveDirectories: string[], nonRecursiveDirectories: string[]) { + function verifyWatchedFilesAndDirectories(host: TestServerHost, files: string[], recursiveDirectories: ReadonlyMap, nonRecursiveDirectories: string[]) { checkWatchedFilesDetailed(host, files.filter(f => f !== recognizersDateTimeSrcFile.path), 1); - checkWatchedDirectoriesDetailed(host, nonRecursiveDirectories, 1, /*recursive*/ false); - checkWatchedDirectoriesDetailed(host, recursiveDirectories, 1, /*recursive*/ true); + checkWatchedDirectoriesDetailed(host, nonRecursiveDirectories, 1, /*recursive*/ false); + checkWatchedDirectoriesDetailed(host, recursiveDirectories, /*recursive*/ true); } function createSessionAndOpenFile(host: TestServerHost) { @@ -8017,8 +8181,16 @@ new C();` const filesWithNodeModulesSetup = [...filesWithSources, nodeModulesRecorgnizersText]; const filesAfterCompilation = [...filesWithNodeModulesSetup, recongnizerTextDistTypingFile]; - const watchedDirectoriesWithResolvedModule = [`${recognizersDateTime}/src`, ...(withPathMapping ? emptyArray : [recognizersDateTime]), ...getTypeRootsFromLocation(recognizersDateTime)]; - const watchedDirectoriesWithUnresolvedModule = [recognizersDateTime, ...(withPathMapping ? [recognizersText] : emptyArray), ...watchedDirectoriesWithResolvedModule, ...getNodeModuleDirectories(packages)]; + const watchedDirectoriesWithResolvedModule = arrayToMap(getTypeRootsFromLocation(recognizersDateTime), k => k, () => 1); + watchedDirectoriesWithResolvedModule.set(`${recognizersDateTime}/src`, withPathMapping ? 1 : 2); // wild card + failed lookups + if (!withPathMapping) { + watchedDirectoriesWithResolvedModule.set(`${recognizersDateTime}/node_modules`, 1); // failed lookups + } + const watchedDirectoriesWithUnresolvedModule = cloneMap(watchedDirectoriesWithResolvedModule); + watchedDirectoriesWithUnresolvedModule.set(`${recognizersDateTime}/src`, 2); // wild card + failed lookups + [`${recognizersDateTime}/node_modules`, ...(withPathMapping ? [recognizersText] : emptyArray), ...getNodeModuleDirectories(packages)].forEach(d => { + watchedDirectoriesWithUnresolvedModule.set(d, 1); + }); const nonRecursiveWatchedDirectories = withPathMapping ? [packages] : emptyArray; function verifyProjectWithResolvedModule(session: TestSession) { @@ -8251,11 +8423,10 @@ new C();` return `Reusing resolution of module '${moduleName}' to file '${file.path}' from old program.`; } - function verifyWatchesWithConfigFile(host: TestServerHost, files: File[], openFile: File) { + function verifyWatchesWithConfigFile(host: TestServerHost, files: File[], openFile: File, extraExpectedDirectories?: ReadonlyArray) { checkWatchedFiles(host, mapDefined(files, f => f === openFile ? undefined : f.path)); checkWatchedDirectories(host, [], /*recursive*/ false); - const configDirectory = getDirectoryPath(configFile.path); - checkWatchedDirectories(host, [configDirectory, `${configDirectory}/${nodeModulesAtTypes}`], /*recursive*/ true); + checkWatchedDirectories(host, [projectLocation, `${projectLocation}/${nodeModulesAtTypes}`, ...(extraExpectedDirectories || emptyArray)], /*recursive*/ true); } describe("from files in same folder", () => { @@ -8299,6 +8470,7 @@ new C();` }); it("non relative module name", () => { + const expectedNonRelativeDirectories = [`${projectLocation}/node_modules`, `${projectLocation}/src`]; const module1Name = "module1"; const module2Name = "module2"; const fileContent = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; @@ -8312,7 +8484,7 @@ new C();` const expectedTrace = getExpectedNonRelativeModuleResolutionTrace(host, file1, module1, module1Name); getExpectedNonRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); verifyTrace(resolutionTrace, expectedTrace); - verifyWatchesWithConfigFile(host, files, file1); + verifyWatchesWithConfigFile(host, files, file1, expectedNonRelativeDirectories); file1.content += fileContent; file2.content += fileContent; @@ -8322,7 +8494,7 @@ new C();` getExpectedReusingResolutionFromOldProgram(file1, module1Name), getExpectedReusingResolutionFromOldProgram(file1, module2Name) ]); - verifyWatchesWithConfigFile(host, files, file1); + verifyWatchesWithConfigFile(host, files, file1, expectedNonRelativeDirectories); }); }); @@ -8391,6 +8563,7 @@ new C();` }); it("non relative module name", () => { + const expectedNonRelativeDirectories = [`${projectLocation}/node_modules`, `${projectLocation}/product`]; const module1Name = "module1"; const module2Name = "module2"; const fileContent = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; @@ -8410,7 +8583,7 @@ new C();` getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file3, module1, module1Name, getDirectoryPath(file4.path), expectedTrace); getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file3, module2, module2Name, getDirectoryPath(file4.path), expectedTrace); verifyTrace(resolutionTrace, expectedTrace); - verifyWatchesWithConfigFile(host, files, file1); + verifyWatchesWithConfigFile(host, files, file1, expectedNonRelativeDirectories); file1.content += fileContent; file2.content += fileContent; @@ -8423,7 +8596,7 @@ new C();` getExpectedReusingResolutionFromOldProgram(file1, module1Name), getExpectedReusingResolutionFromOldProgram(file1, module2Name) ]); - verifyWatchesWithConfigFile(host, files, file1); + verifyWatchesWithConfigFile(host, files, file1, expectedNonRelativeDirectories); }); it("non relative module name from inferred project", () => { @@ -8460,7 +8633,7 @@ new C();` watchedFiles.push(combinePaths(d, "tsconfig.json"), combinePaths(d, "jsconfig.json")); }); const watchedRecursiveDirectories = getTypeRootsFromLocation(currentDirectory).concat([ - currentDirectory, `${projectLocation}/product/${nodeModules}`, + `${currentDirectory}/node_modules`, `${currentDirectory}/feature`, `${projectLocation}/product/${nodeModules}`, `${projectLocation}/${nodeModules}`, `${projectLocation}/product/test/${nodeModules}`, `${projectLocation}/product/test/src/${nodeModules}` ]); @@ -8530,7 +8703,6 @@ export const x = 10;` outDir: "../out", baseUrl: "./", typeRoots: ["typings"] - } }) }; @@ -8546,13 +8718,15 @@ export const x = 10;` checkWatchedDirectories(host, emptyArray, /*recursive*/ false); // since fs resolves to ambient module, shouldnt watch failed lookup } else { - checkWatchedDirectoriesDetailed(host, [`${projectRoot}`], 1, /*recursive*/ false); // failed lookup for fs + checkWatchedDirectoriesDetailed(host, [`${projectRoot}`, `${projectRoot}/src`], 1, /*recursive*/ false); // failed lookup for fs } const expectedWatchedDirectories = createMap(); - expectedWatchedDirectories.set(`${projectRoot}/src`, 2); // Wild card and failed lookup + expectedWatchedDirectories.set(`${projectRoot}/src`, 1); // Wild card + expectedWatchedDirectories.set(`${projectRoot}/src/somefolder`, 1); // failedLookup for somefolder/module2 + expectedWatchedDirectories.set(`${projectRoot}/src/node_modules`, 1); // failed lookup for somefolder/module2 expectedWatchedDirectories.set(`${projectRoot}/somefolder`, 1); // failed lookup for somefolder/module2 expectedWatchedDirectories.set(`${projectRoot}/node_modules`, 1); // failed lookup for with node_modules/@types/fs - expectedWatchedDirectories.set(`${projectRoot}/src/typings`, 1); // typeroot directory + expectedWatchedDirectories.set(`${projectRoot}/src/typings`, useNodeFile ? 1 : 2); // typeroot directory + failed lookup if not using node file checkWatchedDirectoriesDetailed(host, expectedWatchedDirectories, /*recursive*/ true); } @@ -8943,7 +9117,7 @@ export function Test2() { }); }); - function makeSampleProjects() { + describe("tsserverProjectSystem project references", () => { const aTs: File = { path: "/a/a.ts", content: "export function fnA() {}\nexport interface IfaceA {}\nexport const instanceA: IfaceA = {};", @@ -8999,62 +9173,121 @@ export function Test2() { content: `export declare function fnB(): void;\n//# source${""}MappingURL=b.d.ts.map`, }; + const dummyFile: File = { + path: "/dummy/dummy.ts", + content: "let a = 10;" + }; + const userTs: File = { path: "/user/user.ts", content: 'import { fnA, instanceA } from "../a/bin/a";\nimport { fnB } from "../b/bin/b";\nexport function fnUser() { fnA(); fnB(); instanceA; }', }; - const host = createServerHost([aTs, aTsconfig, aDtsMap, aDts, bTsconfig, bTs, bDtsMap, bDts, userTs]); - const session = createSession(host); + function makeSampleProjects() { + const host = createServerHost([aTs, aTsconfig, aDtsMap, aDts, bTsconfig, bTs, bDtsMap, bDts, userTs, dummyFile]); + const session = createSession(host); - checkDeclarationFiles(aTs, session, [aDtsMap, aDts]); - checkDeclarationFiles(bTs, session, [bDtsMap, bDts]); + checkDeclarationFiles(aTs, session, [aDtsMap, aDts]); + checkDeclarationFiles(bTs, session, [bDtsMap, bDts]); - // Testing what happens if we delete the original sources. - host.removeFile(bTs.path); + // Testing what happens if we delete the original sources. + host.removeFile(bTs.path); - openFilesForSession([userTs], session); + openFilesForSession([userTs], session); + const service = session.getProjectService(); + checkNumberOfProjects(service, { inferredProjects: 1 }); + return session; + } - return { session, aTs, bDts, userTs }; - } + function verifyInferredProjectUnchanged(session: TestSession) { + checkProjectActualFiles(session.getProjectService().inferredProjects[0], [userTs.path, aDts.path, bDts.path]); + } + + function verifyDummyProject(session: TestSession) { + checkProjectActualFiles(session.getProjectService().inferredProjects[0], [dummyFile.path]); + } + + function verifyOnlyOrphanInferredProject(session: TestSession) { + openFilesForSession([dummyFile], session); + checkNumberOfProjects(session.getProjectService(), { inferredProjects: 1 }); + verifyDummyProject(session); + } + + function verifySingleInferredProject(session: TestSession) { + checkNumberOfProjects(session.getProjectService(), { inferredProjects: 1 }); + verifyInferredProjectUnchanged(session); + + // Close user file should close all the projects after opening dummy file + closeFilesForSession([userTs], session); + verifyOnlyOrphanInferredProject(session); + } + + function verifyATsConfigProject(session: TestSession) { + checkProjectActualFiles(session.getProjectService().configuredProjects.get(aTsconfig.path)!, [aTs.path, aTsconfig.path]); + } + + function verifyATsConfigOriginalProject(session: TestSession) { + checkNumberOfProjects(session.getProjectService(), { inferredProjects: 1, configuredProjects: 1 }); + verifyInferredProjectUnchanged(session); + verifyATsConfigProject(session); + // Close user file should close all the projects + closeFilesForSession([userTs], session); + verifyOnlyOrphanInferredProject(session); + } + + function verifyATsConfigWhenOpened(session: TestSession) { + checkNumberOfProjects(session.getProjectService(), { inferredProjects: 1, configuredProjects: 1 }); + verifyInferredProjectUnchanged(session); + verifyATsConfigProject(session); + + closeFilesForSession([userTs], session); + openFilesForSession([dummyFile], session); + checkNumberOfProjects(session.getProjectService(), { inferredProjects: 1, configuredProjects: 1 }); + verifyDummyProject(session); + verifyATsConfigProject(session); // ATsConfig should still be alive + } - describe("tsserverProjectSystem project references", () => { it("goToDefinition", () => { - const { session, aTs, userTs } = makeSampleProjects(); + const session = makeSampleProjects(); const response = executeSessionRequest(session, protocol.CommandTypes.Definition, protocolFileLocationFromSubstring(userTs, "fnA()")); assert.deepEqual(response, [protocolFileSpanFromSubstring(aTs, "fnA")]); + verifySingleInferredProject(session); }); it("getDefinitionAndBoundSpan", () => { - const { session, aTs, userTs } = makeSampleProjects(); + const session = makeSampleProjects(); const response = executeSessionRequest(session, protocol.CommandTypes.DefinitionAndBoundSpan, protocolFileLocationFromSubstring(userTs, "fnA()")); assert.deepEqual(response, { textSpan: protocolTextSpanFromSubstring(userTs.content, "fnA", { index: 1 }), definitions: [protocolFileSpanFromSubstring(aTs, "fnA")], }); + verifySingleInferredProject(session); }); it("goToType", () => { - const { session, aTs, userTs } = makeSampleProjects(); + const session = makeSampleProjects(); const response = executeSessionRequest(session, protocol.CommandTypes.TypeDefinition, protocolFileLocationFromSubstring(userTs, "instanceA")); assert.deepEqual(response, [protocolFileSpanFromSubstring(aTs, "IfaceA")]); + verifySingleInferredProject(session); }); it("goToImplementation", () => { - const { session, aTs, userTs } = makeSampleProjects(); + const session = makeSampleProjects(); const response = executeSessionRequest(session, protocol.CommandTypes.Implementation, protocolFileLocationFromSubstring(userTs, "fnA()")); assert.deepEqual(response, [protocolFileSpanFromSubstring(aTs, "fnA")]); + verifySingleInferredProject(session); }); it("goToDefinition -- target does not exist", () => { - const { session, bDts, userTs } = makeSampleProjects(); + const session = makeSampleProjects(); const response = executeSessionRequest(session, CommandNames.Definition, protocolFileLocationFromSubstring(userTs, "fnB()")); // bTs does not exist, so stick with bDts assert.deepEqual(response, [protocolFileSpanFromSubstring(bDts, "fnB")]); + verifySingleInferredProject(session); }); it("navigateTo", () => { - const { session, aTs, bDts, userTs } = makeSampleProjects(); + const session = makeSampleProjects(); const response = executeSessionRequest(session, CommandNames.Navto, { file: userTs.path, searchValue: "fn" }); assert.deepEqual | undefined>(response, [ { @@ -9082,6 +9315,8 @@ export function Test2() { kindModifiers: "export", }, ]); + + verifyATsConfigOriginalProject(session); }); const referenceATs = (aTs: File): protocol.ReferencesResponseItem => makeReferenceItem(aTs, /*isDefinition*/ true, "fnA", "export function fnA() {}"); @@ -9091,7 +9326,7 @@ export function Test2() { ]; it("findAllReferences", () => { - const { session, aTs, userTs } = makeSampleProjects(); + const session = makeSampleProjects(); const response = executeSessionRequest(session, protocol.CommandTypes.References, protocolFileLocationFromSubstring(userTs, "fnA()")); assert.deepEqual(response, { @@ -9100,10 +9335,12 @@ export function Test2() { symbolStartOffset: protocolLocationFromSubstring(userTs.content, "fnA()").offset, symbolDisplayString: "(alias) fnA(): void\nimport fnA", }); + + verifyATsConfigOriginalProject(session); }); it("findAllReferences -- starting at definition", () => { - const { session, aTs, userTs } = makeSampleProjects(); + const session = makeSampleProjects(); openFilesForSession([aTs], session); // If it's not opened, the reference isn't found. const response = executeSessionRequest(session, protocol.CommandTypes.References, protocolFileLocationFromSubstring(aTs, "fnA")); assert.deepEqual(response, { @@ -9112,10 +9349,11 @@ export function Test2() { symbolStartOffset: protocolLocationFromSubstring(aTs.content, "fnA").offset, symbolDisplayString: "function fnA(): void", }); + verifyATsConfigWhenOpened(session); }); it("findAllReferencesFull", () => { - const { session, aTs, userTs } = makeSampleProjects(); + const session = makeSampleProjects(); interface ReferencesFullRequest extends protocol.FileLocationRequest { command: protocol.CommandTypes.ReferencesFull; } interface ReferencesFullResponse extends protocol.Response { body: ReadonlyArray; } @@ -9172,10 +9410,11 @@ export function Test2() { ], } ]); + verifyATsConfigOriginalProject(session); }); it("findAllReferences -- target does not exist", () => { - const { session, bDts, userTs } = makeSampleProjects(); + const session = makeSampleProjects(); const response = executeSessionRequest(session, protocol.CommandTypes.References, protocolFileLocationFromSubstring(userTs, "fnB()")); assert.deepEqual(response, { @@ -9188,6 +9427,7 @@ export function Test2() { symbolStartOffset: protocolLocationFromSubstring(userTs.content, "fnB()").offset, symbolDisplayString: "(alias) fnB(): void\nimport fnB", }); + verifySingleInferredProject(session); }); const renameATs = (aTs: File): protocol.SpanGroup => ({ @@ -9203,7 +9443,7 @@ export function Test2() { }); it("renameLocations", () => { - const { session, aTs, userTs } = makeSampleProjects(); + const session = makeSampleProjects(); const response = executeSessionRequest(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(userTs, "fnA()")); assert.deepEqual(response, { info: { @@ -9216,10 +9456,11 @@ export function Test2() { }, locs: [renameUserTs(userTs), renameATs(aTs)], }); + verifyATsConfigOriginalProject(session); }); it("renameLocations -- starting at definition", () => { - const { session, aTs, userTs } = makeSampleProjects(); + const session = makeSampleProjects(); openFilesForSession([aTs], session); // If it's not opened, the reference isn't found. const response = executeSessionRequest(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(aTs, "fnA")); assert.deepEqual(response, { @@ -9233,20 +9474,22 @@ export function Test2() { }, locs: [renameATs(aTs), renameUserTs(userTs)], }); + verifyATsConfigWhenOpened(session); }); it("renameLocationsFull", () => { - const { session, aTs, userTs } = makeSampleProjects(); + const session = makeSampleProjects(); const response = executeSessionRequest(session, protocol.CommandTypes.RenameLocationsFull, protocolFileLocationFromSubstring(userTs, "fnA()")); assert.deepEqual>(response, [ documentSpanFromSubstring(userTs, "fnA"), documentSpanFromSubstring(userTs, "fnA", { index: 1 }), documentSpanFromSubstring(aTs, "fnA"), ]); + verifyATsConfigOriginalProject(session); }); it("renameLocations -- target does not exist", () => { - const { session, bDts, userTs } = makeSampleProjects(); + const session = makeSampleProjects(); const response = executeSessionRequest(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(userTs, "fnB()")); assert.deepEqual(response, { info: { @@ -9271,11 +9514,11 @@ export function Test2() { } ], }); - + verifySingleInferredProject(session); }); it("getEditsForFileRename", () => { - const { session, aTs, userTs } = makeSampleProjects(); + const session = makeSampleProjects(); const response = executeSessionRequest(session, protocol.CommandTypes.GetEditsForFileRename, { oldFilePath: aTs.path, newFilePath: "/a/aNew.ts", @@ -9288,10 +9531,64 @@ export function Test2() { ], }, ]); + verifySingleInferredProject(session); }); }); - describe("Untitled files", () => { + describe("duplicate packages", () => { + // Tests that 'moduleSpecifiers.ts' will import from the redirecting file, and not from the file it redirects to, if that can provide a global module specifier. + it("works with import fixes", () => { + const packageContent = "export const foo: number;"; + const packageJsonContent = JSON.stringify({ name: "foo", version: "1.2.3" }); + const aFooIndex: File = { path: "/a/node_modules/foo/index.d.ts", content: packageContent }; + const aFooPackage: File = { path: "/a/node_modules/foo/package.json", content: packageJsonContent }; + const bFooIndex: File = { path: "/b/node_modules/foo/index.d.ts", content: packageContent }; + const bFooPackage: File = { path: "/b/node_modules/foo/package.json", content: packageJsonContent }; + + const userContent = 'import("foo");\nfoo'; + const aUser: File = { path: "/a/user.ts", content: userContent }; + const bUser: File = { path: "/b/user.ts", content: userContent }; + const tsconfig: File = { + path: "/tsconfig.json", + content: "{}", + }; + + const host = createServerHost([aFooIndex, aFooPackage, bFooIndex, bFooPackage, aUser, bUser, tsconfig]); + const session = createSession(host); + + openFilesForSession([aUser, bUser], session); + + for (const user of [aUser, bUser]) { + const response = executeSessionRequest(session, protocol.CommandTypes.GetCodeFixes, { + file: user.path, + startLine: 2, + startOffset: 1, + endLine: 2, + endOffset: 4, + errorCodes: [Diagnostics.Cannot_find_name_0.code], + }); + assert.deepEqual | undefined>(response, [ + { + description: `Import 'foo' from module "foo"`, + fixName: "import", + fixId: "fixMissingImport", + fixAllDescription: "Add all missing imports", + changes: [{ + fileName: user.path, + textChanges: [{ + start: { line: 1, offset: 1 }, + end: { line: 1, offset: 1 }, + newText: 'import { foo } from "foo";\n\n', + }], + }], + commands: undefined, + }, + ]); + } + }); + }); + + describe("tsserverProjectSystem Untitled files", () => { it("Can convert positions to locations", () => { const aTs: File = { path: "/proj/a.ts", content: "" }; const tsconfig: File = { path: "/proj/tsconfig.json", content: "{}" }; diff --git a/src/testRunner/unittests/typingsInstaller.ts b/src/testRunner/unittests/typingsInstaller.ts index a2670483350..b9f6565c079 100644 --- a/src/testRunner/unittests/typingsInstaller.ts +++ b/src/testRunner/unittests/typingsInstaller.ts @@ -146,8 +146,10 @@ namespace ts.projectSystem { checkWatchedDirectories(host, emptyArray, /*recursive*/ false); const expectedWatchedDirectoriesRecursive = createMap(); - expectedWatchedDirectoriesRecursive.set("/a/b", 2); // TypingInstaller and wild card + expectedWatchedDirectoriesRecursive.set("/a/b", 1); // wild card expectedWatchedDirectoriesRecursive.set("/a/b/node_modules/@types", 1); // type root watch + expectedWatchedDirectoriesRecursive.set("/a/b/node_modules", 1); // TypingInstaller + expectedWatchedDirectoriesRecursive.set("/a/b/bower_components", 1); // TypingInstaller checkWatchedDirectoriesDetailed(host, expectedWatchedDirectoriesRecursive, /*recursive*/ true); installer.installAll(/*expectedCount*/ 1); @@ -844,9 +846,7 @@ namespace ts.projectSystem { checkWatchedDirectories(host, emptyArray, /*recursive*/ false); - const watchedRecursiveDirectoriesExpected = createMap(); - watchedRecursiveDirectoriesExpected.set("/", 2); // wild card + type installer - checkWatchedDirectoriesDetailed(host, watchedRecursiveDirectoriesExpected, /*recursive*/ true); + checkWatchedDirectoriesDetailed(host, ["/", "/node_modules", "/bower_components"], 1, /*recursive*/ true); installer.installAll(/*expectedCount*/ 1); diff --git a/src/tsserver/server.ts b/src/tsserver/server.ts index 17f38c3c7ce..3e5986e9408 100644 --- a/src/tsserver/server.ts +++ b/src/tsserver/server.ts @@ -455,7 +455,7 @@ namespace ts.server { break; } default: - assertTypeIsNever(response); + assertType(response); } } diff --git a/src/typingsInstallerCore/typingsInstaller.ts b/src/typingsInstallerCore/typingsInstaller.ts index 66e8e6fe3b8..44a51a01779 100644 --- a/src/typingsInstallerCore/typingsInstaller.ts +++ b/src/typingsInstallerCore/typingsInstaller.ts @@ -64,18 +64,24 @@ namespace ts.server.typingsInstaller { onRequestCompleted: RequestCompletedAction; } - function isPackageOrBowerJson(fileName: string) { - const base = getBaseFileName(fileName); - return base === "package.json" || base === "bower.json"; + function endsWith(str: string, suffix: string, caseSensitive: boolean): boolean { + const expectedPos = str.length - suffix.length; + return expectedPos >= 0 && + (str.indexOf(suffix, expectedPos) === expectedPos || + (!caseSensitive && compareStringsCaseInsensitive(str.substr(expectedPos), suffix) === Comparison.EqualTo)); } - function getDirectoryExcludingNodeModulesOrBowerComponents(f: string) { - const indexOfNodeModules = f.indexOf("/node_modules/"); - const indexOfBowerComponents = f.indexOf("/bower_components/"); - const subStrLength = indexOfNodeModules === -1 || indexOfBowerComponents === -1 ? - Math.max(indexOfNodeModules, indexOfBowerComponents) : - Math.min(indexOfNodeModules, indexOfBowerComponents); - return subStrLength === -1 ? f : f.substr(0, subStrLength); + function isPackageOrBowerJson(fileName: string, caseSensitive: boolean) { + return endsWith(fileName, "/package.json", caseSensitive) || endsWith(fileName, "/bower.json", caseSensitive); + } + + function sameFiles(a: string, b: string, caseSensitive: boolean) { + return a === b || (!caseSensitive && compareStringsCaseInsensitive(a, b) === Comparison.EqualTo); + } + + const enum ProjectWatcherType { + FileWatcher = "FileWatcher", + DirectoryWatcher = "DirectoryWatcher" } type ProjectWatchers = Map & { isInvoked?: boolean; }; @@ -88,7 +94,7 @@ namespace ts.server.typingsInstaller { private safeList: JsTyping.SafeList | undefined; readonly pendingRunRequests: PendingRequest[] = []; private readonly toCanonicalFileName: GetCanonicalFileName; - private readonly globalCacheCanonicalPackageJsonPath: string; + private readonly globalCachePackageJsonPath: string; private installRunCount = 1; private inFlightRequestCount = 0; @@ -103,7 +109,7 @@ namespace ts.server.typingsInstaller { private readonly throttleLimit: number, protected readonly log = nullLog) { this.toCanonicalFileName = createGetCanonicalFileName(installTypingHost.useCaseSensitiveFileNames); - this.globalCacheCanonicalPackageJsonPath = combinePaths(this.toCanonicalFileName(globalCachePath), "package.json"); + this.globalCachePackageJsonPath = combinePaths(globalCachePath, "package.json"); if (this.log.isEnabled()) { this.log.writeLine(`Global cache location '${globalCachePath}', safe file path '${safeListPath}', types map path ${typesMapLocation}`); } @@ -406,84 +412,79 @@ namespace ts.server.typingsInstaller { watchers.isInvoked = false; const isLoggingEnabled = this.log.isEnabled(); - const createProjectWatcher = (path: string, createWatch: (path: string) => FileWatcher) => { - toRemove.delete(path); - if (watchers.has(path)) { + const createProjectWatcher = (path: string, projectWatcherType: ProjectWatcherType) => { + const canonicalPath = this.toCanonicalFileName(path); + toRemove.delete(canonicalPath); + if (watchers.has(canonicalPath)) { return; } - watchers.set(path, createWatch(path)); - }; - const createProjectFileWatcher = (file: string): FileWatcher => { if (isLoggingEnabled) { - this.log.writeLine(`FileWatcher:: Added:: WatchInfo: ${file}`); + this.log.writeLine(`${projectWatcherType}:: Added:: WatchInfo: ${path}`); } - const watcher = this.installTypingHost.watchFile!(file, (f, eventKind) => { // TODO: GH#18217 - if (isLoggingEnabled) { - this.log.writeLine(`FileWatcher:: Triggered with ${f} eventKind: ${FileWatcherEventKind[eventKind]}:: WatchInfo: ${file}:: handler is already invoked '${watchers.isInvoked}'`); - } - if (!watchers.isInvoked) { - watchers.isInvoked = true; - this.sendResponse({ projectName, kind: ActionInvalidate }); - } - }, /*pollingInterval*/ 2000); + const watcher = projectWatcherType === ProjectWatcherType.FileWatcher ? + this.installTypingHost.watchFile!(path, (f, eventKind) => { // TODO: GH#18217 + if (isLoggingEnabled) { + this.log.writeLine(`FileWatcher:: Triggered with ${f} eventKind: ${FileWatcherEventKind[eventKind]}:: WatchInfo: ${path}:: handler is already invoked '${watchers.isInvoked}'`); + } + if (!watchers.isInvoked) { + watchers.isInvoked = true; + this.sendResponse({ projectName, kind: ActionInvalidate }); + } + }, /*pollingInterval*/ 2000) : + this.installTypingHost.watchDirectory!(path, f => { // TODO: GH#18217 + if (isLoggingEnabled) { + this.log.writeLine(`DirectoryWatcher:: Triggered with ${f} :: WatchInfo: ${path} recursive :: handler is already invoked '${watchers.isInvoked}'`); + } + if (watchers.isInvoked || !fileExtensionIs(f, Extension.Json)) { + return; + } - return isLoggingEnabled ? { + if (isPackageOrBowerJson(f, this.installTypingHost.useCaseSensitiveFileNames) && + !sameFiles(f, this.globalCachePackageJsonPath, this.installTypingHost.useCaseSensitiveFileNames)) { + watchers.isInvoked = true; + this.sendResponse({ projectName, kind: ActionInvalidate }); + } + }, /*recursive*/ true); + + watchers.set(canonicalPath, isLoggingEnabled ? { close: () => { - this.log.writeLine(`FileWatcher:: Closed:: WatchInfo: ${file}`); + this.log.writeLine(`${projectWatcherType}:: Closed:: WatchInfo: ${path}`); watcher.close(); } - } : watcher; - }; - const createProjectDirectoryWatcher = (dir: string): FileWatcher => { - if (isLoggingEnabled) { - this.log.writeLine(`DirectoryWatcher:: Added:: WatchInfo: ${dir} recursive`); - } - const watcher = this.installTypingHost.watchDirectory!(dir, f => { // TODO: GH#18217 - if (isLoggingEnabled) { - this.log.writeLine(`DirectoryWatcher:: Triggered with ${f} :: WatchInfo: ${dir} recursive :: handler is already invoked '${watchers.isInvoked}'`); - } - if (watchers.isInvoked) { - return; - } - f = this.toCanonicalFileName(f); - if (f !== this.globalCacheCanonicalPackageJsonPath && isPackageOrBowerJson(f)) { - watchers.isInvoked = true; - this.sendResponse({ projectName, kind: ActionInvalidate }); - } - }, /*recursive*/ true); - - return isLoggingEnabled ? { - close: () => { - this.log.writeLine(`DirectoryWatcher:: Closed:: WatchInfo: ${dir} recursive`); - watcher.close(); - } - } : watcher; + } : watcher); }; // Create watches from list of files for (const file of files) { - const filePath = this.toCanonicalFileName(file); - if (isPackageOrBowerJson(filePath)) { + if (file.endsWith("/package.json") || file.endsWith("/bower.json")) { // package.json or bower.json exists, watch the file to detect changes and update typings - createProjectWatcher(filePath, createProjectFileWatcher); + createProjectWatcher(file, ProjectWatcherType.FileWatcher); continue; } // path in projectRoot, watch project root - if (containsPath(projectRootPath, filePath, projectRootPath, !this.installTypingHost.useCaseSensitiveFileNames)) { - createProjectWatcher(projectRootPath, createProjectDirectoryWatcher); + if (containsPath(projectRootPath, file, projectRootPath, !this.installTypingHost.useCaseSensitiveFileNames)) { + const subDirectory = file.indexOf(directorySeparator, projectRootPath.length + 1); + if (subDirectory !== -1) { + // Watch subDirectory + createProjectWatcher(file.substr(0, subDirectory), ProjectWatcherType.DirectoryWatcher); + } + else { + // Watch the directory itself + createProjectWatcher(file, ProjectWatcherType.DirectoryWatcher); + } continue; } // path in global cache, watch global cache - if (containsPath(this.globalCachePath, filePath, projectRootPath, !this.installTypingHost.useCaseSensitiveFileNames)) { - createProjectWatcher(this.globalCachePath, createProjectDirectoryWatcher); + if (containsPath(this.globalCachePath, file, projectRootPath, !this.installTypingHost.useCaseSensitiveFileNames)) { + createProjectWatcher(this.globalCachePath, ProjectWatcherType.DirectoryWatcher); continue; } - // Get path without node_modules and bower_components - createProjectWatcher(getDirectoryExcludingNodeModulesOrBowerComponents(getDirectoryPath(filePath)), createProjectDirectoryWatcher); + // watch node_modules or bower_components + createProjectWatcher(file, ProjectWatcherType.DirectoryWatcher); } // Remove unused watches diff --git a/tests/baselines/reference/1.0lib-noErrors.types b/tests/baselines/reference/1.0lib-noErrors.types index 96e5acc7049..1d9c67834e7 100644 --- a/tests/baselines/reference/1.0lib-noErrors.types +++ b/tests/baselines/reference/1.0lib-noErrors.types @@ -103,8 +103,6 @@ declare function encodeURIComponent(uriComponent: string): string; >uriComponent : string interface PropertyDescriptor { ->PropertyDescriptor : PropertyDescriptor - configurable?: boolean; >configurable : boolean @@ -126,20 +124,14 @@ interface PropertyDescriptor { } interface PropertyDescriptorMap { ->PropertyDescriptorMap : PropertyDescriptorMap - [s: string]: PropertyDescriptor; >s : string ->PropertyDescriptor : PropertyDescriptor } interface Object { ->Object : Object - /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ constructor: Function; >constructor : Function ->Function : Function /** Returns a string representation of an object. */ toString(): string; @@ -152,7 +144,6 @@ interface Object { /** Returns the primitive value of the specified object. */ valueOf(): Object; >valueOf : () => Object ->Object : Object /** * Determines whether an object has a property with the specified name. @@ -169,7 +160,6 @@ interface Object { isPrototypeOf(v: Object): boolean; >isPrototypeOf : (v: Object) => boolean >v : Object ->Object : Object /** * Determines whether a specified property is enumerable. @@ -188,7 +178,6 @@ declare var Object: { new (value?: any): Object; >value : any ->Object : Object (): any; (value: any): any; @@ -197,7 +186,6 @@ declare var Object: { /** A reference to the prototype for a class of objects. */ prototype: Object; >prototype : Object ->Object : Object /** * Returns the prototype of an object. @@ -217,7 +205,6 @@ declare var Object: { >getOwnPropertyDescriptor : (o: any, p: string) => PropertyDescriptor >o : any >p : string ->PropertyDescriptor : PropertyDescriptor /** * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly @@ -237,7 +224,6 @@ declare var Object: { >create : (o: any, properties?: PropertyDescriptorMap) => any >o : any >properties : PropertyDescriptorMap ->PropertyDescriptorMap : PropertyDescriptorMap /** * Adds a property to an object, or modifies attributes of an existing property. @@ -250,7 +236,6 @@ declare var Object: { >o : any >p : string >attributes : PropertyDescriptor ->PropertyDescriptor : PropertyDescriptor /** * Adds one or more properties to an object, and/or modifies attributes of existing properties. @@ -261,7 +246,6 @@ declare var Object: { >defineProperties : (o: any, properties: PropertyDescriptorMap) => any >o : any >properties : PropertyDescriptorMap ->PropertyDescriptorMap : PropertyDescriptorMap /** * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. @@ -324,8 +308,6 @@ declare var Object: { * Creates a new function. */ interface Function { ->Function : Function - /** * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. * @param thisArg The object to be used as the this object. @@ -369,7 +351,6 @@ interface Function { caller: Function; >caller : Function ->Function : Function } declare var Function: { @@ -381,20 +362,15 @@ declare var Function: { */ new (...args: string[]): Function; >args : string[] ->Function : Function (...args: string[]): Function; >args : string[] ->Function : Function prototype: Function; >prototype : Function ->Function : Function } interface IArguments { ->IArguments : IArguments - [index: number]: any; >index : number @@ -403,12 +379,9 @@ interface IArguments { callee: Function; >callee : Function ->Function : Function } interface String { ->String : String - /** Returns a string representation of a string. */ toString(): string; >toString : () => string @@ -480,7 +453,6 @@ interface String { match(regexp: RegExp): string[]; >match : { (regexp: string): string[]; (regexp: RegExp): string[]; } >regexp : RegExp ->RegExp : RegExp /** * Replaces text in a string, using a regular expression or search string. @@ -512,7 +484,6 @@ interface String { replace(searchValue: RegExp, replaceValue: string): string; >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; } >searchValue : RegExp ->RegExp : RegExp >replaceValue : string /** @@ -523,7 +494,6 @@ interface String { replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; } >searchValue : RegExp ->RegExp : RegExp >replaceValue : (substring: string, ...args: any[]) => string >substring : string >args : any[] @@ -543,7 +513,6 @@ interface String { search(regexp: RegExp): number; >search : { (regexp: string): number; (regexp: RegExp): number; } >regexp : RegExp ->RegExp : RegExp /** * Returns a section of a string. @@ -574,7 +543,6 @@ interface String { split(separator: RegExp, limit?: number): string[]; >split : { (separator: string, limit?: number): string[]; (separator: RegExp, limit?: number): string[]; } >separator : RegExp ->RegExp : RegExp >limit : number /** @@ -635,14 +603,12 @@ declare var String: { new (value?: any): String; >value : any ->String : String (value?: any): string; >value : any prototype: String; >prototype : String ->String : String fromCharCode(...codes: number[]): string; >fromCharCode : (...codes: number[]) => string @@ -650,26 +616,21 @@ declare var String: { } interface Boolean { ->Boolean : Boolean } declare var Boolean: { >Boolean : { (value?: any): boolean; new (value?: any): Boolean; prototype: Boolean; } new (value?: any): Boolean; >value : any ->Boolean : Boolean (value?: any): boolean; >value : any prototype: Boolean; >prototype : Boolean ->Boolean : Boolean } interface Number { ->Number : Number - /** * Returns a string representation of an object. * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. @@ -709,14 +670,12 @@ declare var Number: { new (value?: any): Number; >value : any ->Number : Number (value?: any): number; >value : any prototype: Number; >prototype : Number ->Number : Number /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ MAX_VALUE: number; @@ -749,8 +708,6 @@ declare var Number: { } interface Math { ->Math : Math - /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ E: number; >E : number @@ -931,12 +888,9 @@ interface Math { /** An intrinsic object that provides basic mathematics functionality and constants. */ declare var Math: Math; >Math : Math ->Math : Math /** Enables basic storage and retrieval of dates and times. */ interface Date { ->Date : Date - /** Returns a string representation of a date. The format of the string depends on the locale. */ toString(): string; >toString : () => string @@ -1211,15 +1165,11 @@ declare var Date: { >Date : { (): string; new (): Date; new (value: number): Date; new (value: string): Date; new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; prototype: Date; parse(s: string): number; UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; now(): number; } new (): Date; ->Date : Date - new (value: number): Date; >value : number ->Date : Date new (value: string): Date; >value : string ->Date : Date new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; >year : number @@ -1229,12 +1179,10 @@ declare var Date: { >minutes : number >seconds : number >ms : number ->Date : Date (): string; prototype: Date; >prototype : Date ->Date : Date /** * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. @@ -1269,8 +1217,6 @@ declare var Date: { } interface RegExpExecArray { ->RegExpExecArray : RegExpExecArray - [index: number]: string; >index : number @@ -1406,8 +1352,6 @@ interface RegExpExecArray { interface RegExp { ->RegExp : RegExp - /** * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. * @param string The String object or string literal on which to perform the search. @@ -1415,7 +1359,6 @@ interface RegExp { exec(string: string): RegExpExecArray; >exec : (string: string) => RegExpExecArray >string : string ->RegExpExecArray : RegExpExecArray /** * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. @@ -1447,7 +1390,6 @@ interface RegExp { // Non-standard extensions compile(): RegExp; >compile : () => RegExp ->RegExp : RegExp } declare var RegExp: { >RegExp : { (pattern: string, flags?: string): RegExp; new (pattern: string, flags?: string): RegExp; $1: string; $2: string; $3: string; $4: string; $5: string; $6: string; $7: string; $8: string; $9: string; lastMatch: string; } @@ -1455,12 +1397,10 @@ declare var RegExp: { new (pattern: string, flags?: string): RegExp; >pattern : string >flags : string ->RegExp : RegExp (pattern: string, flags?: string): RegExp; >pattern : string >flags : string ->RegExp : RegExp // Non-standard extensions $1: string; @@ -1495,8 +1435,6 @@ declare var RegExp: { } interface Error { ->Error : Error - name: string; >name : string @@ -1508,140 +1446,105 @@ declare var Error: { new (message?: string): Error; >message : string ->Error : Error (message?: string): Error; >message : string ->Error : Error prototype: Error; >prototype : Error ->Error : Error } interface EvalError extends Error { ->EvalError : EvalError ->Error : Error } declare var EvalError: { >EvalError : { (message?: string): EvalError; new (message?: string): EvalError; prototype: EvalError; } new (message?: string): EvalError; >message : string ->EvalError : EvalError (message?: string): EvalError; >message : string ->EvalError : EvalError prototype: EvalError; >prototype : EvalError ->EvalError : EvalError } interface RangeError extends Error { ->RangeError : RangeError ->Error : Error } declare var RangeError: { >RangeError : { (message?: string): RangeError; new (message?: string): RangeError; prototype: RangeError; } new (message?: string): RangeError; >message : string ->RangeError : RangeError (message?: string): RangeError; >message : string ->RangeError : RangeError prototype: RangeError; >prototype : RangeError ->RangeError : RangeError } interface ReferenceError extends Error { ->ReferenceError : ReferenceError ->Error : Error } declare var ReferenceError: { >ReferenceError : { (message?: string): ReferenceError; new (message?: string): ReferenceError; prototype: ReferenceError; } new (message?: string): ReferenceError; >message : string ->ReferenceError : ReferenceError (message?: string): ReferenceError; >message : string ->ReferenceError : ReferenceError prototype: ReferenceError; >prototype : ReferenceError ->ReferenceError : ReferenceError } interface SyntaxError extends Error { ->SyntaxError : SyntaxError ->Error : Error } declare var SyntaxError: { >SyntaxError : { (message?: string): SyntaxError; new (message?: string): SyntaxError; prototype: SyntaxError; } new (message?: string): SyntaxError; >message : string ->SyntaxError : SyntaxError (message?: string): SyntaxError; >message : string ->SyntaxError : SyntaxError prototype: SyntaxError; >prototype : SyntaxError ->SyntaxError : SyntaxError } interface TypeError extends Error { ->TypeError : TypeError ->Error : Error } declare var TypeError: { >TypeError : { (message?: string): TypeError; new (message?: string): TypeError; prototype: TypeError; } new (message?: string): TypeError; >message : string ->TypeError : TypeError (message?: string): TypeError; >message : string ->TypeError : TypeError prototype: TypeError; >prototype : TypeError ->TypeError : TypeError } interface URIError extends Error { ->URIError : URIError ->Error : Error } declare var URIError: { >URIError : { (message?: string): URIError; new (message?: string): URIError; prototype: URIError; } new (message?: string): URIError; >message : string ->URIError : URIError (message?: string): URIError; >message : string ->URIError : URIError prototype: URIError; >prototype : URIError ->URIError : URIError } interface JSON { ->JSON : JSON - /** * Converts a JavaScript Object Notation (JSON) string into an object. * @param text A valid JSON string. @@ -1716,7 +1619,6 @@ interface JSON { */ declare var JSON: JSON; >JSON : JSON ->JSON : JSON ///////////////////////////// @@ -1724,9 +1626,6 @@ declare var JSON: JSON; ///////////////////////////// interface Array { ->Array : T[] ->T : T - /** * Returns a string representation of an array. */ @@ -1742,11 +1641,7 @@ interface Array { */ concat(...items: U[]): T[]; >concat : { (...items: U[]): T[]; (...items: T[]): T[]; } ->U : U ->T : T >items : U[] ->U : U ->T : T /** * Combines two or more arrays. @@ -1755,8 +1650,6 @@ interface Array { concat(...items: T[]): T[]; >concat : { (...items: U[]): T[]; (...items: T[]): T[]; } >items : T[] ->T : T ->T : T /** * Adds all the elements of an array separated by the specified separator string. @@ -1771,7 +1664,6 @@ interface Array { */ pop(): T; >pop : () => T ->T : T /** * Appends new elements to an array, and returns the new length of the array. @@ -1780,21 +1672,18 @@ interface Array { push(...items: T[]): number; >push : (...items: T[]) => number >items : T[] ->T : T /** * Reverses the elements in an Array. */ reverse(): T[]; >reverse : () => T[] ->T : T /** * Removes the first element from an array and returns it. */ shift(): T; >shift : () => T ->T : T /** * Returns a section of an array. @@ -1805,7 +1694,6 @@ interface Array { >slice : (start?: number, end?: number) => T[] >start : number >end : number ->T : T /** * Sorts an array. @@ -1815,10 +1703,7 @@ interface Array { >sort : (compareFn?: (a: T, b: T) => number) => T[] >compareFn : (a: T, b: T) => number >a : T ->T : T >b : T ->T : T ->T : T /** * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. @@ -1827,7 +1712,6 @@ interface Array { splice(start: number): T[]; >splice : { (start: number): T[]; (start: number, deleteCount: number, ...items: T[]): T[]; } >start : number ->T : T /** * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. @@ -1840,8 +1724,6 @@ interface Array { >start : number >deleteCount : number >items : T[] ->T : T ->T : T /** * Inserts new elements at the start of an array. @@ -1850,7 +1732,6 @@ interface Array { unshift(...items: T[]): number; >unshift : (...items: T[]) => number >items : T[] ->T : T /** * Returns the index of the first occurrence of a value in an array. @@ -1860,7 +1741,6 @@ interface Array { indexOf(searchElement: T, fromIndex?: number): number; >indexOf : (searchElement: T, fromIndex?: number) => number >searchElement : T ->T : T >fromIndex : number /** @@ -1871,7 +1751,6 @@ interface Array { lastIndexOf(searchElement: T, fromIndex?: number): number; >lastIndexOf : (searchElement: T, fromIndex?: number) => number >searchElement : T ->T : T >fromIndex : number /** @@ -1883,10 +1762,8 @@ interface Array { >every : (callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any) => boolean >callbackfn : (value: T, index: number, array: T[]) => boolean >value : T ->T : T >index : number >array : T[] ->T : T >thisArg : any /** @@ -1898,10 +1775,8 @@ interface Array { >some : (callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any) => boolean >callbackfn : (value: T, index: number, array: T[]) => boolean >value : T ->T : T >index : number >array : T[] ->T : T >thisArg : any /** @@ -1913,10 +1788,8 @@ interface Array { >forEach : (callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any) => void >callbackfn : (value: T, index: number, array: T[]) => void >value : T ->T : T >index : number >array : T[] ->T : T >thisArg : any /** @@ -1926,16 +1799,11 @@ interface Array { */ map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; >map : (callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[] ->U : U >callbackfn : (value: T, index: number, array: T[]) => U >value : T ->T : T >index : number >array : T[] ->T : T ->U : U >thisArg : any ->U : U /** * Returns the elements of an array that meet the condition specified in a callback function. @@ -1946,12 +1814,9 @@ interface Array { >filter : (callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any) => T[] >callbackfn : (value: T, index: number, array: T[]) => boolean >value : T ->T : T >index : number >array : T[] ->T : T >thisArg : any ->T : T /** * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. @@ -1962,16 +1827,10 @@ interface Array { >reduce : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; } >callbackfn : (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T >previousValue : T ->T : T >currentValue : T ->T : T >currentIndex : number >array : T[] ->T : T ->T : T >initialValue : T ->T : T ->T : T /** * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. @@ -1980,19 +1839,12 @@ interface Array { */ reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; >reduce : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; } ->U : U >callbackfn : (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U >previousValue : U ->U : U >currentValue : T ->T : T >currentIndex : number >array : T[] ->T : T ->U : U >initialValue : U ->U : U ->U : U /** * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. @@ -2003,16 +1855,10 @@ interface Array { >reduceRight : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; } >callbackfn : (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T >previousValue : T ->T : T >currentValue : T ->T : T >currentIndex : number >array : T[] ->T : T ->T : T >initialValue : T ->T : T ->T : T /** * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. @@ -2021,19 +1867,12 @@ interface Array { */ reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; >reduceRight : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; } ->U : U >callbackfn : (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U >previousValue : U ->U : U >currentValue : T ->T : T >currentIndex : number >array : T[] ->T : T ->U : U >initialValue : U ->U : U ->U : U /** * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. @@ -2043,7 +1882,6 @@ interface Array { [n: number]: T; >n : number ->T : T } declare var Array: { >Array : { (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; new (arrayLength?: number): any[]; new (arrayLength: number): T[]; new (...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; } @@ -2052,29 +1890,19 @@ declare var Array: { >arrayLength : number new (arrayLength: number): T[]; ->T : T >arrayLength : number ->T : T new (...items: T[]): T[]; ->T : T >items : T[] ->T : T ->T : T (arrayLength?: number): any[]; >arrayLength : number (arrayLength: number): T[]; ->T : T >arrayLength : number ->T : T (...items: T[]): T[]; ->T : T >items : T[] ->T : T ->T : T isArray(arg: any): boolean; >isArray : (arg: any) => boolean @@ -2082,5 +1910,4 @@ declare var Array: { prototype: Array; >prototype : any[] ->Array : T[] } diff --git a/tests/baselines/reference/2dArrays.types b/tests/baselines/reference/2dArrays.types index 00805899294..f9f0e726dde 100644 --- a/tests/baselines/reference/2dArrays.types +++ b/tests/baselines/reference/2dArrays.types @@ -15,11 +15,9 @@ class Board { ships: Ship[]; >ships : Ship[] ->Ship : Ship cells: Cell[]; >cells : Cell[] ->Cell : Cell private allShipsSunk() { >allShipsSunk : () => boolean diff --git a/tests/baselines/reference/ArrowFunction1.types b/tests/baselines/reference/ArrowFunction1.types index 3f405bd7f36..eb7da8cb6e4 100644 --- a/tests/baselines/reference/ArrowFunction1.types +++ b/tests/baselines/reference/ArrowFunction1.types @@ -3,6 +3,5 @@ var v = (a: ) => { >v : (a: any) => void >(a: ) => { } : (a: any) => void >a : any -> : No type information available! }; diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.types b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.types index 5afcc735a92..d37a2777c35 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModuleMemberThatUsesClassTypeParameter.types @@ -3,14 +3,12 @@ class clodule1{ >clodule1 : clodule1 ->T : T id: string; >id : string value: T; >value : T ->T : T } module clodule1 { @@ -19,19 +17,16 @@ module clodule1 { function f(x: T) { } >f : (x: any) => void >x : any ->T : No type information available! } class clodule2{ >clodule2 : clodule2 ->T : T id: string; >id : string value: T; >value : T ->T : T } module clodule2 { @@ -39,32 +34,26 @@ module clodule2 { var x: T; >x : any ->T : No type information available! class D{ >D : D ->U : U ->T : No type information available! id: string; >id : string value: U; >value : U ->U : U } } class clodule3{ >clodule3 : clodule3 ->T : T id: string; >id : string value: T; >value : T ->T : T } module clodule3 { @@ -79,14 +68,12 @@ module clodule3 { class clodule4{ >clodule4 : clodule4 ->T : T id: string; >id : string value: T; >value : T ->T : T } module clodule4 { @@ -97,7 +84,6 @@ module clodule4 { name: T; >name : any ->T : No type information available! } } diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.types index 99a044d62c1..733d537f05c 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.types @@ -1,20 +1,16 @@ === tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts === class clodule { >clodule : clodule ->T : T id: string; >id : string value: T; >value : T ->T : T static fn(id: U) { } >fn : (id: U) => void ->U : U >id : U ->U : U } module clodule { @@ -23,12 +19,8 @@ module clodule { // error: duplicate identifier expected export function fn(x: T, y: T): T { >fn : (x: T, y: T) => T ->T : T >x : T ->T : T >y : T ->T : T ->T : T return x; >x : T diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.types index 6af2e089dc3..355a17e393d 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.types @@ -1,14 +1,12 @@ === tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts === class clodule { >clodule : clodule ->T : T id: string; >id : string value: T; >value : T ->T : T static fn(id: string) { } >fn : (id: string) => void @@ -21,12 +19,8 @@ module clodule { // error: duplicate identifier expected export function fn(x: T, y: T): T { >fn : (x: T, y: T) => T ->T : T >x : T ->T : T >y : T ->T : T ->T : T return x; >x : T diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.types b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.types index af77997ec6a..d73f40cc6fc 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.types @@ -1,14 +1,12 @@ === tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedStaticFunctionUsingClassPrivateStatics.ts === class clodule { >clodule : clodule ->T : T id: string; >id : string value: T; >value : T ->T : T private static sfn(id: string) { return 42; } >sfn : (id: string) => number @@ -22,11 +20,8 @@ module clodule { // error: duplicate identifier expected export function fn(x: T, y: T): number { >fn : (x: T, y: T) => number ->T : T >x : T ->T : T >y : T ->T : T return clodule.sfn('a'); >clodule.sfn('a') : number diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.types index f3bdde0e6a4..70ae933a288 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.types @@ -8,7 +8,6 @@ class Point { static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246 >Origin : () => Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 @@ -37,7 +36,6 @@ module A { static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246 >Origin : () => Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types index b0685c4f858..2bcde7c656a 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types @@ -8,7 +8,6 @@ class Point { static Origin(): Point { return { x: 0, y: 0 }; } >Origin : () => Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 @@ -37,7 +36,6 @@ module A { static Origin(): Point { return { x: 0, y: 0 }; } >Origin : () => Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.types index 1c2423316dc..f5d679df487 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.types @@ -8,7 +8,6 @@ class Point { static Origin: Point = { x: 0, y: 0 }; >Origin : Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 @@ -37,7 +36,6 @@ module A { static Origin: Point = { x: 0, y: 0 }; >Origin : Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types index 7aa32879b7c..287012d0d6a 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types @@ -8,7 +8,6 @@ class Point { static Origin: Point = { x: 0, y: 0 }; >Origin : Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 @@ -37,7 +36,6 @@ module A { static Origin: Point = { x: 0, y: 0 }; >Origin : Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 diff --git a/tests/baselines/reference/ClassDeclaration25.types b/tests/baselines/reference/ClassDeclaration25.types index cdfc8f9ae1e..1c30d48d658 100644 --- a/tests/baselines/reference/ClassDeclaration25.types +++ b/tests/baselines/reference/ClassDeclaration25.types @@ -1,24 +1,16 @@ === tests/cases/compiler/ClassDeclaration25.ts === interface IList { ->IList : IList ->T : T - data(): T; >data : () => T ->T : T next(): string; >next : () => string } class List implements IList { >List : List ->U : U ->IList : IList ->U : U data(): U; >data : () => U ->U : U next(): string; >next : () => string diff --git a/tests/baselines/reference/DeclarationErrorsNoEmitOnError.types b/tests/baselines/reference/DeclarationErrorsNoEmitOnError.types index d2598dfe748..553563168a8 100644 --- a/tests/baselines/reference/DeclarationErrorsNoEmitOnError.types +++ b/tests/baselines/reference/DeclarationErrorsNoEmitOnError.types @@ -4,9 +4,6 @@ type T = { x : number } >x : number export interface I { ->I : I - f: T; >f : T ->T : T } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck13.types b/tests/baselines/reference/ES5For-ofTypeCheck13.types index a1cdba4359b..407f925b4e3 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck13.types +++ b/tests/baselines/reference/ES5For-ofTypeCheck13.types @@ -1,7 +1,6 @@ === tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck13.ts === const strSet: Set = new Set() >strSet : Set ->Set : Set >new Set() : Set >Set : SetConstructor diff --git a/tests/baselines/reference/ES5For-ofTypeCheck14.types b/tests/baselines/reference/ES5For-ofTypeCheck14.types index 03a822316ac..7f8da376d1c 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck14.types +++ b/tests/baselines/reference/ES5For-ofTypeCheck14.types @@ -1,7 +1,6 @@ === tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts === var union: string | Set >union : string | Set ->Set : Set for (const e of union) { } >e : string diff --git a/tests/baselines/reference/ES5SymbolProperty1.types b/tests/baselines/reference/ES5SymbolProperty1.types index 7d76614f798..ebbd3fb8112 100644 --- a/tests/baselines/reference/ES5SymbolProperty1.types +++ b/tests/baselines/reference/ES5SymbolProperty1.types @@ -1,13 +1,10 @@ === tests/cases/conformance/Symbols/ES5SymbolProperty1.ts === interface SymbolConstructor { ->SymbolConstructor : SymbolConstructor - foo: string; >foo : string } var Symbol: SymbolConstructor; >Symbol : SymbolConstructor ->SymbolConstructor : SymbolConstructor var obj = { >obj : { [Symbol.foo]: number; } diff --git a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types index d2328929938..c41d75706ae 100644 --- a/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/EnumAndModuleWithSameNameAndCommonRoot.types @@ -21,7 +21,6 @@ module enumdule { var x: enumdule; >x : enumdule ->enumdule : enumdule var x = enumdule.Red; >x : enumdule diff --git a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types index 04d0259f04e..9fff59f6c09 100644 --- a/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types +++ b/tests/baselines/reference/ExportClassWhichExtendsInterfaceWithInaccessibleType.types @@ -3,8 +3,6 @@ module A { >A : typeof A interface Point { ->Point : Point - x: number; >x : number @@ -14,12 +12,10 @@ module A { fromOrigin(p: Point): number; >fromOrigin : (p: Point) => number >p : Point ->Point : Point } export class Point2d implements Point { >Point2d : Point2d ->Point : Point constructor(public x: number, public y: number) { } >x : number @@ -28,7 +24,6 @@ module A { fromOrigin(p: Point) { >fromOrigin : (p: Point) => number >p : Point ->Point : Point return 1; >1 : 1 diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types index e832f36e862..9a467c7f373 100644 --- a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types @@ -14,7 +14,6 @@ module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 @@ -31,7 +30,6 @@ module A { export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; >Origin3d : Point3d ->Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number >0 : 0 @@ -42,14 +40,10 @@ module A { export class Line{ >Line : Line ->TPoint : TPoint ->Point : Point constructor(public start: TPoint, public end: TPoint) { } >start : TPoint ->TPoint : TPoint >end : TPoint ->TPoint : TPoint } } diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.types b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.types index 451db7f92a8..795301b9c2d 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.types +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.types @@ -17,11 +17,9 @@ module A { [idx: number]: Point; >idx : number ->Point : Point [idx: string]: Point; >idx : string ->Point : Point } } diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types index 1a97175a833..ba52ecbd991 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types @@ -14,7 +14,6 @@ module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 @@ -31,7 +30,6 @@ module A { export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; >Origin3d : Point3d ->Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number >0 : 0 @@ -42,21 +40,14 @@ module A { export class Line{ >Line : Line ->TPoint : TPoint ->Point : Point constructor(public start: TPoint, public end: TPoint) { } >start : TPoint ->TPoint : TPoint >end : TPoint ->TPoint : TPoint static fromorigin2d(p: Point): Line{ >fromorigin2d : (p: Point) => Line >p : Point ->Point : Point ->Line : Line ->Point : Point return null; >null : null diff --git a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types index 957c9ce0207..db5bcf23662 100644 --- a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types @@ -17,16 +17,12 @@ module A { constructor(public start: Point, public end: Point) { } >start : Point ->Point : Point >end : Point ->Point : Point } export function fromOrigin(p: Point): Line { >fromOrigin : (p: Point) => Line >p : Point ->Point : Point ->Line : Line return new Line({ x: 0, y: 0 }, p); >new Line({ x: 0, y: 0 }, p) : Line diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types index 079b39650d0..ed909ebb4f4 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types @@ -17,16 +17,12 @@ module A { constructor(public start: Point, public end: Point) { } >start : Point ->Point : Point >end : Point ->Point : Point } export function fromOrigin(p: Point): Line { >fromOrigin : (p: Point) => Line >p : Point ->Point : Point ->Line : Line return new Line({ x: 0, y: 0 }, p); >new Line({ x: 0, y: 0 }, p) : Line diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types index 6fcbb786a68..1514e086cfd 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types @@ -17,16 +17,12 @@ module A { constructor(public start: Point, public end: Point) { } >start : Point ->Point : Point >end : Point ->Point : Point } export function fromOrigin(p: Point): Line { >fromOrigin : (p: Point) => Line >p : Point ->Point : Point ->Line : Line return new Line({ x: 0, y: 0 }, p); >new Line({ x: 0, y: 0 }, p) : Line diff --git a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types index c7c78424064..d0c6b733496 100644 --- a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types @@ -3,8 +3,6 @@ module A { >A : typeof A export interface Point { ->Point : Point - x: number; >x : number @@ -14,7 +12,6 @@ module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 @@ -22,16 +19,12 @@ module A { >0 : 0 export interface Point3d extends Point { ->Point3d : Point3d ->Point : Point - z: number; >z : number } export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; >Origin3d : Point3d ->Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number >0 : 0 @@ -41,23 +34,15 @@ module A { >0 : 0 export interface Line{ ->Line : Line ->TPoint : TPoint ->Point : Point - new (start: TPoint, end: TPoint); >start : TPoint ->TPoint : TPoint >end : TPoint ->TPoint : TPoint start: TPoint; >start : TPoint ->TPoint : TPoint end: TPoint; >end : TPoint ->TPoint : TPoint } } diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.types b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.types index 8be90b5946e..44f734e7a42 100644 --- a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.types +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.types @@ -1,10 +1,7 @@ === tests/cases/conformance/internalModules/exportDeclarations/ExportInterfaceWithInaccessibleTypeInIndexerTypeAnnotations.ts === module A { ->A : any interface Point { ->Point : Point - x: number; >x : number @@ -13,15 +10,12 @@ module A { } export interface points { ->points : points [idx: number]: Point; >idx : number ->Point : Point [idx: string]: Point; >idx : string ->Point : Point } } diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types index 8d07e4a44dd..f277ea87d26 100644 --- a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types @@ -3,8 +3,6 @@ module A { >A : typeof A interface Point { ->Point : Point - x: number; >x : number @@ -14,7 +12,6 @@ module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 @@ -22,16 +19,12 @@ module A { >0 : 0 export interface Point3d extends Point { ->Point3d : Point3d ->Point : Point - z: number; >z : number } export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; >Origin3d : Point3d ->Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number >0 : 0 @@ -41,23 +34,15 @@ module A { >0 : 0 export interface Line{ ->Line : Line ->TPoint : TPoint ->Point : Point - new (start: TPoint, end: TPoint); >start : TPoint ->TPoint : TPoint >end : TPoint ->TPoint : TPoint start: TPoint; >start : TPoint ->TPoint : TPoint end: TPoint; >end : TPoint ->TPoint : TPoint } } diff --git a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types index a3ee7c55a4c..2079201aee2 100644 --- a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types +++ b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types @@ -15,7 +15,6 @@ module A { export var Origin: Point = new Point(0, 0); >Origin : Point ->Point : Point >new Point(0, 0) : Point >Point : typeof Point >0 : 0 @@ -26,16 +25,13 @@ module A { constructor(start: Point, end: Point) { >start : Point ->Point : Point >end : Point ->Point : Point } static fromOrigin(p: Point) { >fromOrigin : (p: Point) => Line >p : Point ->Point : Point return new Line({ x: 0, y: 0 }, p); >new Line({ x: 0, y: 0 }, p) : Line diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types index 0ce1b82d67e..aa56ab818d0 100644 --- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types @@ -12,7 +12,6 @@ module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types index 12a8cd974ad..e3286a644c5 100644 --- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInNestedMemberTypeAnnotations.types @@ -16,16 +16,12 @@ module A { top: { left: Point, right: Point }, >top : { left: Point; right: Point; } >left : Point ->Point : Point >right : Point ->Point : Point bottom: { left: Point, right: Point } >bottom : { left: Point; right: Point; } >left : Point ->Point : Point >right : Point ->Point : Point } = null; >null : null diff --git a/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.types b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.types index ba24bf93442..4ea41475ec6 100644 --- a/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.types +++ b/tests/baselines/reference/ExportVariableOfGenericTypeWithInaccessibleTypeAsTypeArgument.types @@ -11,12 +11,9 @@ module A { export var beez: Array; >beez : B[] ->Array : T[] ->B : B export var beez2 = new Array(); >beez2 : B[] >new Array() : B[] >Array : ArrayConstructor ->B : B } diff --git a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types index 91504be2c70..f0f4506a61d 100644 --- a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types +++ b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types @@ -3,8 +3,6 @@ module A { >A : typeof A export interface Point { ->Point : Point - x: number; >x : number @@ -15,7 +13,6 @@ module A { // valid since Point is exported export var Origin: Point = { x: 0, y: 0 }; >Origin : Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 diff --git a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types index 39bc5fa8af0..eed376a470b 100644 --- a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types +++ b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types @@ -3,8 +3,6 @@ module A { >A : typeof A export interface Point { ->Point : Point - x: number; >x : number @@ -15,7 +13,6 @@ module A { // valid since Point is exported export var Origin: Point = { x: 0, y: 0 }; >Origin : Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 @@ -23,9 +20,6 @@ module A { >0 : 0 interface Point3d extends Point { ->Point3d : Point3d ->Point : Point - z: number; >z : number } @@ -33,7 +27,6 @@ module A { // invalid Point3d is not exported export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; >Origin3d : Point3d ->Point3d : Point3d >{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } >x : number >0 : 0 diff --git a/tests/baselines/reference/FunctionDeclaration13_es6.types b/tests/baselines/reference/FunctionDeclaration13_es6.types index 69502a3e37c..b6f6aafd658 100644 --- a/tests/baselines/reference/FunctionDeclaration13_es6.types +++ b/tests/baselines/reference/FunctionDeclaration13_es6.types @@ -5,6 +5,5 @@ function * foo() { // Legal to use 'yield' in a type context. var v: yield; >v : any ->yield : No type information available! } diff --git a/tests/baselines/reference/FunctionPropertyAssignments6_es6.types b/tests/baselines/reference/FunctionPropertyAssignments6_es6.types index 050d97df735..832acbd8840 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments6_es6.types +++ b/tests/baselines/reference/FunctionPropertyAssignments6_es6.types @@ -3,5 +3,4 @@ var v = { *() { } } >v : { (Missing)(): IterableIterator; } >{ *() { } } : { (Missing)(): IterableIterator; } > : () => IterableIterator ->T : T diff --git a/tests/baselines/reference/InterfaceDeclaration8.types b/tests/baselines/reference/InterfaceDeclaration8.types index d65b6376457..a9e08759565 100644 --- a/tests/baselines/reference/InterfaceDeclaration8.types +++ b/tests/baselines/reference/InterfaceDeclaration8.types @@ -1,4 +1,4 @@ === tests/cases/compiler/InterfaceDeclaration8.ts === interface string { ->string : string -} +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/InvalidNonInstantiatedModule.types b/tests/baselines/reference/InvalidNonInstantiatedModule.types index 28141c16ec8..218229e8235 100644 --- a/tests/baselines/reference/InvalidNonInstantiatedModule.types +++ b/tests/baselines/reference/InvalidNonInstantiatedModule.types @@ -1,9 +1,6 @@ === tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiatedModule.ts === module M { ->M : any - export interface Point { x: number; y: number } ->Point : Point >x : number >y : number } diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.asteriskAfterPreamble.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.asteriskAfterPreamble.json index 03baac016aa..393a0c33602 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.asteriskAfterPreamble.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.asteriskAfterPreamble.json @@ -2,5 +2,5 @@ "kind": "JSDocComment", "pos": 0, "end": 23, - "comment": "* @type {number} " + "comment": "* @type {number}" } \ No newline at end of file diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.templateTag3.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.templateTag3.json index ab1b9db8782..193c5c0eb01 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.templateTag3.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.templateTag3.json @@ -22,7 +22,7 @@ "0": { "kind": "TypeParameter", "pos": 18, - "end": 20, + "end": 19, "name": { "kind": "Identifier", "pos": 18, diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.templateTag5.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.templateTag5.json index 80e127b0759..fca64bcb430 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.templateTag5.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.templateTag5.json @@ -22,7 +22,7 @@ "0": { "kind": "TypeParameter", "pos": 18, - "end": 20, + "end": 19, "name": { "kind": "Identifier", "pos": 18, diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.templateTag6.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.templateTag6.json index d097b42a0b0..90158499b17 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.templateTag6.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.templateTag6.json @@ -22,7 +22,7 @@ "0": { "kind": "TypeParameter", "pos": 18, - "end": 20, + "end": 19, "name": { "kind": "Identifier", "pos": 18, @@ -33,7 +33,7 @@ "1": { "kind": "TypeParameter", "pos": 22, - "end": 24, + "end": 23, "name": { "kind": "Identifier", "pos": 22, diff --git a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.threeAsterisks.json b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.threeAsterisks.json index a89a36050aa..9963937db5c 100644 --- a/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.threeAsterisks.json +++ b/tests/baselines/reference/JSDocParsing/DocComments.parsesCorrectly.threeAsterisks.json @@ -2,5 +2,5 @@ "kind": "JSDocComment", "pos": 0, "end": 7, - "comment": "* " + "comment": "*" } \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration7_es6.types b/tests/baselines/reference/MemberFunctionDeclaration7_es6.types index b5e65110c68..8269f672372 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration7_es6.types +++ b/tests/baselines/reference/MemberFunctionDeclaration7_es6.types @@ -4,5 +4,4 @@ class C { *foo() { } >foo : () => IterableIterator ->T : T } diff --git a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types index f728c41b6a1..8ffdc9271da 100644 --- a/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types +++ b/tests/baselines/reference/ModuleAndEnumWithSameNameAndCommonRoot.types @@ -21,7 +21,6 @@ enum enumdule { var x: enumdule; >x : enumdule ->enumdule : enumdule var x = enumdule.Red; >x : enumdule diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.types b/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.types index 233d03cca02..12a6af08955 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.types +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedClasses.types @@ -14,16 +14,12 @@ module A { export class AG{ >AG : AG ->T : T ->U : U id: T; >id : T ->T : T name: U; >name : U ->U : U } class A2 { @@ -38,16 +34,12 @@ module A { class AG2{ >AG2 : AG2 ->T : T ->U : U id: T; >id : T ->T : T name: U; >name : U ->U : U } } diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.types b/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.types index 54222846995..9a1bf4cd15f 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.types +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedEnums.types @@ -17,7 +17,6 @@ module A { var a: A.Color = A.Color.Red; >a : A.Color >A : any ->Color : A.Color >A.Color.Red : A.Color.Red >A.Color : typeof A.Color >A : typeof A diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.types b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.types index 123ee413d76..818b4c2c7c9 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.types +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.types @@ -12,11 +12,7 @@ module A { export function fng(s: T): U { >fng : (s: T) => U ->T : T ->U : U >s : T ->T : T ->U : U return null; >null : null @@ -32,11 +28,7 @@ module A { function fng2(s: T): U { >fng2 : (s: T) => U ->T : T ->U : U >s : T ->T : T ->U : U return null; >null : null @@ -56,11 +48,7 @@ var fn = A.fn; var fng: (s: T) => U; >fng : (s: T) => U ->T : T ->U : U >s : T ->T : T ->U : U var fng = A.fng; // bug 838015 >fng : (s: T) => U diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.types b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.types index 74e8d7f271f..f6edef1fb91 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.types +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.types @@ -1,10 +1,6 @@ === tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedImportAlias.ts === module A { ->A : any - export interface Point { ->Point : Point - x: number; >x : number @@ -13,9 +9,6 @@ module A { } interface Point3d extends Point { ->Point3d : Point3d ->Point : Point - z: number; >z : number } @@ -30,10 +23,8 @@ module B { constructor(public start: A.Point, public end: A.Point) { } >start : A.Point >A : any ->Point : A.Point >end : A.Point >A : any ->Point : A.Point } } @@ -51,7 +42,6 @@ module Geometry { export var Origin: Points.Point = { x: 0, y: 0 }; >Origin : Points.Point >Points : any ->Point : Points.Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 @@ -62,7 +52,6 @@ module Geometry { export var Unit: Lines.Line = new Lines.Line(Origin, { x: 1, y: 0 }); >Unit : Lines.Line >Lines : any ->Line : Lines.Line >new Lines.Line(Origin, { x: 1, y: 0 }) : Lines.Line >Lines.Line : typeof Lines.Line >Lines : typeof Lines @@ -85,7 +74,6 @@ var p: Geometry.Points.Point; >p : { x: number; y: number; } >Geometry : any >Points : any ->Point : A.Point var p = Geometry.Origin; >p : { x: number; y: number; } diff --git a/tests/baselines/reference/NonInitializedExportInInternalModule.types b/tests/baselines/reference/NonInitializedExportInInternalModule.types index 4c8581c3283..c6c84bbabb4 100644 --- a/tests/baselines/reference/NonInitializedExportInInternalModule.types +++ b/tests/baselines/reference/NonInitializedExportInInternalModule.types @@ -25,11 +25,9 @@ module Inner { export var e: A; >e : A ->A : A export let f: A; >f : A ->A : A namespace B { >B : typeof B @@ -95,13 +93,11 @@ module Inner { export var g1: D = new D; >g1 : D ->D : D >new D : D >D : typeof D export let h1: D = new D; >h1 : D ->D : D >new D : D >D : typeof D } diff --git a/tests/baselines/reference/ParameterList13.types b/tests/baselines/reference/ParameterList13.types index 22819406560..279e18bedcd 100644 --- a/tests/baselines/reference/ParameterList13.types +++ b/tests/baselines/reference/ParameterList13.types @@ -1,7 +1,5 @@ === tests/cases/compiler/ParameterList13.ts === interface I { ->I : I - new (public x); >x : any } diff --git a/tests/baselines/reference/ParameterList5.types b/tests/baselines/reference/ParameterList5.types index 57b80d0d807..073dcd58663 100644 --- a/tests/baselines/reference/ParameterList5.types +++ b/tests/baselines/reference/ParameterList5.types @@ -2,5 +2,4 @@ function A(): (public B) => C { >A : () => (B: any) => any >B : any ->C : No type information available! } diff --git a/tests/baselines/reference/Protected2.types b/tests/baselines/reference/Protected2.types index d4a18b3f2fc..df8d6f12cac 100644 --- a/tests/baselines/reference/Protected2.types +++ b/tests/baselines/reference/Protected2.types @@ -1,4 +1,4 @@ === tests/cases/conformance/parser/ecmascript5/Protected/Protected2.ts === protected module M { ->M : any -} +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/Protected8.types b/tests/baselines/reference/Protected8.types index f29be486eec..69a9b34f91e 100644 --- a/tests/baselines/reference/Protected8.types +++ b/tests/baselines/reference/Protected8.types @@ -1,7 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/Protected/Protected8.ts === interface I { ->I : I - protected >protected : any diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.types index 25c23b83273..68a8a78f42e 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedClassesOfTheSameName.types @@ -23,7 +23,6 @@ module A { >fromCarthesian : (p: A.Point) => { x: number; y: number; } >p : A.Point >A : any ->Point : A.Point return { x: p.x, y: p.y }; >{ x: p.x, y: p.y } : { x: number; y: number; } @@ -48,7 +47,6 @@ var p: { x: number; y: number; }; var p: A.Point; >p : { x: number; y: number; } >A : any ->Point : A.Point module X.Y.Z { >X : typeof X @@ -92,6 +90,5 @@ var l: X.Y.Z.Line; >X : any >Y : any >Z : any ->Line : X.Y.Z.Line diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.types index 309ad35d54f..cb10f83fa14 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.types @@ -1,10 +1,6 @@ === tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedAndNonExportedInterfacesOfTheSameName.ts === module A { ->A : any - export interface Point { ->Point : Point - x: number; >x : number @@ -13,19 +9,13 @@ module A { toCarth(): Point; >toCarth : () => Point ->Point : Point } } module A { ->A : any - interface Point { ->Point : Point - fromCarth(): Point; >fromCarth : () => Point ->Point : Point } } @@ -36,50 +26,31 @@ var p: { x: number; y: number; toCarth(): A.Point; }; >y : number >toCarth : () => A.Point >A : any ->Point : A.Point var p: A.Point; >p : { x: number; y: number; toCarth(): A.Point; } >A : any ->Point : A.Point module X.Y.Z { ->X : any ->Y : any ->Z : any - export interface Line { ->Line : Line - new (start: A.Point, end: A.Point); >start : A.Point >A : any ->Point : A.Point >end : A.Point >A : any ->Point : A.Point } } module X { ->X : any - export module Y.Z { ->Y : any ->Z : any - interface Line { ->Line : Line - start: A.Point; >start : A.Point >A : any ->Point : A.Point end: A.Point; >end : A.Point >A : any ->Point : A.Point } } } @@ -89,15 +60,12 @@ var l: { new (s: A.Point, e: A.Point); } >l : new (s: A.Point, e: A.Point) => any >s : A.Point >A : any ->Point : A.Point >e : A.Point >A : any ->Point : A.Point var l: X.Y.Z.Line; >l : new (s: A.Point, e: A.Point) => any >X : any >Y : any >Z : any ->Line : X.Y.Z.Line diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types index 25a627030c4..e2eefc8cefc 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types @@ -3,8 +3,6 @@ module A { >A : typeof A export interface Point { ->Point : Point - x: number; >x : number @@ -17,10 +15,7 @@ module A { export function mirror(p: T) { >mirror : (p: T) => { x: number; y: number; } ->T : T ->Point : Point >p : T ->T : T return { x: p.y, y: p.x }; >{ x: p.y, y: p.x } : { x: number; y: number; } @@ -36,7 +31,6 @@ module A { } export var Origin: Point = { x: 0, y: 0 }; >Origin : Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 @@ -61,9 +55,7 @@ module A { constructor(public tl: Point, public br: Point) { } >tl : Point ->Point : Point >br : Point ->Point : Point } } } @@ -79,7 +71,6 @@ var o: { x: number; y: number }; var o: A.Point; >o : { x: number; y: number; } >A : any ->Point : A.Point var o = A.Origin; >o : { x: number; y: number; } @@ -101,16 +92,13 @@ var p: { tl: A.Point; br: A.Point }; >p : { tl: A.Point; br: A.Point; } >tl : A.Point >A : any ->Point : A.Point >br : A.Point >A : any ->Point : A.Point var p: A.Utils.Plane; >p : { tl: A.Point; br: A.Point; } >A : any >Utils : any ->Plane : A.Utils.Plane var p = new A.Utils.Plane(o, { x: 1, y: 1 }); >p : { tl: A.Point; br: A.Point; } diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.types index 5795beda4a9..c9320217d07 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.types @@ -1,10 +1,6 @@ === tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedInterfacesOfTheSameName.ts === module A { ->A : any - export interface Point { ->Point : Point - x: number; >x : number @@ -13,19 +9,13 @@ module A { toCarth(): Point; >toCarth : () => Point ->Point : Point } } module A { ->A : any - export interface Point { ->Point : Point - fromCarth(): Point; >fromCarth : () => Point ->Point : Point } } @@ -36,53 +26,33 @@ var p: { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; }; >y : number >toCarth : () => A.Point >A : any ->Point : A.Point >fromCarth : () => A.Point >A : any ->Point : A.Point var p: A.Point; >p : { x: number; y: number; toCarth(): A.Point; fromCarth(): A.Point; } >A : any ->Point : A.Point module X.Y.Z { ->X : any ->Y : any ->Z : any - export interface Line { ->Line : Line - new (start: A.Point, end: A.Point); >start : A.Point >A : any ->Point : A.Point >end : A.Point >A : any ->Point : A.Point } } module X { ->X : any - export module Y.Z { ->Y : any ->Z : any - export interface Line { ->Line : Line - start: A.Point; >start : A.Point >A : any ->Point : A.Point end: A.Point; >end : A.Point >A : any ->Point : A.Point } } } @@ -92,21 +62,16 @@ var l: { start: A.Point; end: A.Point; new (s: A.Point, e: A.Point); } >l : { new (s: A.Point, e: A.Point): any; start: A.Point; end: A.Point; } >start : A.Point >A : any ->Point : A.Point >end : A.Point >A : any ->Point : A.Point >s : A.Point >A : any ->Point : A.Point >e : A.Point >A : any ->Point : A.Point var l: X.Y.Z.Line; >l : { new (s: A.Point, e: A.Point): any; start: A.Point; end: A.Point; } >X : any >Y : any >Z : any ->Line : X.Y.Z.Line diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.types index b9132a1d2cb..7da40308b3d 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.types @@ -3,8 +3,6 @@ export module A { >A : typeof A export interface Point { ->Point : Point - x: number; >x : number @@ -17,10 +15,7 @@ export module A { export function mirror(p: T) { >mirror : (p: T) => { x: number; y: number; } ->T : T ->Point : Point >p : T ->T : T return { x: p.y, y: p.x }; >{ x: p.y, y: p.x } : { x: number; y: number; } @@ -37,7 +32,6 @@ export module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 @@ -52,7 +46,6 @@ export module A { // collision with 'Origin' var in other part of merged module export var Origin: Point = { x: 0, y: 0 }; >Origin : any ->Point : No type information available! >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 @@ -67,9 +60,7 @@ export module A { constructor(public tl: Point, public br: Point) { } >tl : any ->Point : No type information available! >br : any ->Point : No type information available! } } } diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types index a19e0839901..673f382c0ce 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedModulesOfTheSameName.types @@ -72,5 +72,4 @@ var l: X.Y.Z.Line; >X : any >Y : any >Z : any ->Line : X.Y.Z.Line diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types index 2d654a580ea..1fc74eef3d6 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types @@ -6,8 +6,6 @@ module Root { >A : typeof A export interface Point { ->Point : Point - x: number; >x : number @@ -20,10 +18,7 @@ module Root { export function mirror(p: T) { >mirror : (p: T) => { x: number; y: number; } ->T : T ->Point : Point >p : T ->T : T return { x: p.y, y: p.x }; >{ x: p.y, y: p.x } : { x: number; y: number; } @@ -52,7 +47,6 @@ module otherRoot { >Origin : Root.A.Point >Root : any >A : any ->Point : Root.A.Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 @@ -69,11 +63,9 @@ module otherRoot { >tl : Root.A.Point >Root : any >A : any ->Point : Root.A.Point >br : Root.A.Point >Root : any >A : any ->Point : Root.A.Point } } } diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types index 11cb6e95d28..d67ab5a6887 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types @@ -3,8 +3,6 @@ module A { >A : typeof A export interface Point { ->Point : Point - x: number; >x : number @@ -17,10 +15,7 @@ module A { export function mirror(p: T) { >mirror : (p: T) => { x: number; y: number; } ->T : T ->Point : Point >p : T ->T : T return { x: p.y, y: p.x }; >{ x: p.y, y: p.x } : { x: number; y: number; } @@ -42,7 +37,6 @@ module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point ->Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number >0 : 0 @@ -57,9 +51,7 @@ module A { constructor(public tl: Point, public br: Point) { } >tl : Point ->Point : Point >br : Point ->Point : Point } } } @@ -75,7 +67,6 @@ var o: { x: number; y: number }; var o: A.Point; >o : { x: number; y: number; } >A : any ->Point : A.Point var o = A.Origin; >o : { x: number; y: number; } @@ -97,16 +88,13 @@ var p: { tl: A.Point; br: A.Point }; >p : { tl: A.Point; br: A.Point; } >tl : A.Point >A : any ->Point : A.Point >br : A.Point >A : any ->Point : A.Point var p: A.Utils.Plane; >p : { tl: A.Point; br: A.Point; } >A : any >Utils : any ->Plane : A.Utils.Plane var p = new A.Utils.Plane(o, { x: 1, y: 1 }); >p : { tl: A.Point; br: A.Point; } diff --git a/tests/baselines/reference/TypeGuardWithArrayUnion.types b/tests/baselines/reference/TypeGuardWithArrayUnion.types index 557e305ef74..283905b0369 100644 --- a/tests/baselines/reference/TypeGuardWithArrayUnion.types +++ b/tests/baselines/reference/TypeGuardWithArrayUnion.types @@ -9,8 +9,6 @@ class Message { function saySize(message: Message | Message[]) { >saySize : (message: Message | Message[]) => number >message : Message | Message[] ->Message : Message ->Message : Message if (message instanceof Array) { >message instanceof Array : boolean diff --git a/tests/baselines/reference/TypeGuardWithEnumUnion.types b/tests/baselines/reference/TypeGuardWithEnumUnion.types index 8ee4aaca363..9f51791f209 100644 --- a/tests/baselines/reference/TypeGuardWithEnumUnion.types +++ b/tests/baselines/reference/TypeGuardWithEnumUnion.types @@ -8,7 +8,6 @@ enum Color { R, G, B } function f1(x: Color | string) { >f1 : (x: string | Color) => void >x : string | Color ->Color : Color if (typeof x === "number") { >typeof x === "number" : boolean @@ -22,7 +21,6 @@ function f1(x: Color | string) { var y: Color; >y : Color ->Color : Color } else { var z = x; @@ -37,7 +35,6 @@ function f1(x: Color | string) { function f2(x: Color | string | string[]) { >f2 : (x: string | Color | string[]) => void >x : string | Color | string[] ->Color : Color if (typeof x === "object") { >typeof x === "object" : boolean @@ -64,7 +61,6 @@ function f2(x: Color | string | string[]) { var z: Color; >z : Color ->Color : Color } else { var w = x; @@ -94,7 +90,6 @@ function f2(x: Color | string | string[]) { var b: Color | string[]; >b : Color | string[] ->Color : Color } } diff --git a/tests/baselines/reference/abstractInterfaceIdentifierName.types b/tests/baselines/reference/abstractInterfaceIdentifierName.types index 2aba754cfa0..b71772a4ec7 100644 --- a/tests/baselines/reference/abstractInterfaceIdentifierName.types +++ b/tests/baselines/reference/abstractInterfaceIdentifierName.types @@ -1,7 +1,5 @@ === tests/cases/compiler/abstractInterfaceIdentifierName.ts === interface abstract { ->abstract : abstract - abstract(): void; >abstract : () => void } diff --git a/tests/baselines/reference/abstractProperty.types b/tests/baselines/reference/abstractProperty.types index aa0d1c6917a..d26af73b9aa 100644 --- a/tests/baselines/reference/abstractProperty.types +++ b/tests/baselines/reference/abstractProperty.types @@ -1,7 +1,5 @@ === tests/cases/compiler/abstractProperty.ts === interface A { ->A : A - prop: string; >prop : string @@ -13,7 +11,6 @@ interface A { } abstract class B implements A { >B : B ->A : A abstract prop: string; >prop : string diff --git a/tests/baselines/reference/abstractPropertyInConstructor.types b/tests/baselines/reference/abstractPropertyInConstructor.types index 6f8970a7702..23e1aac50f7 100644 --- a/tests/baselines/reference/abstractPropertyInConstructor.types +++ b/tests/baselines/reference/abstractPropertyInConstructor.types @@ -5,7 +5,6 @@ abstract class AbstractClass { constructor(str: string, other: AbstractClass) { >str : string >other : AbstractClass ->AbstractClass : AbstractClass this.method(parseInt(str)); >this.method(parseInt(str)) : void @@ -97,7 +96,6 @@ class User { constructor(a: AbstractClass) { >a : AbstractClass ->AbstractClass : AbstractClass a.prop; >a.prop : string diff --git a/tests/baselines/reference/abstractPropertyNegative.types b/tests/baselines/reference/abstractPropertyNegative.types index 371a84e8e91..0ae88cc7785 100644 --- a/tests/baselines/reference/abstractPropertyNegative.types +++ b/tests/baselines/reference/abstractPropertyNegative.types @@ -1,7 +1,5 @@ === tests/cases/compiler/abstractPropertyNegative.ts === interface A { ->A : A - prop: string; >prop : string @@ -10,7 +8,6 @@ interface A { } abstract class B implements A { >B : B ->A : A abstract prop: string; >prop : string diff --git a/tests/baselines/reference/acceptableAlias1.types b/tests/baselines/reference/acceptableAlias1.types index ccf766d8f2f..513aa92a31a 100644 --- a/tests/baselines/reference/acceptableAlias1.types +++ b/tests/baselines/reference/acceptableAlias1.types @@ -3,7 +3,6 @@ module M { >M : typeof M export module N { ->N : any } export import X = N; >X : any diff --git a/tests/baselines/reference/accessorsAreNotContextuallyTyped.types b/tests/baselines/reference/accessorsAreNotContextuallyTyped.types index c48ad593724..66c478dc87c 100644 --- a/tests/baselines/reference/accessorsAreNotContextuallyTyped.types +++ b/tests/baselines/reference/accessorsAreNotContextuallyTyped.types @@ -22,7 +22,6 @@ class C { var c: C; >c : C ->C : C var r = c.x(''); // string >r : string diff --git a/tests/baselines/reference/accessorsEmit.types b/tests/baselines/reference/accessorsEmit.types index 84759cefe87..de214e7c40a 100644 --- a/tests/baselines/reference/accessorsEmit.types +++ b/tests/baselines/reference/accessorsEmit.types @@ -7,7 +7,6 @@ class Test { get Property(): Result { >Property : Result ->Result : Result var x = 1; >x : number diff --git a/tests/baselines/reference/accessors_spec_section-4.5_inference.types b/tests/baselines/reference/accessors_spec_section-4.5_inference.types index a1d96120634..418fd2487a3 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_inference.types +++ b/tests/baselines/reference/accessors_spec_section-4.5_inference.types @@ -12,7 +12,6 @@ class LanguageSpec_section_4_5_inference { public set InferredGetterFromSetterAnnotation(a: A) { } >InferredGetterFromSetterAnnotation : A >a : A ->A : A public get InferredGetterFromSetterAnnotation() { return new B(); } >InferredGetterFromSetterAnnotation : A @@ -27,7 +26,6 @@ class LanguageSpec_section_4_5_inference { public set InferredGetterFromSetterAnnotation_GetterFirst(a: A) { } >InferredGetterFromSetterAnnotation_GetterFirst : A >a : A ->A : A public get InferredFromGetter() { return new B(); } @@ -54,13 +52,11 @@ class LanguageSpec_section_4_5_inference { public get InferredSetterFromGetterAnnotation() : A { return new B(); } >InferredSetterFromGetterAnnotation : A ->A : A >new B() : B >B : typeof B public get InferredSetterFromGetterAnnotation_GetterFirst() : A { return new B(); } >InferredSetterFromGetterAnnotation_GetterFirst : A ->A : A >new B() : B >B : typeof B diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.types b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.types index 212186ace77..9af21c42c07 100644 --- a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.types +++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature.types @@ -1,21 +1,15 @@ === tests/cases/compiler/addMoreCallSignaturesToBaseSignature.ts === interface Foo { ->Foo : Foo - (): string; } interface Bar extends Foo { ->Bar : Bar ->Foo : Foo - (key: string): string; >key : string } var a: Bar; >a : Bar ->Bar : Bar var kitty = a(); >kitty : string diff --git a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types index 2618f7b3cc7..55dc0f41343 100644 --- a/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types +++ b/tests/baselines/reference/addMoreCallSignaturesToBaseSignature2.types @@ -1,22 +1,16 @@ === tests/cases/compiler/addMoreCallSignaturesToBaseSignature2.ts === interface Foo { ->Foo : Foo - (bar:number): string; >bar : number } interface Bar extends Foo { ->Bar : Bar ->Foo : Foo - (key: string): string; >key : string } var a: Bar; >a : Bar ->Bar : Bar var kitty = a(1); >kitty : string diff --git a/tests/baselines/reference/addMoreOverloadsToBaseSignature.types b/tests/baselines/reference/addMoreOverloadsToBaseSignature.types index 02a566217ad..cd676e084d1 100644 --- a/tests/baselines/reference/addMoreOverloadsToBaseSignature.types +++ b/tests/baselines/reference/addMoreOverloadsToBaseSignature.types @@ -1,15 +1,10 @@ === tests/cases/compiler/addMoreOverloadsToBaseSignature.ts === interface Foo { ->Foo : Foo - f(): string; >f : () => string } interface Bar extends Foo { ->Bar : Bar ->Foo : Foo - f(key: string): string; >f : (key: string) => string >key : string diff --git a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types index 0994360ca10..1f8a9752dcc 100644 --- a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types +++ b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types @@ -35,7 +35,6 @@ var d: string; var e: Object; >e : Object ->Object : Object // any as left operand, result is type Any except plusing string var r1 = a + a; diff --git a/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.types b/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.types index d52c77a94fd..090f0ecda93 100644 --- a/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.types +++ b/tests/baselines/reference/additionOperatorWithConstrainedTypeParameter.types @@ -2,15 +2,9 @@ // test for #17069 function sum, K extends string>(n: number, v: T, k: K) { >sum : , K extends string>(n: number, v: T, k: K) => void ->T : T ->Record : Record ->K : K ->K : K >n : number >v : T ->T : T >k : K ->K : K n = n + v[k]; >n = n + v[k] : number @@ -30,15 +24,9 @@ function sum, K extends string>(n: number, v: T, k: } function realSum, K extends string>(n: number, vs: T[], k: K) { >realSum : , K extends string>(n: number, vs: T[], k: K) => void ->T : T ->Record : Record ->K : K ->K : K >n : number >vs : T[] ->T : T >k : K ->K : K for (const v of vs) { >v : T diff --git a/tests/baselines/reference/additionOperatorWithInvalidOperands.types b/tests/baselines/reference/additionOperatorWithInvalidOperands.types index 9701d8552dd..561b23a618b 100644 --- a/tests/baselines/reference/additionOperatorWithInvalidOperands.types +++ b/tests/baselines/reference/additionOperatorWithInvalidOperands.types @@ -29,11 +29,9 @@ var b: number; var c: Object; >c : Object ->Object : Object var d: Number; >d : Number ->Number : Number // boolean + every type except any and string var r1 = a + a; diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.types b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.types index 7e0d5d7ab31..266c4f2180f 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.types +++ b/tests/baselines/reference/additionOperatorWithNullValueAndInvalidOperator.types @@ -10,14 +10,12 @@ var a: boolean; var b: Object; >b : Object ->Object : Object var c: void; >c : void var d: Number; >d : Number ->Number : Number // null + boolean/Object var r1 = null + a; diff --git a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types index e6c8e919de2..f23e5359dda 100644 --- a/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types +++ b/tests/baselines/reference/additionOperatorWithNullValueAndValidOperator.types @@ -15,7 +15,6 @@ var b: number; var c: E; >c : E ->E : E var d: string; >d : string diff --git a/tests/baselines/reference/additionOperatorWithNumberAndEnum.types b/tests/baselines/reference/additionOperatorWithNumberAndEnum.types index c952fca9064..aca445bf2cf 100644 --- a/tests/baselines/reference/additionOperatorWithNumberAndEnum.types +++ b/tests/baselines/reference/additionOperatorWithNumberAndEnum.types @@ -14,12 +14,9 @@ var a: number; var b: E; >b : E ->E : E var c: E | F; >c : E | F ->E : E ->F : F var r1 = a + a; >r1 : number diff --git a/tests/baselines/reference/additionOperatorWithStringAndEveryType.types b/tests/baselines/reference/additionOperatorWithStringAndEveryType.types index d938da263b7..28be50ab48a 100644 --- a/tests/baselines/reference/additionOperatorWithStringAndEveryType.types +++ b/tests/baselines/reference/additionOperatorWithStringAndEveryType.types @@ -19,14 +19,12 @@ var d: string; var e: Object; >e : Object ->Object : Object var f: void; >f : void var g: E; >g : E ->E : E var x: string; >x : string diff --git a/tests/baselines/reference/additionOperatorWithTypeParameter.types b/tests/baselines/reference/additionOperatorWithTypeParameter.types index 1ebc2d5b02f..3f103a30db1 100644 --- a/tests/baselines/reference/additionOperatorWithTypeParameter.types +++ b/tests/baselines/reference/additionOperatorWithTypeParameter.types @@ -7,12 +7,8 @@ enum E { a, b } function foo(t: T, u: U) { >foo : (t: T, u: U) => void ->T : T ->U : U >t : T ->T : T >u : U ->U : U var a: any; >a : any @@ -28,11 +24,9 @@ function foo(t: T, u: U) { var e: Object; >e : Object ->Object : Object var g: E; >g : E ->E : E var f: void; >f : void diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.types b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.types index 4a38511c10e..00f050b8464 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.types +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndInvalidOperands.types @@ -10,14 +10,12 @@ var a: boolean; var b: Object; >b : Object ->Object : Object var c: void; >c : void var d: Number; >d : Number ->Number : Number // undefined + boolean/Object var r1 = undefined + a; diff --git a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types index 2d0177c1675..5a49cdeba59 100644 --- a/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types +++ b/tests/baselines/reference/additionOperatorWithUndefinedValueAndValidOperator.types @@ -15,7 +15,6 @@ var b: number; var c: E; >c : E ->E : E var d: string; >d : string diff --git a/tests/baselines/reference/aliasBug.types b/tests/baselines/reference/aliasBug.types index 6a896a64c29..d01be940b05 100644 --- a/tests/baselines/reference/aliasBug.types +++ b/tests/baselines/reference/aliasBug.types @@ -35,17 +35,14 @@ function use() { var p1: provide.Provide; // error here, but should be okay >p1 : provide.Provide >provide : any ->Provide : provide.Provide var p2: foo.Provide; >p2 : provide.Provide >foo : any ->Provide : provide.Provide var p3:booz.bar; >p3 : any >booz : any ->bar : No type information available! var p22 = new provide.Provide(); >p22 : provide.Provide diff --git a/tests/baselines/reference/aliasErrors.types b/tests/baselines/reference/aliasErrors.types index c8e1b04fa76..e1fb1cada4f 100644 --- a/tests/baselines/reference/aliasErrors.types +++ b/tests/baselines/reference/aliasErrors.types @@ -75,17 +75,14 @@ function use() { var p1: provide.Provide; >p1 : provide.Provide >provide : any ->Provide : provide.Provide var p2: foo.Provide; >p2 : provide.Provide >foo : any ->Provide : provide.Provide var p3:booz.bar; >p3 : any >booz : any ->bar : No type information available! var p22 = new provide.Provide(); >p22 : provide.Provide diff --git a/tests/baselines/reference/aliasInaccessibleModule.types b/tests/baselines/reference/aliasInaccessibleModule.types index fc5e85f37cb..c38015e2865 100644 --- a/tests/baselines/reference/aliasInaccessibleModule.types +++ b/tests/baselines/reference/aliasInaccessibleModule.types @@ -3,7 +3,6 @@ module M { >M : typeof M module N { ->N : any } export import X = N; >X : any diff --git a/tests/baselines/reference/aliasOnMergedModuleInterface.types b/tests/baselines/reference/aliasOnMergedModuleInterface.types index 3124e10b2f4..86ad2d5f2cc 100644 --- a/tests/baselines/reference/aliasOnMergedModuleInterface.types +++ b/tests/baselines/reference/aliasOnMergedModuleInterface.types @@ -5,7 +5,6 @@ import foo = require("foo") var z: foo; >z : foo ->foo : foo z.bar("hello"); // This should be ok >z.bar("hello") : foo.A @@ -17,7 +16,6 @@ z.bar("hello"); // This should be ok var x: foo.A = foo.bar("hello"); // foo.A should be ok but foo.bar should be error >x : foo.A >foo : any ->A : foo.A >foo.bar("hello") : any >foo.bar : any >foo : any @@ -29,20 +27,14 @@ declare module "foo" >"foo" : typeof import("foo") { module B { ->B : any - export interface A { ->A : A } } interface B { ->B : B - bar(name: string): B.A; >bar : (name: string) => B.A >name : string >B : any ->A : B.A } export = B; >B : B diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.types b/tests/baselines/reference/aliasUsageInAccessorsOfClass.types index c66f4c5c193..e5dfdfd6366 100644 --- a/tests/baselines/reference/aliasUsageInAccessorsOfClass.types +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.types @@ -6,8 +6,6 @@ import moduleA = require("./aliasUsage1_moduleA"); >moduleA : typeof moduleA interface IHasVisualizationModel { ->IHasVisualizationModel : IHasVisualizationModel - VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model >Backbone.Model : typeof Backbone.Model @@ -19,7 +17,6 @@ class C2 { x: IHasVisualizationModel; >x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel get A() { >A : IHasVisualizationModel diff --git a/tests/baselines/reference/aliasUsageInArray.types b/tests/baselines/reference/aliasUsageInArray.types index ca8f0e61f2f..168bb0cf6f8 100644 --- a/tests/baselines/reference/aliasUsageInArray.types +++ b/tests/baselines/reference/aliasUsageInArray.types @@ -6,8 +6,6 @@ import moduleA = require("./aliasUsageInArray_moduleA"); >moduleA : typeof moduleA interface IHasVisualizationModel { ->IHasVisualizationModel : IHasVisualizationModel - VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model >Backbone.Model : typeof Backbone.Model @@ -17,7 +15,6 @@ interface IHasVisualizationModel { var xs: IHasVisualizationModel[] = [moduleA]; >xs : IHasVisualizationModel[] ->IHasVisualizationModel : IHasVisualizationModel >[moduleA] : (typeof moduleA)[] >moduleA : typeof moduleA diff --git a/tests/baselines/reference/aliasUsageInFunctionExpression.types b/tests/baselines/reference/aliasUsageInFunctionExpression.types index 15716de5330..df5266e5db0 100644 --- a/tests/baselines/reference/aliasUsageInFunctionExpression.types +++ b/tests/baselines/reference/aliasUsageInFunctionExpression.types @@ -6,8 +6,6 @@ import moduleA = require("./aliasUsageInFunctionExpression_moduleA"); >moduleA : typeof moduleA interface IHasVisualizationModel { ->IHasVisualizationModel : IHasVisualizationModel - VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model >Backbone.Model : typeof Backbone.Model @@ -18,7 +16,6 @@ var f = (x: IHasVisualizationModel) => x; >f : (x: IHasVisualizationModel) => IHasVisualizationModel >(x: IHasVisualizationModel) => x : (x: IHasVisualizationModel) => IHasVisualizationModel >x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel >x : IHasVisualizationModel f = (x) => moduleA; diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.types b/tests/baselines/reference/aliasUsageInGenericFunction.types index 5fe7a3e49ef..7d7bb368d2d 100644 --- a/tests/baselines/reference/aliasUsageInGenericFunction.types +++ b/tests/baselines/reference/aliasUsageInGenericFunction.types @@ -6,8 +6,6 @@ import moduleA = require("./aliasUsageInGenericFunction_moduleA"); >moduleA : typeof moduleA interface IHasVisualizationModel { ->IHasVisualizationModel : IHasVisualizationModel - VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model >Backbone.Model : typeof Backbone.Model @@ -16,11 +14,8 @@ interface IHasVisualizationModel { } function foo(x: T) { >foo : (x: T) => T ->T : T >a : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel >x : T ->T : T return x; >x : T @@ -40,7 +35,6 @@ var r2 = foo({ a: null }); >{ a: null } : { a: IHasVisualizationModel; } >a : IHasVisualizationModel >null : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel >null : null === tests/cases/compiler/aliasUsageInGenericFunction_backbone.ts === diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.types b/tests/baselines/reference/aliasUsageInIndexerOfClass.types index d6040a90410..240fb6cbc1d 100644 --- a/tests/baselines/reference/aliasUsageInIndexerOfClass.types +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.types @@ -6,8 +6,6 @@ import moduleA = require("./aliasUsageInIndexerOfClass_moduleA"); >moduleA : typeof moduleA interface IHasVisualizationModel { ->IHasVisualizationModel : IHasVisualizationModel - VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model >Backbone.Model : typeof Backbone.Model @@ -19,7 +17,6 @@ class N { [idx: string]: IHasVisualizationModel >idx : string ->IHasVisualizationModel : IHasVisualizationModel x = moduleA; >x : typeof moduleA @@ -34,7 +31,6 @@ class N2 { x: IHasVisualizationModel; >x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel } === tests/cases/compiler/aliasUsageInIndexerOfClass_backbone.ts === export class Model { diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.types b/tests/baselines/reference/aliasUsageInObjectLiteral.types index 5c8f08a6af2..d729e2b2536 100644 --- a/tests/baselines/reference/aliasUsageInObjectLiteral.types +++ b/tests/baselines/reference/aliasUsageInObjectLiteral.types @@ -6,8 +6,6 @@ import moduleA = require("./aliasUsageInObjectLiteral_moduleA"); >moduleA : typeof moduleA interface IHasVisualizationModel { ->IHasVisualizationModel : IHasVisualizationModel - VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model >Backbone.Model : typeof Backbone.Model @@ -25,7 +23,6 @@ var a: { x: typeof moduleA } = { x: moduleA }; var b: { x: IHasVisualizationModel } = { x: moduleA }; >b : { x: IHasVisualizationModel; } >x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel >{ x: moduleA } : { x: typeof moduleA; } >x : typeof moduleA >moduleA : typeof moduleA @@ -34,7 +31,6 @@ var c: { y: { z: IHasVisualizationModel } } = { y: { z: moduleA } }; >c : { y: { z: IHasVisualizationModel; }; } >y : { z: IHasVisualizationModel; } >z : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel >{ y: { z: moduleA } } : { y: { z: typeof moduleA; }; } >y : { z: typeof moduleA; } >{ z: moduleA } : { z: typeof moduleA; } diff --git a/tests/baselines/reference/aliasUsageInOrExpression.types b/tests/baselines/reference/aliasUsageInOrExpression.types index 0fcf3c3590d..64e5117dea6 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.types +++ b/tests/baselines/reference/aliasUsageInOrExpression.types @@ -6,8 +6,6 @@ import moduleA = require("./aliasUsageInOrExpression_moduleA"); >moduleA : typeof moduleA interface IHasVisualizationModel { ->IHasVisualizationModel : IHasVisualizationModel - VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model >Backbone.Model : typeof Backbone.Model @@ -16,7 +14,6 @@ interface IHasVisualizationModel { } var i: IHasVisualizationModel; >i : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel var d1 = i || moduleA; >d1 : IHasVisualizationModel @@ -26,14 +23,12 @@ var d1 = i || moduleA; var d2: IHasVisualizationModel = i || moduleA; >d2 : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel >i || moduleA : IHasVisualizationModel >i : IHasVisualizationModel >moduleA : typeof moduleA var d2: IHasVisualizationModel = moduleA || i; >d2 : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel >moduleA || i : IHasVisualizationModel >moduleA : typeof moduleA >i : IHasVisualizationModel @@ -41,11 +36,9 @@ var d2: IHasVisualizationModel = moduleA || i; var e: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null || { x: moduleA }; >e : { x: IHasVisualizationModel; } >x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel ><{ x: IHasVisualizationModel }>null || { x: moduleA } : { x: IHasVisualizationModel; } ><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; } >x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel >null : null >{ x: moduleA } : { x: typeof moduleA; } >x : typeof moduleA @@ -54,11 +47,9 @@ var e: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null || { var f: { x: IHasVisualizationModel } = <{ x: IHasVisualizationModel }>null ? { x: moduleA } : null; >f : { x: IHasVisualizationModel; } >x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel ><{ x: IHasVisualizationModel }>null ? { x: moduleA } : null : { x: typeof moduleA; } ><{ x: IHasVisualizationModel }>null : { x: IHasVisualizationModel; } >x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel >null : null >{ x: moduleA } : { x: typeof moduleA; } >x : typeof moduleA diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types index 3d3d3b6d3f5..4b3a75435ae 100644 --- a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.types @@ -6,8 +6,6 @@ import moduleA = require("./aliasUsageInTypeArgumentOfExtendsClause_moduleA"); >moduleA : typeof moduleA interface IHasVisualizationModel { ->IHasVisualizationModel : IHasVisualizationModel - VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model >Backbone.Model : typeof Backbone.Model @@ -16,17 +14,13 @@ interface IHasVisualizationModel { } class C { >C : C ->T : T ->IHasVisualizationModel : IHasVisualizationModel x: T; >x : T ->T : T } class D extends C { >D : D >C : C ->IHasVisualizationModel : IHasVisualizationModel x = moduleA; >x : typeof moduleA diff --git a/tests/baselines/reference/aliasUsageInVarAssignment.types b/tests/baselines/reference/aliasUsageInVarAssignment.types index cf636a15240..679bd1be14c 100644 --- a/tests/baselines/reference/aliasUsageInVarAssignment.types +++ b/tests/baselines/reference/aliasUsageInVarAssignment.types @@ -6,8 +6,6 @@ import moduleA = require("./aliasUsageInVarAssignment_moduleA"); >moduleA : typeof moduleA interface IHasVisualizationModel { ->IHasVisualizationModel : IHasVisualizationModel - VisualizationModel: typeof Backbone.Model; >VisualizationModel : typeof Backbone.Model >Backbone.Model : typeof Backbone.Model @@ -16,7 +14,6 @@ interface IHasVisualizationModel { } var i: IHasVisualizationModel; >i : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel var m: typeof moduleA = i; >m : typeof moduleA diff --git a/tests/baselines/reference/aliasWithInterfaceExportAssignmentUsedInVarInitializer.types b/tests/baselines/reference/aliasWithInterfaceExportAssignmentUsedInVarInitializer.types index 6a80fcc768c..78c7bf7203a 100644 --- a/tests/baselines/reference/aliasWithInterfaceExportAssignmentUsedInVarInitializer.types +++ b/tests/baselines/reference/aliasWithInterfaceExportAssignmentUsedInVarInitializer.types @@ -10,8 +10,6 @@ var d = b.q3; === tests/cases/compiler/aliasWithInterfaceExportAssignmentUsedInVarInitializer_0.ts === interface c { ->c : c - q3: number; >q3 : number } diff --git a/tests/baselines/reference/allowImportClausesToMergeWithTypes.types b/tests/baselines/reference/allowImportClausesToMergeWithTypes.types index 89d6a416ff3..f02568ccfa9 100644 --- a/tests/baselines/reference/allowImportClausesToMergeWithTypes.types +++ b/tests/baselines/reference/allowImportClausesToMergeWithTypes.types @@ -8,8 +8,6 @@ export default zzz; === tests/cases/compiler/a.ts === export default interface zzz { ->zzz : zzz - x: string; >x : string } @@ -19,7 +17,6 @@ import zzz from "./b"; const x: zzz = { x: "" }; >x : zzz ->zzz : zzz >{ x: "" } : { x: string; } >x : string >"" : "" @@ -37,7 +34,6 @@ import zzz from "./a"; const x: zzz = { x: "" }; >x : zzz ->zzz : zzz >{ x: "" } : { x: string; } >x : string >"" : "" @@ -53,6 +49,5 @@ originalZZZ; const y: originalZZZ = x; >y : any ->originalZZZ : No type information available! >x : zzz diff --git a/tests/baselines/reference/allowJscheckJsTypeParameterNoCrash.types b/tests/baselines/reference/allowJscheckJsTypeParameterNoCrash.types index e1b331019bf..0d8afb198d9 100644 --- a/tests/baselines/reference/allowJscheckJsTypeParameterNoCrash.types +++ b/tests/baselines/reference/allowJscheckJsTypeParameterNoCrash.types @@ -1,23 +1,15 @@ === tests/cases/compiler/func.ts === interface ComponentOptions { ->ComponentOptions : ComponentOptions ->V : V - watch: Record>; >watch : Record> ->Record : Record ->WatchHandler : WatchHandler } type WatchHandler = (val: T) => void; >WatchHandler : WatchHandler ->T : T >val : T ->T : T declare function extend(options: ComponentOptions<{}>): void; >extend : (options: ComponentOptions<{}>) => void >options : ComponentOptions<{}> ->ComponentOptions : ComponentOptions export var vextend = extend; >vextend : (options: ComponentOptions<{}>) => void diff --git a/tests/baselines/reference/allowSyntheticDefaultImportsCanPaintCrossModuleDeclaration.types b/tests/baselines/reference/allowSyntheticDefaultImportsCanPaintCrossModuleDeclaration.types index ffcf611af8c..a13afabff37 100644 --- a/tests/baselines/reference/allowSyntheticDefaultImportsCanPaintCrossModuleDeclaration.types +++ b/tests/baselines/reference/allowSyntheticDefaultImportsCanPaintCrossModuleDeclaration.types @@ -1,7 +1,5 @@ === tests/cases/compiler/color.ts === interface Color { ->Color : Color - c: string; >c : string } @@ -14,7 +12,6 @@ import Color from "./color"; export declare function styled(): Color; >styled : () => Color ->Color : Color === tests/cases/compiler/file2.ts === import { styled } from "./file1"; diff --git a/tests/baselines/reference/ambientClassDeclarationWithExtends.types b/tests/baselines/reference/ambientClassDeclarationWithExtends.types index 75040fb08d9..cd29836ce59 100644 --- a/tests/baselines/reference/ambientClassDeclarationWithExtends.types +++ b/tests/baselines/reference/ambientClassDeclarationWithExtends.types @@ -22,7 +22,6 @@ declare class D extends C { } var d: C = new D(); >d : C ->C : C >new D() : D >D : typeof D @@ -44,7 +43,6 @@ declare class F extends E { } var f: E = new F(); >f : E ->E : E >new F() : F >F : typeof F diff --git a/tests/baselines/reference/ambientClassMergesOverloadsWithInterface.types b/tests/baselines/reference/ambientClassMergesOverloadsWithInterface.types index 7a271b82865..4faedc6901e 100644 --- a/tests/baselines/reference/ambientClassMergesOverloadsWithInterface.types +++ b/tests/baselines/reference/ambientClassMergesOverloadsWithInterface.types @@ -10,8 +10,6 @@ declare class C { >n : number } interface C { ->C : C - foo(n: number): any; >foo : { (n: number): any; (n: number): any; } >n : number diff --git a/tests/baselines/reference/ambientConstLiterals.types b/tests/baselines/reference/ambientConstLiterals.types index 6f8a477b94d..e27776e1847 100644 --- a/tests/baselines/reference/ambientConstLiterals.types +++ b/tests/baselines/reference/ambientConstLiterals.types @@ -1,10 +1,7 @@ === tests/cases/compiler/ambientConstLiterals.ts === function f(x: T): T { >f : (x: T) => T ->T : T >x : T ->T : T ->T : T return x; >x : T diff --git a/tests/baselines/reference/ambientDeclarations.types b/tests/baselines/reference/ambientDeclarations.types index 2c1df08edb8..0b4e4a932c3 100644 --- a/tests/baselines/reference/ambientDeclarations.types +++ b/tests/baselines/reference/ambientDeclarations.types @@ -53,9 +53,7 @@ declare function fn9(...q: {}[]); declare function fn10(...q: T[]); >fn10 : (...q: T[]) => any ->T : T >q : T[] ->T : T // Ambient class declare class cls { @@ -64,7 +62,6 @@ declare class cls { constructor(); method(): cls; >method : () => cls ->cls : cls static static(p): number; >static : (p: any) => number diff --git a/tests/baselines/reference/ambientErrors.types b/tests/baselines/reference/ambientErrors.types index 84914d8d645..6286d4320ad 100644 --- a/tests/baselines/reference/ambientErrors.types +++ b/tests/baselines/reference/ambientErrors.types @@ -94,8 +94,6 @@ declare module M1 { // Ambient external module not in the global module module M2 { ->M2 : any - declare module 'nope' { } >'nope' : typeof import("nope") } diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.types b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.types index 61d2b36e3ec..121b3bdbaed 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.types +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.types @@ -1,7 +1,5 @@ === tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbient.ts === module M { ->M : any - export declare module "M" { } >"M" : typeof import("M") } diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.types b/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.types index 5995d11442c..0e1c92e6442 100644 --- a/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.types +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.types @@ -17,7 +17,6 @@ declare module "OuterModule" { public x: m2.c; >x : any >m2 : any ->c : any constructor(); } diff --git a/tests/baselines/reference/ambientInsideNonAmbient.types b/tests/baselines/reference/ambientInsideNonAmbient.types index ae593ab4225..21a60b4b547 100644 --- a/tests/baselines/reference/ambientInsideNonAmbient.types +++ b/tests/baselines/reference/ambientInsideNonAmbient.types @@ -15,7 +15,6 @@ module M { >E : E export declare module M { } ->M : any } module M2 { @@ -34,5 +33,4 @@ module M2 { >E : E declare module M { } ->M : any } diff --git a/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types b/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types index a8fb61f4280..d5484af061f 100644 --- a/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types +++ b/tests/baselines/reference/ambientInsideNonAmbientExternalModule.types @@ -12,5 +12,3 @@ export declare enum E { } >E : E export declare module M { } ->M : any - diff --git a/tests/baselines/reference/ambiguousGenericAssertion1.types b/tests/baselines/reference/ambiguousGenericAssertion1.types index 380de5b7e1c..bb37c64a0ce 100644 --- a/tests/baselines/reference/ambiguousGenericAssertion1.types +++ b/tests/baselines/reference/ambiguousGenericAssertion1.types @@ -1,27 +1,19 @@ === tests/cases/compiler/ambiguousGenericAssertion1.ts === function f(x: T): T { return null; } >f : (x: T) => T ->T : T >x : T ->T : T ->T : T >null : null var r = (x: T) => x; >r : (x: T) => T >(x: T) => x : (x: T) => T ->T : T >x : T ->T : T >x : T var r2 = < (x: T) => T>f; // valid >r2 : (x: T) => T >< (x: T) => T>f : (x: T) => T ->T : T >x : T ->T : T ->T : T >f : (x: T) => T var r3 = <(x: T) => T>f; // ambiguous, appears to the parser as a << operation diff --git a/tests/baselines/reference/ambiguousOverloadResolution.types b/tests/baselines/reference/ambiguousOverloadResolution.types index dd42b44d7c3..8bdfeb7dd92 100644 --- a/tests/baselines/reference/ambiguousOverloadResolution.types +++ b/tests/baselines/reference/ambiguousOverloadResolution.types @@ -10,20 +10,15 @@ class B extends A { x: number; } declare function f(p: A, q: B): number; >f : { (p: A, q: B): number; (p: B, q: A): string; } >p : A ->A : A >q : B ->B : B declare function f(p: B, q: A): string; >f : { (p: A, q: B): number; (p: B, q: A): string; } >p : B ->B : B >q : A ->A : A var x: B; >x : B ->B : B var t: number = f(x, x); // Not an error >t : number diff --git a/tests/baselines/reference/amdDeclarationEmitNoExtraDeclare.types b/tests/baselines/reference/amdDeclarationEmitNoExtraDeclare.types index d6f799c3667..88bc9971cad 100644 --- a/tests/baselines/reference/amdDeclarationEmitNoExtraDeclare.types +++ b/tests/baselines/reference/amdDeclarationEmitNoExtraDeclare.types @@ -14,19 +14,13 @@ export class ActualClass extends Configurable(HiddenClass) {} === tests/cases/compiler/Configurable.ts === export type Constructor = { >Constructor : Constructor ->T : T new(...args: any[]): T; >args : any[] ->T : T } export function Configurable>(base: T): T { >Configurable : >(base: T) => T ->T : T ->Constructor : Constructor >base : T ->T : T ->T : T return class extends base { >class extends base { constructor(...args: any[]) { super(...args); } } : { new (...args: any[]): (Anonymous class); prototype: Configurable.(Anonymous class); } & T diff --git a/tests/baselines/reference/amdImportNotAsPrimaryExpression.types b/tests/baselines/reference/amdImportNotAsPrimaryExpression.types index 32e45936f33..80808ae12d6 100644 --- a/tests/baselines/reference/amdImportNotAsPrimaryExpression.types +++ b/tests/baselines/reference/amdImportNotAsPrimaryExpression.types @@ -11,12 +11,10 @@ import f = foo.M1; var i: f.I2; >i : f.I2 >f : any ->I2 : f.I2 var x: foo.C1 = <{m1: number}>{}; >x : foo.C1 >foo : any ->C1 : foo.C1 ><{m1: number}>{} : { m1: number; } >m1 : number >{} : {} @@ -34,13 +32,11 @@ var z: foo.M1.I2; >z : f.I2 >foo : any >M1 : any ->I2 : f.I2 var e: number = 0; >e : number >0 : foo.E1 >foo : any ->E1 : foo.E1 >0 : 0 === tests/cases/conformance/externalModules/foo_0.ts === @@ -57,8 +53,6 @@ export class C1 { } export interface I1 { ->I1 : I1 - name: string; >name : string @@ -67,11 +61,7 @@ export interface I1 { } export module M1 { ->M1 : any - export interface I2 { ->I2 : I2 - foo: string; >foo : string } diff --git a/tests/baselines/reference/anyAsGenericFunctionCall.types b/tests/baselines/reference/anyAsGenericFunctionCall.types index 4cf5dd8990d..5d63e3dc11d 100644 --- a/tests/baselines/reference/anyAsGenericFunctionCall.types +++ b/tests/baselines/reference/anyAsGenericFunctionCall.types @@ -24,7 +24,6 @@ var c = x(x); >c : any >x(x) : any >x : any ->C : C >x : any var d = x(x); diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.types b/tests/baselines/reference/anyAssignabilityInInheritance.types index 925dd5d593e..f0c1684d63c 100644 --- a/tests/baselines/reference/anyAssignabilityInInheritance.types +++ b/tests/baselines/reference/anyAssignabilityInInheritance.types @@ -2,8 +2,6 @@ // any is not a subtype of any other types, errors expected on all the below derived classes unless otherwise noted interface I { ->I : I - [x: string]: any; >x : string @@ -59,8 +57,6 @@ var r3 = foo3(a); // any declare function foo5(x: Date): Date; >foo5 : { (x: Date): Date; (x: any): any; } >x : Date ->Date : Date ->Date : Date declare function foo5(x: any): any; >foo5 : { (x: Date): Date; (x: any): any; } @@ -75,8 +71,6 @@ var r3 = foo3(a); // any declare function foo6(x: RegExp): RegExp; >foo6 : { (x: RegExp): RegExp; (x: any): any; } >x : RegExp ->RegExp : RegExp ->RegExp : RegExp declare function foo6(x: any): any; >foo6 : { (x: RegExp): RegExp; (x: any): any; } @@ -119,14 +113,11 @@ var r3 = foo3(a); // any >a : any interface I8 { foo: string } ->I8 : I8 >foo : string declare function foo9(x: I8): I8; >foo9 : { (x: I8): I8; (x: any): any; } >x : I8 ->I8 : I8 ->I8 : I8 declare function foo9(x: any): any; >foo9 : { (x: I8): I8; (x: any): any; } @@ -145,8 +136,6 @@ class A { foo: number; } declare function foo10(x: A): A; >foo10 : { (x: A): A; (x: any): any; } >x : A ->A : A ->A : A declare function foo10(x: any): any; >foo10 : { (x: A): A; (x: any): any; } @@ -160,15 +149,11 @@ var r3 = foo3(a); // any class A2 { foo: T; } >A2 : A2 ->T : T >foo : T ->T : T declare function foo11(x: A2): A2; >foo11 : { (x: A2): A2; (x: any): any; } >x : A2 ->A2 : A2 ->A2 : A2 declare function foo11(x: any): any; >foo11 : { (x: A2): A2; (x: any): any; } @@ -199,14 +184,8 @@ var r3 = foo3(a); // any declare function foo13(x: (x: T) => T): (x: T) => T; >foo13 : { (x: (x: T) => T): (x: T) => T; (x: any): any; } >x : (x: T) => T ->T : T >x : T ->T : T ->T : T ->T : T >x : T ->T : T ->T : T declare function foo13(x: any): any; >foo13 : { (x: (x: T) => T): (x: T) => T; (x: any): any; } @@ -225,8 +204,6 @@ enum E { A } declare function foo14(x: E): E; >foo14 : { (x: E): E; (x: any): any; } >x : E ->E : E ->E : E declare function foo14(x: any): any; >foo14 : { (x: E): E; (x: any): any; } @@ -278,8 +255,6 @@ module CC { declare function foo16(x: CC): CC; >foo16 : { (x: CC): CC; (x: any): any; } >x : CC ->CC : CC ->CC : CC declare function foo16(x: any): any; >foo16 : { (x: CC): CC; (x: any): any; } @@ -294,8 +269,6 @@ var r3 = foo3(a); // any declare function foo17(x: Object): Object; >foo17 : { (x: Object): Object; (x: any): any; } >x : Object ->Object : Object ->Object : Object declare function foo17(x: any): any; >foo17 : { (x: Object): Object; (x: any): any; } diff --git a/tests/baselines/reference/anyAssignableToEveryType.types b/tests/baselines/reference/anyAssignableToEveryType.types index c2a9b324d96..c4ac27e5b67 100644 --- a/tests/baselines/reference/anyAssignableToEveryType.types +++ b/tests/baselines/reference/anyAssignableToEveryType.types @@ -10,17 +10,13 @@ class C { } var ac: C; >ac : C ->C : C interface I { ->I : I - foo: string; >foo : string } var ai: I; >ai : I ->I : I enum E { A } >E : E @@ -28,7 +24,6 @@ enum E { A } var ae: E; >ae : E ->E : E var b: number = a; >b : number @@ -44,7 +39,6 @@ var d: boolean = a; var e: Date = a; >e : Date ->Date : Date >a : any var f: any = a; @@ -57,7 +51,6 @@ var g: void = a; var h: Object = a; >h : Object ->Object : Object >a : any var i: {} = a; @@ -70,7 +63,6 @@ var j: () => {} = a; var k: Function = a; >k : Function ->Function : Function >a : any var l: (x: number) => string = a; @@ -104,34 +96,22 @@ var n: { foo: string } = a; var o: (x: T) => T = a; >o : (x: T) => T ->T : T >x : T ->T : T ->T : T >a : any var p: Number = a; >p : Number ->Number : Number >a : any var q: String = a; >q : String ->String : String >a : any function foo(x: T, y: U, z: V) { >foo : (x: T, y: U, z: V) => void ->T : T ->U : U ->V : V ->Date : Date >x : T ->T : T >y : U ->U : U >z : V ->V : V x = a; >x = a : any diff --git a/tests/baselines/reference/anyAssignableToEveryType2.types b/tests/baselines/reference/anyAssignableToEveryType2.types index 564b634cde3..c4c21f503b6 100644 --- a/tests/baselines/reference/anyAssignableToEveryType2.types +++ b/tests/baselines/reference/anyAssignableToEveryType2.types @@ -2,8 +2,6 @@ // any is not a subtype of any other types, but is assignable, all the below should work interface I { ->I : I - [x: string]: any; >x : string @@ -13,8 +11,6 @@ interface I { interface I2 { ->I2 : I2 - [x: string]: number; >x : string @@ -24,8 +20,6 @@ interface I2 { interface I3 { ->I3 : I3 - [x: string]: string; >x : string @@ -35,8 +29,6 @@ interface I3 { interface I4 { ->I4 : I4 - [x: string]: boolean; >x : string @@ -46,11 +38,8 @@ interface I4 { interface I5 { ->I5 : I5 - [x: string]: Date; >x : string ->Date : Date foo: any; >foo : any @@ -58,11 +47,8 @@ interface I5 { interface I6 { ->I6 : I6 - [x: string]: RegExp; >x : string ->RegExp : RegExp foo: any; >foo : any @@ -70,8 +56,6 @@ interface I6 { interface I7 { ->I7 : I7 - [x: string]: { bar: number }; >x : string >bar : number @@ -82,8 +66,6 @@ interface I7 { interface I8 { ->I8 : I8 - [x: string]: number[]; >x : string @@ -93,11 +75,8 @@ interface I8 { interface I9 { ->I9 : I9 - [x: string]: I8; >x : string ->I8 : I8 foo: any; >foo : any @@ -108,11 +87,8 @@ class A { foo: number; } >foo : number interface I10 { ->I10 : I10 - [x: string]: A; >x : string ->A : A foo: any; >foo : any @@ -120,16 +96,11 @@ interface I10 { class A2 { foo: T; } >A2 : A2 ->T : T >foo : T ->T : T interface I11 { ->I11 : I11 - [x: string]: A2; >x : string ->A2 : A2 foo: any; >foo : any @@ -137,8 +108,6 @@ interface I11 { interface I12 { ->I12 : I12 - [x: string]: (x) => number; >x : string >x : any @@ -149,14 +118,9 @@ interface I12 { interface I13 { ->I13 : I13 - [x: string]: (x: T) => T; >x : string ->T : T >x : T ->T : T ->T : T foo: any; >foo : any @@ -168,11 +132,8 @@ enum E { A } >A : E interface I14 { ->I14 : I14 - [x: string]: E; >x : string ->E : E foo: any; >foo : any @@ -190,8 +151,6 @@ module f { >1 : 1 } interface I15 { ->I15 : I15 - [x: string]: typeof f; >x : string >f : typeof f @@ -213,8 +172,6 @@ module c { >1 : 1 } interface I16 { ->I16 : I16 - [x: string]: typeof c; >x : string >c : typeof c @@ -225,12 +182,8 @@ interface I16 { interface I17 { ->I17 : I17 ->T : T - [x: string]: T; >x : string ->T : T foo: any; >foo : any @@ -238,14 +191,8 @@ interface I17 { interface I18 { ->I18 : I18 ->T : T ->U : U ->T : T - [x: string]: U; >x : string ->U : U foo: any; >foo : any @@ -253,11 +200,8 @@ interface I18 { interface I19 { ->I19 : I19 - [x: string]: Object; >x : string ->Object : Object foo: any; >foo : any @@ -265,8 +209,6 @@ interface I19 { interface I20 { ->I20 : I20 - [x: string]: {}; >x : string diff --git a/tests/baselines/reference/anyIsAssignableToObject.types b/tests/baselines/reference/anyIsAssignableToObject.types index 5df5d3b345f..537da916cf7 100644 --- a/tests/baselines/reference/anyIsAssignableToObject.types +++ b/tests/baselines/reference/anyIsAssignableToObject.types @@ -1,15 +1,10 @@ === tests/cases/compiler/anyIsAssignableToObject.ts === interface P { ->P : P - p: {}; >p : {} } interface Q extends P { // Check assignability here. Any is assignable to {} ->Q : Q ->P : P - p: any; >p : any } diff --git a/tests/baselines/reference/anyIsAssignableToVoid.types b/tests/baselines/reference/anyIsAssignableToVoid.types index 0e1af90971f..93f10a0c28f 100644 --- a/tests/baselines/reference/anyIsAssignableToVoid.types +++ b/tests/baselines/reference/anyIsAssignableToVoid.types @@ -1,15 +1,10 @@ === tests/cases/compiler/anyIsAssignableToVoid.ts === interface P { ->P : P - p: void; >p : void } interface Q extends P { // check assignability here. any is assignable to void. ->Q : Q ->P : P - p: any; >p : any } diff --git a/tests/baselines/reference/anyMappedTypesError.types b/tests/baselines/reference/anyMappedTypesError.types index 290ea6883b1..876d2919441 100644 --- a/tests/baselines/reference/anyMappedTypesError.types +++ b/tests/baselines/reference/anyMappedTypesError.types @@ -1,5 +1,4 @@ === tests/cases/compiler/anyMappedTypesError.ts === type Foo = {[P in "bar"]}; >Foo : Foo ->P : P diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 99a9c3b6100..a3bf10dfc6f 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -368,20 +368,21 @@ declare namespace ts { JSDocAugmentsTag = 293, JSDocClassTag = 294, JSDocCallbackTag = 295, - JSDocParameterTag = 296, - JSDocReturnTag = 297, - JSDocThisTag = 298, - JSDocTypeTag = 299, - JSDocTemplateTag = 300, - JSDocTypedefTag = 301, - JSDocPropertyTag = 302, - SyntaxList = 303, - NotEmittedStatement = 304, - PartiallyEmittedExpression = 305, - CommaListExpression = 306, - MergeDeclarationMarker = 307, - EndOfDeclarationMarker = 308, - Count = 309, + JSDocEnumTag = 296, + JSDocParameterTag = 297, + JSDocReturnTag = 298, + JSDocThisTag = 299, + JSDocTypeTag = 300, + JSDocTemplateTag = 301, + JSDocTypedefTag = 302, + JSDocPropertyTag = 303, + SyntaxList = 304, + NotEmittedStatement = 305, + PartiallyEmittedExpression = 306, + CommaListExpression = 307, + MergeDeclarationMarker = 308, + EndOfDeclarationMarker = 309, + Count = 310, FirstAssignment = 58, LastAssignment = 70, FirstCompoundAssignment = 59, @@ -408,9 +409,9 @@ declare namespace ts { LastBinaryOperator = 70, FirstNode = 146, FirstJSDocNode = 281, - LastJSDocNode = 302, + LastJSDocNode = 303, FirstJSDocTagNode = 292, - LastJSDocTagNode = 302 + LastJSDocTagNode = 303 } enum NodeFlags { None = 0, @@ -479,7 +480,7 @@ declare namespace ts { } interface JSDocContainer { } - type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | LabeledStatement | ExpressionStatement | VariableStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | EndOfFileToken; + type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | LabeledStatement | ExpressionStatement | VariableStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | EndOfFileToken; type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType; type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute; type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertySignature | PropertyDeclaration | PropertyAssignment | EnumMember; @@ -616,6 +617,7 @@ declare namespace ts { _objectLiteralBrandBrand: any; name?: PropertyName; } + /** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */ type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration; interface PropertyAssignment extends ObjectLiteralElement, JSDocContainer { parent: ObjectLiteralExpression; @@ -1437,7 +1439,7 @@ declare namespace ts { kind: SyntaxKind.NamespaceExportDeclaration; name: Identifier; } - interface ExportDeclaration extends DeclarationStatement { + interface ExportDeclaration extends DeclarationStatement, JSDocContainer { kind: SyntaxKind.ExportDeclaration; parent: SourceFile | ModuleBlock; /** Will not be assigned in the case of `export * from "foo";` */ @@ -1556,6 +1558,10 @@ declare namespace ts { interface JSDocClassTag extends JSDocTag { kind: SyntaxKind.JSDocClassTag; } + interface JSDocEnumTag extends JSDocTag { + kind: SyntaxKind.JSDocEnumTag; + typeExpression?: JSDocTypeExpression; + } interface JSDocThisTag extends JSDocTag { kind: SyntaxKind.JSDocThisTag; typeExpression?: JSDocTypeExpression; @@ -3184,6 +3190,8 @@ declare namespace ts { * @returns The original parse tree node if found; otherwise, undefined. */ function getParseTreeNode(node: Node | undefined, nodeTest?: (node: Node) => node is T): T | undefined; + /** Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' */ + function escapeLeadingUnderscores(identifier: string): __String; /** * Remove extra underscore from escaped identifier text content. * @@ -3220,6 +3228,8 @@ declare namespace ts { function getJSDocAugmentsTag(node: Node): JSDocAugmentsTag | undefined; /** Gets the JSDoc class tag for the node if present */ function getJSDocClassTag(node: Node): JSDocClassTag | undefined; + /** Gets the JSDoc enum tag for the node if present */ + function getJSDocEnumTag(node: Node): JSDocEnumTag | undefined; /** Gets the JSDoc this tag for the node if present */ function getJSDocThisTag(node: Node): JSDocThisTag | undefined; /** Gets the JSDoc return tag for the node if present */ @@ -3412,6 +3422,7 @@ declare namespace ts { function isJSDoc(node: Node): node is JSDoc; function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag; function isJSDocClassTag(node: Node): node is JSDocClassTag; + function isJSDocEnumTag(node: Node): node is JSDocEnumTag; function isJSDocThisTag(node: Node): node is JSDocThisTag; function isJSDocParameterTag(node: Node): node is JSDocParameterTag; function isJSDocReturnTag(node: Node): node is JSDocReturnTag; @@ -3735,9 +3746,9 @@ declare namespace ts { function updateCall(node: CallExpression, expression: Expression, typeArguments: ReadonlyArray | undefined, argumentsArray: ReadonlyArray): CallExpression; function createNew(expression: Expression, typeArguments: ReadonlyArray | undefined, argumentsArray: ReadonlyArray | undefined): NewExpression; function updateNew(node: NewExpression, expression: Expression, typeArguments: ReadonlyArray | undefined, argumentsArray: ReadonlyArray | undefined): NewExpression; - function createTaggedTemplate(tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; + /** @deprecated */ function createTaggedTemplate(tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; function createTaggedTemplate(tag: Expression, typeArguments: ReadonlyArray | undefined, template: TemplateLiteral): TaggedTemplateExpression; - function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; + /** @deprecated */ function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, typeArguments: ReadonlyArray | undefined, template: TemplateLiteral): TaggedTemplateExpression; function createTypeAssertion(type: TypeNode, expression: Expression): TypeAssertion; function updateTypeAssertion(node: TypeAssertion, type: TypeNode, expression: Expression): TypeAssertion; @@ -3746,7 +3757,6 @@ declare namespace ts { function createFunctionExpression(modifiers: ReadonlyArray | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray | undefined, type: TypeNode | undefined, body: Block): FunctionExpression; function updateFunctionExpression(node: FunctionExpression, modifiers: ReadonlyArray | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, body: Block): FunctionExpression; function createArrowFunction(modifiers: ReadonlyArray | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction; - /** @deprecated */ function updateArrowFunction(node: ArrowFunction, modifiers: ReadonlyArray | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, body: ConciseBody): ArrowFunction; function updateArrowFunction(node: ArrowFunction, modifiers: ReadonlyArray | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, equalsGreaterThanToken: Token, body: ConciseBody): ArrowFunction; function createDelete(expression: Expression): DeleteExpression; function updateDelete(node: DeleteExpression, expression: Expression): DeleteExpression; @@ -3762,9 +3772,8 @@ declare namespace ts { function updatePostfix(node: PostfixUnaryExpression, operand: Expression): PostfixUnaryExpression; function createBinary(left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression; function updateBinary(node: BinaryExpression, left: Expression, right: Expression, operator?: BinaryOperator | BinaryOperatorToken): BinaryExpression; - function createConditional(condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; + /** @deprecated */ function createConditional(condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; function createConditional(condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression; - /** @deprecated */ function updateConditional(node: ConditionalExpression, condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; function updateConditional(node: ConditionalExpression, condition: Expression, questionToken: Token, whenTrue: Expression, colonToken: Token, whenFalse: Expression): ConditionalExpression; function createTemplateExpression(head: TemplateHead, templateSpans: ReadonlyArray): TemplateExpression; function updateTemplateExpression(node: TemplateExpression, head: TemplateHead, templateSpans: ReadonlyArray): TemplateExpression; @@ -8643,6 +8652,8 @@ declare namespace ts.server { * current directory (the directory in which tsc was invoked). * The server must start searching from the directory containing * the newly opened file. + * If script info is passed in, it is asserted to be open script info + * otherwise just file name */ private getConfigFileNameForFile; private printProjects; @@ -8713,6 +8724,7 @@ declare namespace ts.server { openClientFile(fileName: string, fileContent?: string, scriptKind?: ScriptKind, projectRootPath?: string): OpenConfiguredProjectResult; private findExternalProjectContainingOpenScriptInfo; openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult; + private removeOrphanConfiguredProjects; private telemetryOnOpenFile; /** * Close file whose contents is managed by the client diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 41510d5192b..7204259d379 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -368,20 +368,21 @@ declare namespace ts { JSDocAugmentsTag = 293, JSDocClassTag = 294, JSDocCallbackTag = 295, - JSDocParameterTag = 296, - JSDocReturnTag = 297, - JSDocThisTag = 298, - JSDocTypeTag = 299, - JSDocTemplateTag = 300, - JSDocTypedefTag = 301, - JSDocPropertyTag = 302, - SyntaxList = 303, - NotEmittedStatement = 304, - PartiallyEmittedExpression = 305, - CommaListExpression = 306, - MergeDeclarationMarker = 307, - EndOfDeclarationMarker = 308, - Count = 309, + JSDocEnumTag = 296, + JSDocParameterTag = 297, + JSDocReturnTag = 298, + JSDocThisTag = 299, + JSDocTypeTag = 300, + JSDocTemplateTag = 301, + JSDocTypedefTag = 302, + JSDocPropertyTag = 303, + SyntaxList = 304, + NotEmittedStatement = 305, + PartiallyEmittedExpression = 306, + CommaListExpression = 307, + MergeDeclarationMarker = 308, + EndOfDeclarationMarker = 309, + Count = 310, FirstAssignment = 58, LastAssignment = 70, FirstCompoundAssignment = 59, @@ -408,9 +409,9 @@ declare namespace ts { LastBinaryOperator = 70, FirstNode = 146, FirstJSDocNode = 281, - LastJSDocNode = 302, + LastJSDocNode = 303, FirstJSDocTagNode = 292, - LastJSDocTagNode = 302 + LastJSDocTagNode = 303 } enum NodeFlags { None = 0, @@ -479,7 +480,7 @@ declare namespace ts { } interface JSDocContainer { } - type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | LabeledStatement | ExpressionStatement | VariableStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | EndOfFileToken; + type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | LabeledStatement | ExpressionStatement | VariableStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | EndOfFileToken; type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType; type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute; type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertySignature | PropertyDeclaration | PropertyAssignment | EnumMember; @@ -616,6 +617,7 @@ declare namespace ts { _objectLiteralBrandBrand: any; name?: PropertyName; } + /** Unlike ObjectLiteralElement, excludes JSXAttribute and JSXSpreadAttribute. */ type ObjectLiteralElementLike = PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration; interface PropertyAssignment extends ObjectLiteralElement, JSDocContainer { parent: ObjectLiteralExpression; @@ -1437,7 +1439,7 @@ declare namespace ts { kind: SyntaxKind.NamespaceExportDeclaration; name: Identifier; } - interface ExportDeclaration extends DeclarationStatement { + interface ExportDeclaration extends DeclarationStatement, JSDocContainer { kind: SyntaxKind.ExportDeclaration; parent: SourceFile | ModuleBlock; /** Will not be assigned in the case of `export * from "foo";` */ @@ -1556,6 +1558,10 @@ declare namespace ts { interface JSDocClassTag extends JSDocTag { kind: SyntaxKind.JSDocClassTag; } + interface JSDocEnumTag extends JSDocTag { + kind: SyntaxKind.JSDocEnumTag; + typeExpression?: JSDocTypeExpression; + } interface JSDocThisTag extends JSDocTag { kind: SyntaxKind.JSDocThisTag; typeExpression?: JSDocTypeExpression; @@ -3184,6 +3190,8 @@ declare namespace ts { * @returns The original parse tree node if found; otherwise, undefined. */ function getParseTreeNode(node: Node | undefined, nodeTest?: (node: Node) => node is T): T | undefined; + /** Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' */ + function escapeLeadingUnderscores(identifier: string): __String; /** * Remove extra underscore from escaped identifier text content. * @@ -3220,6 +3228,8 @@ declare namespace ts { function getJSDocAugmentsTag(node: Node): JSDocAugmentsTag | undefined; /** Gets the JSDoc class tag for the node if present */ function getJSDocClassTag(node: Node): JSDocClassTag | undefined; + /** Gets the JSDoc enum tag for the node if present */ + function getJSDocEnumTag(node: Node): JSDocEnumTag | undefined; /** Gets the JSDoc this tag for the node if present */ function getJSDocThisTag(node: Node): JSDocThisTag | undefined; /** Gets the JSDoc return tag for the node if present */ @@ -3412,6 +3422,7 @@ declare namespace ts { function isJSDoc(node: Node): node is JSDoc; function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag; function isJSDocClassTag(node: Node): node is JSDocClassTag; + function isJSDocEnumTag(node: Node): node is JSDocEnumTag; function isJSDocThisTag(node: Node): node is JSDocThisTag; function isJSDocParameterTag(node: Node): node is JSDocParameterTag; function isJSDocReturnTag(node: Node): node is JSDocReturnTag; @@ -3735,9 +3746,9 @@ declare namespace ts { function updateCall(node: CallExpression, expression: Expression, typeArguments: ReadonlyArray | undefined, argumentsArray: ReadonlyArray): CallExpression; function createNew(expression: Expression, typeArguments: ReadonlyArray | undefined, argumentsArray: ReadonlyArray | undefined): NewExpression; function updateNew(node: NewExpression, expression: Expression, typeArguments: ReadonlyArray | undefined, argumentsArray: ReadonlyArray | undefined): NewExpression; - function createTaggedTemplate(tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; + /** @deprecated */ function createTaggedTemplate(tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; function createTaggedTemplate(tag: Expression, typeArguments: ReadonlyArray | undefined, template: TemplateLiteral): TaggedTemplateExpression; - function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; + /** @deprecated */ function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, typeArguments: ReadonlyArray | undefined, template: TemplateLiteral): TaggedTemplateExpression; function createTypeAssertion(type: TypeNode, expression: Expression): TypeAssertion; function updateTypeAssertion(node: TypeAssertion, type: TypeNode, expression: Expression): TypeAssertion; @@ -3746,7 +3757,6 @@ declare namespace ts { function createFunctionExpression(modifiers: ReadonlyArray | undefined, asteriskToken: AsteriskToken | undefined, name: string | Identifier | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray | undefined, type: TypeNode | undefined, body: Block): FunctionExpression; function updateFunctionExpression(node: FunctionExpression, modifiers: ReadonlyArray | undefined, asteriskToken: AsteriskToken | undefined, name: Identifier | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, body: Block): FunctionExpression; function createArrowFunction(modifiers: ReadonlyArray | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction; - /** @deprecated */ function updateArrowFunction(node: ArrowFunction, modifiers: ReadonlyArray | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, body: ConciseBody): ArrowFunction; function updateArrowFunction(node: ArrowFunction, modifiers: ReadonlyArray | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, equalsGreaterThanToken: Token, body: ConciseBody): ArrowFunction; function createDelete(expression: Expression): DeleteExpression; function updateDelete(node: DeleteExpression, expression: Expression): DeleteExpression; @@ -3762,9 +3772,8 @@ declare namespace ts { function updatePostfix(node: PostfixUnaryExpression, operand: Expression): PostfixUnaryExpression; function createBinary(left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression): BinaryExpression; function updateBinary(node: BinaryExpression, left: Expression, right: Expression, operator?: BinaryOperator | BinaryOperatorToken): BinaryExpression; - function createConditional(condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; + /** @deprecated */ function createConditional(condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; function createConditional(condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression; - /** @deprecated */ function updateConditional(node: ConditionalExpression, condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; function updateConditional(node: ConditionalExpression, condition: Expression, questionToken: Token, whenTrue: Expression, colonToken: Token, whenFalse: Expression): ConditionalExpression; function createTemplateExpression(head: TemplateHead, templateSpans: ReadonlyArray): TemplateExpression; function updateTemplateExpression(node: TemplateExpression, head: TemplateHead, templateSpans: ReadonlyArray): TemplateExpression; diff --git a/tests/baselines/reference/apparentTypeSubtyping.types b/tests/baselines/reference/apparentTypeSubtyping.types index 7eba6ac5941..9fa8469027c 100644 --- a/tests/baselines/reference/apparentTypeSubtyping.types +++ b/tests/baselines/reference/apparentTypeSubtyping.types @@ -4,23 +4,18 @@ class Base { >Base : Base ->U : U ->String : String x: U; >x : U ->U : U } // is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T) class Derived extends Base { // error >Derived : Derived ->U : U >Base : Base x: String; >x : String ->String : String } class Base2 { @@ -28,21 +23,16 @@ class Base2 { x: String; >x : String ->String : String static s: String; >s : String ->String : String } // is U extends String (S) a subtype of String (T)? Apparent type of U is String so it succeeds class Derived2 extends Base2 { // error because of the prototype's not matching, not because of the instance side >Derived2 : Derived2 ->U : U ->String : String >Base2 : Base2 x: U; >x : U ->U : U } diff --git a/tests/baselines/reference/apparentTypeSupertype.types b/tests/baselines/reference/apparentTypeSupertype.types index 626a4c0632d..1c1d28d6594 100644 --- a/tests/baselines/reference/apparentTypeSupertype.types +++ b/tests/baselines/reference/apparentTypeSupertype.types @@ -12,11 +12,8 @@ class Base { // is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T) class Derived extends Base { // error >Derived : Derived ->U : U ->String : String >Base : Base x: U; >x : U ->U : U } diff --git a/tests/baselines/reference/argumentsAsPropertyName.types b/tests/baselines/reference/argumentsAsPropertyName.types index d0aaaa1cc72..86bbd847470 100644 --- a/tests/baselines/reference/argumentsAsPropertyName.types +++ b/tests/baselines/reference/argumentsAsPropertyName.types @@ -5,7 +5,6 @@ type MyType = { arguments: Array >arguments : string[] ->Array : T[] } declare function use(s: any); @@ -15,7 +14,6 @@ declare function use(s: any); function myFunction(myType: MyType) { >myFunction : (myType: MyType) => void >myType : MyType ->MyType : MyType for (let i = 0; i < 10; i++) { >i : number diff --git a/tests/baselines/reference/arithmeticOnInvalidTypes.types b/tests/baselines/reference/arithmeticOnInvalidTypes.types index 330a9c67931..1bbf8bc58f6 100644 --- a/tests/baselines/reference/arithmeticOnInvalidTypes.types +++ b/tests/baselines/reference/arithmeticOnInvalidTypes.types @@ -1,11 +1,9 @@ === tests/cases/compiler/arithmeticOnInvalidTypes.ts === var x: Number; >x : Number ->Number : Number var y: Number; >y : Number ->Number : Number var z = x + y; >z : any diff --git a/tests/baselines/reference/arithmeticOnInvalidTypes2.types b/tests/baselines/reference/arithmeticOnInvalidTypes2.types index 9608ad171cf..ed1e67d6eae 100644 --- a/tests/baselines/reference/arithmeticOnInvalidTypes2.types +++ b/tests/baselines/reference/arithmeticOnInvalidTypes2.types @@ -3,11 +3,8 @@ var obj = function f(a: T, b: T) { >obj : (a: T, b: T) => T >function f(a: T, b: T) { var z1 = a + b; var z2 = a - b; var z3 = a * b; var z4 = a / b; return a;} : (a: T, b: T) => T >f : (a: T, b: T) => T ->T : T >a : T ->T : T >b : T ->T : T var z1 = a + b; >z1 : any diff --git a/tests/baselines/reference/arithmeticOperatorWithEnum.types b/tests/baselines/reference/arithmeticOperatorWithEnum.types index 0f2fbe48feb..1658349126d 100644 --- a/tests/baselines/reference/arithmeticOperatorWithEnum.types +++ b/tests/baselines/reference/arithmeticOperatorWithEnum.types @@ -19,7 +19,6 @@ var b: number; var c: E; >c : E ->E : E // operator * var ra1 = c * a; diff --git a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types index 379bd6f34b3..871480b2928 100644 --- a/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types +++ b/tests/baselines/reference/arithmeticOperatorWithEnumUnion.types @@ -28,8 +28,6 @@ var b: number; var c: E | F; >c : E | F ->E : E ->F : F // operator * var ra1 = c * a; diff --git a/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.types b/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.types index 7bd878e19ff..e26b18af908 100644 --- a/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.types +++ b/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.types @@ -25,7 +25,6 @@ var e: { a: number }; var f: Number; >f : Number ->Number : Number // All of the below should be an error unless otherwise noted // operator * diff --git a/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.types b/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.types index 2a0fb6d9239..6f357f3b658 100644 --- a/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.types +++ b/tests/baselines/reference/arithmeticOperatorWithNullValueAndInvalidOperands.types @@ -10,7 +10,6 @@ var b: string; var c: Object; >c : Object ->Object : Object // operator * var r1a1 = null * a; diff --git a/tests/baselines/reference/arithmeticOperatorWithTypeParameter.types b/tests/baselines/reference/arithmeticOperatorWithTypeParameter.types index 0fc72d5dc0f..bc77ea54c81 100644 --- a/tests/baselines/reference/arithmeticOperatorWithTypeParameter.types +++ b/tests/baselines/reference/arithmeticOperatorWithTypeParameter.types @@ -2,9 +2,7 @@ // type parameter type is not valid for arithmetic operand function foo(t: T) { >foo : (t: T) => void ->T : T >t : T ->T : T var a: any; >a : any diff --git a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.types b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.types index 3211250146b..25c42c8a33c 100644 --- a/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.types +++ b/tests/baselines/reference/arithmeticOperatorWithUndefinedValueAndInvalidOperands.types @@ -10,7 +10,6 @@ var b: string; var c: Object; >c : Object ->Object : Object // operator * var r1a1 = undefined * a; diff --git a/tests/baselines/reference/arityAndOrderCompatibility01.types b/tests/baselines/reference/arityAndOrderCompatibility01.types index 6fdbab7a587..d7a0923d964 100644 --- a/tests/baselines/reference/arityAndOrderCompatibility01.types +++ b/tests/baselines/reference/arityAndOrderCompatibility01.types @@ -1,8 +1,5 @@ === tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts === interface StrNum extends Array { ->StrNum : StrNum ->Array : T[] - 0: string; >0 : string @@ -18,7 +15,6 @@ var x: [string, number]; var y: StrNum >y : StrNum ->StrNum : StrNum var z: { >z : { 0: string; 1: number; length: 2; } diff --git a/tests/baselines/reference/arrayAssignmentTest1.types b/tests/baselines/reference/arrayAssignmentTest1.types index c46d6971eec..76810a6eb33 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.types +++ b/tests/baselines/reference/arrayAssignmentTest1.types @@ -1,14 +1,11 @@ === tests/cases/compiler/arrayAssignmentTest1.ts === interface I1 { ->I1 : I1 - IM1():void[]; >IM1 : () => void[] } class C1 implements I1 { >C1 : C1 ->I1 : I1 IM1():void[] {return null;} >IM1 : () => void[] @@ -16,7 +13,6 @@ class C1 implements I1 { C1M1():C1[] {return null;} >C1M1 : () => C1[] ->C1 : C1 >null : null } class C2 extends C1 { @@ -25,7 +21,6 @@ class C2 extends C1 { C2M1():C2[] { return null;} >C2M1 : () => C2[] ->C2 : C2 >null : null } @@ -55,24 +50,20 @@ var a1 : any = null; var c1 : C1 = new C1(); >c1 : C1 ->C1 : C1 >new C1() : C1 >C1 : typeof C1 var i1 : I1 = c1; >i1 : I1 ->I1 : I1 >c1 : C1 var c2 : C2 = new C2(); >c2 : C2 ->C2 : C2 >new C2() : C2 >C2 : typeof C2 var c3 : C3 = new C3(); >c3 : C3 ->C3 : C3 >new C3() : C3 >C3 : typeof C3 @@ -94,57 +85,46 @@ var arr_any: any[] = []; var arr_i1: I1[] = []; >arr_i1 : I1[] ->I1 : I1 >[] : undefined[] var arr_c1: C1[] = []; >arr_c1 : C1[] ->C1 : C1 >[] : undefined[] var arr_c2: C2[] = []; >arr_c2 : C2[] ->C2 : C2 >[] : undefined[] var arr_i1_2: I1[] = []; >arr_i1_2 : I1[] ->I1 : I1 >[] : undefined[] var arr_c1_2: C1[] = []; >arr_c1_2 : C1[] ->C1 : C1 >[] : undefined[] var arr_c2_2: C2[] = []; >arr_c2_2 : C2[] ->C2 : C2 >[] : undefined[] var arr_c3: C3[] = []; >arr_c3 : C3[] ->C3 : C3 >[] : undefined[] var i1_error: I1 = []; // should be an error - is >i1_error : I1 ->I1 : I1 >[] : undefined[] var c1_error: C1 = []; // should be an error - is >c1_error : C1 ->C1 : C1 >[] : undefined[] var c2_error: C2 = []; // should be an error - is >c2_error : C2 ->C2 : C2 >[] : undefined[] var c3_error: C3 = []; // should be an error - is >c3_error : C3 ->C3 : C3 >[] : undefined[] diff --git a/tests/baselines/reference/arrayAssignmentTest2.types b/tests/baselines/reference/arrayAssignmentTest2.types index 86d35b06d07..100336ae58b 100644 --- a/tests/baselines/reference/arrayAssignmentTest2.types +++ b/tests/baselines/reference/arrayAssignmentTest2.types @@ -1,14 +1,11 @@ === tests/cases/compiler/arrayAssignmentTest2.ts === interface I1 { ->I1 : I1 - IM1():void[]; >IM1 : () => void[] } class C1 implements I1 { >C1 : C1 ->I1 : I1 IM1():void[] {return null;} >IM1 : () => void[] @@ -16,7 +13,6 @@ class C1 implements I1 { C1M1():C1[] {return null;} >C1M1 : () => C1[] ->C1 : C1 >null : null } class C2 extends C1 { @@ -25,7 +21,6 @@ class C2 extends C1 { C2M1():C2[] { return null;} >C2M1 : () => C2[] ->C2 : C2 >null : null } @@ -55,24 +50,20 @@ var a1 : any = null; var c1 : C1 = new C1(); >c1 : C1 ->C1 : C1 >new C1() : C1 >C1 : typeof C1 var i1 : I1 = c1; >i1 : I1 ->I1 : I1 >c1 : C1 var c2 : C2 = new C2(); >c2 : C2 ->C2 : C2 >new C2() : C2 >C2 : typeof C2 var c3 : C3 = new C3(); >c3 : C3 ->C3 : C3 >new C3() : C3 >C3 : typeof C3 @@ -94,37 +85,30 @@ var arr_any: any[] = []; var arr_i1: I1[] = []; >arr_i1 : I1[] ->I1 : I1 >[] : undefined[] var arr_c1: C1[] = []; >arr_c1 : C1[] ->C1 : C1 >[] : undefined[] var arr_c2: C2[] = []; >arr_c2 : C2[] ->C2 : C2 >[] : undefined[] var arr_i1_2: I1[] = []; >arr_i1_2 : I1[] ->I1 : I1 >[] : undefined[] var arr_c1_2: C1[] = []; >arr_c1_2 : C1[] ->C1 : C1 >[] : undefined[] var arr_c2_2: C2[] = []; >arr_c2_2 : C2[] ->C2 : C2 >[] : undefined[] var arr_c3: C3[] = []; >arr_c3 : C3[] ->C3 : C3 >[] : undefined[] // "clean up error" occurs at this point diff --git a/tests/baselines/reference/arrayAssignmentTest3.types b/tests/baselines/reference/arrayAssignmentTest3.types index 1a3e1e3805e..ec1b5de51b2 100644 --- a/tests/baselines/reference/arrayAssignmentTest3.types +++ b/tests/baselines/reference/arrayAssignmentTest3.types @@ -12,7 +12,6 @@ class a { >x : string >y : number >z : B[] ->B : B } diff --git a/tests/baselines/reference/arrayAssignmentTest4.types b/tests/baselines/reference/arrayAssignmentTest4.types index c80591a8b1f..3c3579d2e38 100644 --- a/tests/baselines/reference/arrayAssignmentTest4.types +++ b/tests/baselines/reference/arrayAssignmentTest4.types @@ -21,7 +21,6 @@ Type 1 of any[]: */ var c3 : C3 = new C3(); >c3 : C3 ->C3 : C3 >new C3() : C3 >C3 : typeof C3 diff --git a/tests/baselines/reference/arrayAssignmentTest5.types b/tests/baselines/reference/arrayAssignmentTest5.types index 7e8d2e0d39b..64a866d2346 100644 --- a/tests/baselines/reference/arrayAssignmentTest5.types +++ b/tests/baselines/reference/arrayAssignmentTest5.types @@ -3,70 +3,48 @@ module Test { >Test : typeof Test interface IState { ->IState : IState } interface IToken { ->IToken : IToken - startIndex: number; >startIndex : number } interface IStateToken extends IToken { ->IStateToken : IStateToken ->IToken : IToken - state: IState; >state : IState ->IState : IState } interface ILineTokens { ->ILineTokens : ILineTokens - tokens: IToken[]; >tokens : IToken[] ->IToken : IToken endState: IState; >endState : IState ->IState : IState } interface IAction { ->IAction : IAction } interface IMode { ->IMode : IMode - onEnter(line:string, state:IState, offset:number):IAction; >onEnter : (line: string, state: IState, offset: number) => IAction >line : string >state : IState ->IState : IState >offset : number ->IAction : IAction tokenize(line:string, state:IState, includeStates:boolean):ILineTokens; >tokenize : (line: string, state: IState, includeStates: boolean) => ILineTokens >line : string >state : IState ->IState : IState >includeStates : boolean ->ILineTokens : ILineTokens } export class Bug implements IMode { >Bug : Bug ->IMode : IMode public onEnter(line:string, state:IState, offset:number):IAction { >onEnter : (line: string, state: IState, offset: number) => IAction >line : string >state : IState ->IState : IState >offset : number ->IAction : IAction var lineTokens:ILineTokens= this.tokenize(line, state, true); >lineTokens : ILineTokens ->ILineTokens : ILineTokens >this.tokenize(line, state, true) : ILineTokens >this.tokenize : (line: string, state: IState, includeStates: boolean) => ILineTokens >this : this @@ -77,7 +55,6 @@ module Test { var tokens:IStateToken[]= lineTokens.tokens; >tokens : IStateToken[] ->IStateToken : IStateToken >lineTokens.tokens : IToken[] >lineTokens : ILineTokens >tokens : IToken[] @@ -103,9 +80,7 @@ module Test { >tokenize : (line: string, state: IState, includeStates: boolean) => ILineTokens >line : string >state : IState ->IState : IState >includeStates : boolean ->ILineTokens : ILineTokens return null; >null : null diff --git a/tests/baselines/reference/arrayAssignmentTest6.types b/tests/baselines/reference/arrayAssignmentTest6.types index 411144d4426..f2bc1ab04fc 100644 --- a/tests/baselines/reference/arrayAssignmentTest6.types +++ b/tests/baselines/reference/arrayAssignmentTest6.types @@ -3,47 +3,33 @@ module Test { >Test : typeof Test interface IState { ->IState : IState } interface IToken { ->IToken : IToken - startIndex: number; >startIndex : number } interface ILineTokens { ->ILineTokens : ILineTokens - tokens: IToken[]; >tokens : IToken[] ->IToken : IToken endState: IState; >endState : IState ->IState : IState } interface IMode { ->IMode : IMode - tokenize(line:string, state:IState, includeStates:boolean):ILineTokens; >tokenize : (line: string, state: IState, includeStates: boolean) => ILineTokens >line : string >state : IState ->IState : IState >includeStates : boolean ->ILineTokens : ILineTokens } export class Bug implements IMode { >Bug : Bug ->IMode : IMode public tokenize(line:string, tokens:IToken[], includeStates:boolean):ILineTokens { >tokenize : (line: string, tokens: IToken[], includeStates: boolean) => ILineTokens >line : string >tokens : IToken[] ->IToken : IToken >includeStates : boolean ->ILineTokens : ILineTokens return null; >null : null diff --git a/tests/baselines/reference/arrayAugment.types b/tests/baselines/reference/arrayAugment.types index 6d4e5a70a51..224c762c40c 100644 --- a/tests/baselines/reference/arrayAugment.types +++ b/tests/baselines/reference/arrayAugment.types @@ -1,12 +1,8 @@ === tests/cases/compiler/arrayAugment.ts === interface Array { ->Array : T[] ->T : T - split: (parts: number) => T[][]; >split : (parts: number) => T[][] >parts : number ->T : T } var x = ['']; diff --git a/tests/baselines/reference/arrayBestCommonTypes.types b/tests/baselines/reference/arrayBestCommonTypes.types index 97a790493d7..e08644c7561 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.types +++ b/tests/baselines/reference/arrayBestCommonTypes.types @@ -3,15 +3,11 @@ module EmptyTypes { >EmptyTypes : typeof EmptyTypes interface iface { } ->iface : iface - class base implements iface { } >base : base ->iface : iface class base2 implements iface { } >base2 : base2 ->iface : iface class derived extends base { } >derived : derived @@ -235,7 +231,6 @@ module EmptyTypes { >t1 : { x: number; y: base; }[] >x : number >y : base ->base : base >[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : { x: number; y: derived; }[] >{ x: 7, y: new derived() } : { x: number; y: derived; } >x : number @@ -254,7 +249,6 @@ module EmptyTypes { >t2 : { x: boolean; y: base; }[] >x : boolean >y : base ->base : base >[{ x: true, y: new derived() }, { x: false, y: new base() }] : ({ x: true; y: derived; } | { x: false; y: base; })[] >{ x: true, y: new derived() } : { x: true; y: derived; } >x : true @@ -273,7 +267,6 @@ module EmptyTypes { >t3 : { x: string; y: base; }[] >x : string >y : base ->base : base >[{ x: undefined, y: new base() }, { x: '', y: new derived() }] : { x: string; y: derived; }[] >{ x: undefined, y: new base() } : { x: undefined; y: base; } >x : undefined @@ -352,7 +345,6 @@ module EmptyTypes { var ifaceObj: iface = null; >ifaceObj : iface ->iface : iface >null : null var baseObj = new base(); @@ -400,18 +392,15 @@ module NonEmptyTypes { >NonEmptyTypes : typeof NonEmptyTypes interface iface { x: string; } ->iface : iface >x : string class base implements iface { x: string; y: string; } >base : base ->iface : iface >x : string >y : string class base2 implements iface { x: string; z: string; } >base2 : base2 ->iface : iface >x : string >z : string @@ -638,7 +627,6 @@ module NonEmptyTypes { >t1 : { x: number; y: base; }[] >x : number >y : base ->base : base >[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : { x: number; y: base; }[] >{ x: 7, y: new derived() } : { x: number; y: derived; } >x : number @@ -657,7 +645,6 @@ module NonEmptyTypes { >t2 : { x: boolean; y: base; }[] >x : boolean >y : base ->base : base >[{ x: true, y: new derived() }, { x: false, y: new base() }] : ({ x: true; y: derived; } | { x: false; y: base; })[] >{ x: true, y: new derived() } : { x: true; y: derived; } >x : true @@ -676,7 +663,6 @@ module NonEmptyTypes { >t3 : { x: string; y: base; }[] >x : string >y : base ->base : base >[{ x: undefined, y: new base() }, { x: '', y: new derived() }] : ({ x: undefined; y: base; } | { x: string; y: derived; })[] >{ x: undefined, y: new base() } : { x: undefined; y: base; } >x : undefined @@ -755,7 +741,6 @@ module NonEmptyTypes { var ifaceObj: iface = null; >ifaceObj : iface ->iface : iface >null : null var baseObj = new base(); diff --git a/tests/baselines/reference/arrayBufferIsViewNarrowsType.types b/tests/baselines/reference/arrayBufferIsViewNarrowsType.types index 129b7d601d8..6745afb85c1 100644 --- a/tests/baselines/reference/arrayBufferIsViewNarrowsType.types +++ b/tests/baselines/reference/arrayBufferIsViewNarrowsType.types @@ -1,7 +1,6 @@ === tests/cases/compiler/arrayBufferIsViewNarrowsType.ts === var obj: Object; >obj : Object ->Object : Object if (ArrayBuffer.isView(obj)) { >ArrayBuffer.isView(obj) : boolean @@ -13,6 +12,5 @@ if (ArrayBuffer.isView(obj)) { // isView should be a guard that narrows type to ArrayBufferView. var ab: ArrayBufferView = obj; >ab : ArrayBufferView ->ArrayBufferView : ArrayBufferView >obj : ArrayBufferView } diff --git a/tests/baselines/reference/arrayConcat3.types b/tests/baselines/reference/arrayConcat3.types index 33321c43217..8bfe636a971 100644 --- a/tests/baselines/reference/arrayConcat3.types +++ b/tests/baselines/reference/arrayConcat3.types @@ -2,26 +2,12 @@ // TODO: remove lib hack when https://github.com/Microsoft/TypeScript/issues/20454 is fixed type Fn = (subj: U) => U >Fn : Fn ->T : T ->U : U ->T : T >subj : U ->U : U ->U : U function doStuff(a: Array>, b: Array>) { >doStuff : (a: Fn[], b: Fn[]) => void ->T : T ->T1 : T1 ->T : T >a : Fn[] ->Array : T[] ->Fn : Fn ->T : T >b : Fn[] ->Array : T[] ->Fn : Fn ->T1 : T1 b.concat(a); >b.concat(a) : Fn[] diff --git a/tests/baselines/reference/arrayFind.types b/tests/baselines/reference/arrayFind.types index 5c0769cb606..8bc1b36f7f6 100644 --- a/tests/baselines/reference/arrayFind.types +++ b/tests/baselines/reference/arrayFind.types @@ -2,7 +2,6 @@ // test fix for #18112, type guard predicates should narrow returned element function isNumber(x: any): x is number { >isNumber : (x: any) => x is number ->x : any >x : any return typeof x === "number"; @@ -34,7 +33,6 @@ const readonlyArrayOfStringsNumbersAndBooleans = arrayOfStringsNumbersAndBoolean >readonlyArrayOfStringsNumbersAndBooleans : ReadonlyArray >arrayOfStringsNumbersAndBooleans as ReadonlyArray : ReadonlyArray >arrayOfStringsNumbersAndBooleans : (string | number | boolean)[] ->ReadonlyArray : ReadonlyArray const readonlyFoundNumber: number | undefined = readonlyArrayOfStringsNumbersAndBooleans.find(isNumber); >readonlyFoundNumber : number diff --git a/tests/baselines/reference/arrayFrom.types b/tests/baselines/reference/arrayFrom.types index 870d3dde945..69ac2547465 100644 --- a/tests/baselines/reference/arrayFrom.types +++ b/tests/baselines/reference/arrayFrom.types @@ -3,33 +3,25 @@ // Also tests for #19682 interface A { ->A : A - a: string; >a : string } interface B { ->B : B - b: string; >b : string } const inputA: A[] = []; >inputA : A[] ->A : A >[] : undefined[] const inputB: B[] = []; >inputB : B[] ->B : B >[] : undefined[] const inputALike: ArrayLike = { length: 0 }; >inputALike : ArrayLike ->ArrayLike : ArrayLike ->A : A >{ length: 0 } : { length: number; } >length : number >0 : 0 @@ -45,11 +37,9 @@ const inputASet = new Set(); >inputASet : Set >new Set() : Set >Set : SetConstructor ->A : A const result1: A[] = Array.from(inputA); >result1 : A[] ->A : A >Array.from(inputA) : A[] >Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor @@ -58,7 +48,6 @@ const result1: A[] = Array.from(inputA); const result2: A[] = Array.from(inputA.values()); >result2 : A[] ->A : A >Array.from(inputA.values()) : A[] >Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor @@ -70,7 +59,6 @@ const result2: A[] = Array.from(inputA.values()); const result3: B[] = Array.from(inputA.values()); // expect error >result3 : B[] ->B : B >Array.from(inputA.values()) : A[] >Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor @@ -82,7 +70,6 @@ const result3: B[] = Array.from(inputA.values()); // expect error const result4: A[] = Array.from(inputB, ({ b }): A => ({ a: b })); >result4 : A[] ->A : A >Array.from(inputB, ({ b }): A => ({ a: b })) : A[] >Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor @@ -90,7 +77,6 @@ const result4: A[] = Array.from(inputB, ({ b }): A => ({ a: b })); >inputB : B[] >({ b }): A => ({ a: b }) : ({ b }: B) => A >b : string ->A : A >({ a: b }) : { a: string; } >{ a: b } : { a: string; } >a : string @@ -98,7 +84,6 @@ const result4: A[] = Array.from(inputB, ({ b }): A => ({ a: b })); const result5: A[] = Array.from(inputALike); >result5 : A[] ->A : A >Array.from(inputALike) : A[] >Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor @@ -107,7 +92,6 @@ const result5: A[] = Array.from(inputALike); const result6: B[] = Array.from(inputALike); // expect error >result6 : B[] ->B : B >Array.from(inputALike) : A[] >Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor @@ -116,7 +100,6 @@ const result6: B[] = Array.from(inputALike); // expect error const result7: B[] = Array.from(inputALike, ({ a }): B => ({ b: a })); >result7 : B[] ->B : B >Array.from(inputALike, ({ a }): B => ({ b: a })) : B[] >Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor @@ -124,7 +107,6 @@ const result7: B[] = Array.from(inputALike, ({ a }): B => ({ b: a })); >inputALike : ArrayLike >({ a }): B => ({ b: a }) : ({ a }: A) => B >a : string ->B : B >({ b: a }) : { b: string; } >{ b: a } : { b: string; } >b : string @@ -132,7 +114,6 @@ const result7: B[] = Array.from(inputALike, ({ a }): B => ({ b: a })); const result8: A[] = Array.from(inputARand); >result8 : A[] ->A : A >Array.from(inputARand) : A[] >Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor @@ -141,7 +122,6 @@ const result8: A[] = Array.from(inputARand); const result9: B[] = Array.from(inputARand, ({ a }): B => ({ b: a })); >result9 : B[] ->B : B >Array.from(inputARand, ({ a }): B => ({ b: a })) : B[] >Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor @@ -149,7 +129,6 @@ const result9: B[] = Array.from(inputARand, ({ a }): B => ({ b: a })); >inputARand : ArrayLike | Iterable >({ a }): B => ({ b: a }) : ({ a }: A) => B >a : string ->B : B >({ b: a }) : { b: string; } >{ b: a } : { b: string; } >b : string @@ -157,18 +136,15 @@ const result9: B[] = Array.from(inputARand, ({ a }): B => ({ b: a })); const result10: A[] = Array.from(new Set()); >result10 : A[] ->A : A >Array.from(new Set()) : A[] >Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor >from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >new Set() : Set >Set : SetConstructor ->A : A const result11: B[] = Array.from(inputASet, ({ a }): B => ({ b: a })); >result11 : B[] ->B : B >Array.from(inputASet, ({ a }): B => ({ b: a })) : B[] >Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor @@ -176,7 +152,6 @@ const result11: B[] = Array.from(inputASet, ({ a }): B => ({ b: a })); >inputASet : Set >({ a }): B => ({ b: a }) : ({ a }: A) => B >a : string ->B : B >({ b: a }) : { b: string; } >{ b: a } : { b: string; } >b : string @@ -187,13 +162,8 @@ const result11: B[] = Array.from(inputASet, ({ a }): B => ({ b: a })); // even when the type is written as : Iterable|ArrayLike function getEither (in1: Iterable, in2: ArrayLike) { >getEither : (in1: Iterable, in2: ArrayLike) => Iterable | ArrayLike ->T : T >in1 : Iterable ->Iterable : Iterable ->T : T >in2 : ArrayLike ->ArrayLike : ArrayLike ->T : T return Math.random() > 0.5 ? in1 : in2; >Math.random() > 0.5 ? in1 : in2 : Iterable | ArrayLike diff --git a/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.types b/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.types index ea4803c0244..8a6d1648302 100644 --- a/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.types +++ b/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.types @@ -12,11 +12,9 @@ var myCars3 = new Array({}); var myCars4: Array; // error >myCars4 : any ->Array : T[] var myCars5: Array[]; >myCars5 : any[][] ->Array : T[] myCars = myCars3; >myCars = myCars3 : {}[] diff --git a/tests/baselines/reference/arrayLiteralContextualType.types b/tests/baselines/reference/arrayLiteralContextualType.types index f9d65aa2dff..7aac86e75d0 100644 --- a/tests/baselines/reference/arrayLiteralContextualType.types +++ b/tests/baselines/reference/arrayLiteralContextualType.types @@ -1,7 +1,5 @@ === tests/cases/compiler/arrayLiteralContextualType.ts === interface IAnimal { ->IAnimal : IAnimal - name: string; >name : string } @@ -33,13 +31,11 @@ class Elephant { function foo(animals: IAnimal[]) { } >foo : (animals: IAnimal[]) => void >animals : IAnimal[] ->IAnimal : IAnimal function bar(animals: { [n: number]: IAnimal }) { } >bar : (animals: { [n: number]: IAnimal; }) => void >animals : { [n: number]: IAnimal; } >n : number ->IAnimal : IAnimal foo([ >foo([ new Giraffe(), new Elephant()]) : void diff --git a/tests/baselines/reference/arrayLiteralTypeInference.types b/tests/baselines/reference/arrayLiteralTypeInference.types index bb3c8b0b7de..609d057e120 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.types +++ b/tests/baselines/reference/arrayLiteralTypeInference.types @@ -24,7 +24,6 @@ class ActionB extends Action { var x1: Action[] = [ >x1 : Action[] ->Action : Action >[ { id: 2, trueness: false }, { id: 3, name: "three" }] : ({ id: number; trueness: boolean; } | { id: number; name: string; })[] { id: 2, trueness: false }, @@ -45,7 +44,6 @@ var x1: Action[] = [ var x2: Action[] = [ >x2 : Action[] ->Action : Action >[ new ActionA(), new ActionB()] : (ActionA | ActionB)[] new ActionA(), @@ -60,7 +58,6 @@ var x2: Action[] = [ var x3: Action[] = [ >x3 : Action[] ->Action : Action >[ new Action(), new ActionA(), new ActionB()] : Action[] new Action(), diff --git a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types index 43cbb87e843..25c1878cd5a 100644 --- a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types +++ b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types @@ -40,7 +40,6 @@ var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[] >[(x: Object) => 1, (x: string) => 2] : ((x: Object) => number)[] >(x: Object) => 1 : (x: Object) => number >x : Object ->Object : Object >1 : 1 >(x: string) => 2 : (x: string) => number >x : string @@ -54,7 +53,6 @@ var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[] >2 : 2 >(x: Object) => 1 : (x: Object) => number >x : Object ->Object : Object >1 : 1 var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2]; // (a: { x: number; y?: number }) => number[] diff --git a/tests/baselines/reference/arrayLiterals.types b/tests/baselines/reference/arrayLiterals.types index 02dec0c8ecd..ab5c6ea037d 100644 --- a/tests/baselines/reference/arrayLiterals.types +++ b/tests/baselines/reference/arrayLiterals.types @@ -73,7 +73,6 @@ var classTypeArray = [C, C, C]; var classTypeArray: Array; // Should OK, not be a parse error >classTypeArray : (typeof C)[] ->Array : T[] >C : typeof C // Contextual type C with numeric index signature makes array literal of EveryType E of type BCT(E,C)[] @@ -133,7 +132,6 @@ class Derived2 extends Base { private n }; var context3: Base[] = [new Derived1(), new Derived2()]; >context3 : Base[] ->Base : Base >[new Derived1(), new Derived2()] : (Derived1 | Derived2)[] >new Derived1() : Derived1 >Derived1 : typeof Derived1 @@ -143,7 +141,6 @@ var context3: Base[] = [new Derived1(), new Derived2()]; // Contextual type C with numeric index signature of type Base makes array literal of Derived1 and Derived2 have type Base[] var context4: Base[] = [new Derived1(), new Derived1()]; >context4 : Base[] ->Base : Base >[new Derived1(), new Derived1()] : Derived1[] >new Derived1() : Derived1 >Derived1 : typeof Derived1 diff --git a/tests/baselines/reference/arrayLiterals2ES5.types b/tests/baselines/reference/arrayLiterals2ES5.types index c3256db925e..eada601988e 100644 --- a/tests/baselines/reference/arrayLiterals2ES5.types +++ b/tests/baselines/reference/arrayLiterals2ES5.types @@ -140,16 +140,7 @@ var temp4 = []; >[] : undefined[] interface myArray extends Array { } ->myArray : myArray ->Array : T[] ->Number : Number - interface myArray2 extends Array { } ->myArray2 : myArray2 ->Array : T[] ->Number : Number ->String : String - var d0 = [1, true, ...temp,]; // has type (string|number|boolean)[] >d0 : (string | number | boolean)[] >[1, true, ...temp,] : (string | number | boolean)[] @@ -172,14 +163,12 @@ var d2: number[] = [...temp1]; var d3: myArray = [...temp1]; >d3 : myArray ->myArray : myArray >[...temp1] : number[] >...temp1 : number >temp1 : number[] var d4: myArray2 = [...temp, ...temp1]; >d4 : myArray2 ->myArray2 : myArray2 >[...temp, ...temp1] : (string | number)[] >...temp : string >temp : string[] diff --git a/tests/baselines/reference/arrayLiterals2ES6.types b/tests/baselines/reference/arrayLiterals2ES6.types index 57f3f44f62d..dceced7a385 100644 --- a/tests/baselines/reference/arrayLiterals2ES6.types +++ b/tests/baselines/reference/arrayLiterals2ES6.types @@ -129,16 +129,7 @@ var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; >"string" : "string" interface myArray extends Array { } ->myArray : myArray ->Array : T[] ->Number : Number - interface myArray2 extends Array { } ->myArray2 : myArray2 ->Array : T[] ->Number : Number ->String : String - var d0 = [1, true, ...temp, ]; // has type (string|number|boolean)[] >d0 : (string | number | boolean)[] >[1, true, ...temp, ] : (string | number | boolean)[] @@ -161,14 +152,12 @@ var d2: number[] = [...temp1]; var d3: myArray = [...temp1]; >d3 : myArray ->myArray : myArray >[...temp1] : number[] >...temp1 : number >temp1 : number[] var d4: myArray2 = [...temp, ...temp1]; >d4 : myArray2 ->myArray2 : myArray2 >[...temp, ...temp1] : (string | number)[] >...temp : string >temp : string[] diff --git a/tests/baselines/reference/arrayLiterals3.types b/tests/baselines/reference/arrayLiterals3.types index bf3ff4cf4f6..44845feae03 100644 --- a/tests/baselines/reference/arrayLiterals3.types +++ b/tests/baselines/reference/arrayLiterals3.types @@ -61,8 +61,6 @@ var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; >"string" : "string" interface tup { ->tup : tup - 0: number[]|string[]; >0 : number[] | string[] @@ -70,19 +68,9 @@ interface tup { >1 : number[] | string[] } interface myArray extends Array { } ->myArray : myArray ->Array : T[] ->Number : Number - interface myArray2 extends Array { } ->myArray2 : myArray2 ->Array : T[] ->Number : Number ->String : String - var c0: tup = [...temp2]; // Error >c0 : tup ->tup : tup >[...temp2] : (number[] | string[])[] >...temp2 : number[] | string[] >temp2 : [number[], string[]] @@ -95,7 +83,6 @@ var c1: [number, number, number] = [...temp1]; // Error cannot assign number[ var c2: myArray = [...temp1, ...temp]; // Error cannot assign (number|string)[] to number[] >c2 : myArray ->myArray : myArray >[...temp1, ...temp] : (string | number)[] >...temp1 : number >temp1 : number[] diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.types b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.types index 75013cdef09..aef12f15f58 100644 --- a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.types +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.types @@ -1,58 +1,42 @@ === tests/cases/conformance/types/typeRelationships/recursiveTypes/arrayLiteralsWithRecursiveGenerics.ts === class List { >List : List ->T : T data: T; >data : T ->T : T next: List>; >next : List> ->List : List ->List : List ->T : T } class DerivedList extends List { >DerivedList : DerivedList ->U : U >List : List ->U : U foo: U; >foo : U ->U : U // next: List> } class MyList { >MyList : MyList ->T : T data: T; >data : T ->T : T next: MyList>; >next : MyList> ->MyList : MyList ->MyList : MyList ->T : T } var list: List; >list : List ->List : List var list2: List; >list2 : List ->List : List var myList: MyList; >myList : MyList ->MyList : MyList var xs = [list, myList]; // {}[] >xs : (List | MyList)[] @@ -74,7 +58,6 @@ var zs = [list, null]; // List[] var myDerivedList: DerivedList; >myDerivedList : DerivedList ->DerivedList : DerivedList var as = [list, myDerivedList]; // List[] >as : List[] diff --git a/tests/baselines/reference/arrayOfExportedClass.types b/tests/baselines/reference/arrayOfExportedClass.types index 8447ed2841f..74676750a9a 100644 --- a/tests/baselines/reference/arrayOfExportedClass.types +++ b/tests/baselines/reference/arrayOfExportedClass.types @@ -8,12 +8,10 @@ class Road { public cars: Car[]; >cars : Car[] ->Car : Car public AddCars(cars: Car[]) { >AddCars : (cars: Car[]) => void >cars : Car[] ->Car : Car this.cars = cars; >this.cars = cars : Car[] diff --git a/tests/baselines/reference/arrayOfFunctionTypes3.types b/tests/baselines/reference/arrayOfFunctionTypes3.types index c7251ea45d2..4dd258645a6 100644 --- a/tests/baselines/reference/arrayOfFunctionTypes3.types +++ b/tests/baselines/reference/arrayOfFunctionTypes3.types @@ -76,24 +76,18 @@ var r5b = r4(1); var a2: { (x: T): number; (x: string): string;}; >a2 : { (x: T): number; (x: string): string; } ->T : T >x : T ->T : T >x : string var b2: { (x: T): number; (x: string): string; }; >b2 : { (x: T): number; (x: string): string; } ->T : T >x : T ->T : T >x : string var c2: { (x: number): number; (x: T): any; }; >c2 : { (x: number): number; (x: T): any; } >x : number ->T : T >x : T ->T : T var z2 = [a2, b2, c2]; >z2 : { (x: number): number; (x: T): any; }[] diff --git a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.types b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.types index dea89276a58..535522182fd 100644 --- a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.types +++ b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.types @@ -10,38 +10,26 @@ class B extends A { b } class C extends Array { c } >C : C ->T : T >Array : T[] ->T : T >c : any declare var ara: A[]; >ara : A[] ->A : A declare var arb: B[]; >arb : B[] ->B : B declare var cra: C; >cra : C ->C : C ->A : A declare var crb: C; >crb : C ->C : C ->B : B declare var rra: ReadonlyArray; >rra : ReadonlyArray ->ReadonlyArray : ReadonlyArray ->A : A declare var rrb: ReadonlyArray; >rrb : ReadonlyArray ->ReadonlyArray : ReadonlyArray ->B : B rra = ara; >rra = ara : A[] diff --git a/tests/baselines/reference/arrayReferenceWithoutTypeArgs.types b/tests/baselines/reference/arrayReferenceWithoutTypeArgs.types index a4931c1c2cc..0fd47267ffe 100644 --- a/tests/baselines/reference/arrayReferenceWithoutTypeArgs.types +++ b/tests/baselines/reference/arrayReferenceWithoutTypeArgs.types @@ -5,5 +5,4 @@ class X { public f(a: Array) { } >f : (a: any) => void >a : any ->Array : T[] } diff --git a/tests/baselines/reference/arraySigChecking.types b/tests/baselines/reference/arraySigChecking.types index 470e721d1bb..bfd8b878bca 100644 --- a/tests/baselines/reference/arraySigChecking.types +++ b/tests/baselines/reference/arraySigChecking.types @@ -3,13 +3,9 @@ declare module M { >M : typeof M interface iBar { t: any; } ->iBar : iBar >t : any interface iFoo extends iBar { ->iFoo : iFoo ->iBar : iBar - s: any; >s : any } @@ -27,14 +23,11 @@ declare module M { } interface myInt { ->myInt : myInt - voidFn(): void; >voidFn : () => void } var myVar: myInt; >myVar : myInt ->myInt : myInt var strArray: string[] = [myVar.voidFn()]; >strArray : string[] diff --git a/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types index 57a8c73e5e6..702dcefe44e 100644 --- a/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types +++ b/tests/baselines/reference/arrayTypeInSignatureOfInterfaceAndClass.types @@ -4,33 +4,21 @@ declare module WinJS { class Promise { >Promise : Promise ->T : T then(success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void): Promise; >then : (success?: (value: T) => Promise, error?: (error: any) => Promise, progress?: (progress: any) => void) => Promise ->U : U >success : (value: T) => Promise >value : T ->T : T ->Promise : Promise ->U : U >error : (error: any) => Promise >error : any ->Promise : Promise ->U : U >progress : (progress: any) => void >progress : any ->Promise : Promise ->U : U } } declare module Data { >Data : typeof Data export interface IListItem { ->IListItem : IListItem ->T : T - itemIndex: number; >itemIndex : number @@ -39,7 +27,6 @@ declare module Data { data: T; >data : T ->T : T group: any; >group : any @@ -57,24 +44,15 @@ declare module Data { >preventAugmentation : boolean } export interface IVirtualList { ->IVirtualList : IVirtualList ->T : T - //removeIndices: WinJS.Promise[]>; removeIndices(indices: number[], options?: any): WinJS.Promise[]>; >removeIndices : (indices: number[], options?: any) => WinJS.Promise[]> >indices : number[] >options : any >WinJS : any ->Promise : WinJS.Promise ->IListItem : IListItem ->T : T } export class VirtualList implements IVirtualList { >VirtualList : VirtualList ->T : T ->IVirtualList : IVirtualList ->T : T //removeIndices: WinJS.Promise[]>; public removeIndices(indices: number[], options?: any): WinJS.Promise[]>; @@ -82,8 +60,5 @@ declare module Data { >indices : number[] >options : any >WinJS : any ->Promise : WinJS.Promise ->IListItem : IListItem ->T : T } } diff --git a/tests/baselines/reference/arrayTypeOfFunctionTypes.types b/tests/baselines/reference/arrayTypeOfFunctionTypes.types index 5248c6731c0..b9c4d01198a 100644 --- a/tests/baselines/reference/arrayTypeOfFunctionTypes.types +++ b/tests/baselines/reference/arrayTypeOfFunctionTypes.types @@ -41,7 +41,6 @@ var r4b = new r3(); // error var x3: Array<() => string>; >x3 : (() => string)[] ->Array : T[] var r5 = x2[1]; >r5 : () => string diff --git a/tests/baselines/reference/arrayTypeOfFunctionTypes2.types b/tests/baselines/reference/arrayTypeOfFunctionTypes2.types index 8ca385a71ba..f19a63211a1 100644 --- a/tests/baselines/reference/arrayTypeOfFunctionTypes2.types +++ b/tests/baselines/reference/arrayTypeOfFunctionTypes2.types @@ -41,7 +41,6 @@ var r4b = new r3(); var x3: Array string>; >x3 : (new () => string)[] ->Array : T[] var r5 = x2[1]; >r5 : new () => string diff --git a/tests/baselines/reference/arrayconcat.types b/tests/baselines/reference/arrayconcat.types index adbb1f7d021..9a221314aa0 100644 --- a/tests/baselines/reference/arrayconcat.types +++ b/tests/baselines/reference/arrayconcat.types @@ -1,7 +1,5 @@ === tests/cases/compiler/arrayconcat.ts === interface IOptions { ->IOptions : IOptions - name?: string; >name : string @@ -30,7 +28,6 @@ class parser { public options: IOptions[]; >options : IOptions[] ->IOptions : IOptions public m() { >m : () => void diff --git a/tests/baselines/reference/arrowFunctionContexts.symbols b/tests/baselines/reference/arrowFunctionContexts.symbols index a3dcefa1ce8..f5270c009cb 100644 --- a/tests/baselines/reference/arrowFunctionContexts.symbols +++ b/tests/baselines/reference/arrowFunctionContexts.symbols @@ -27,9 +27,9 @@ class Derived extends Base { // Arrow function as function argument window.setTimeout(() => null, 100); ->window.setTimeout : Symbol(WindowTimers.setTimeout, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>window.setTimeout : Symbol(WindowOrWorkerGlobalScope.setTimeout, Decl(lib.dom.d.ts, --, --)) >window : Symbol(window, Decl(lib.dom.d.ts, --, --)) ->setTimeout : Symbol(WindowTimers.setTimeout, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>setTimeout : Symbol(WindowOrWorkerGlobalScope.setTimeout, Decl(lib.dom.d.ts, --, --)) // Arrow function as value in array literal @@ -108,9 +108,9 @@ module M2 { // Arrow function as function argument window.setTimeout(() => null, 100); ->window.setTimeout : Symbol(WindowTimers.setTimeout, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>window.setTimeout : Symbol(WindowOrWorkerGlobalScope.setTimeout, Decl(lib.dom.d.ts, --, --)) >window : Symbol(window, Decl(lib.dom.d.ts, --, --)) ->setTimeout : Symbol(WindowTimers.setTimeout, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) +>setTimeout : Symbol(WindowOrWorkerGlobalScope.setTimeout, Decl(lib.dom.d.ts, --, --)) // Arrow function as value in array literal diff --git a/tests/baselines/reference/arrowFunctionContexts.types b/tests/baselines/reference/arrowFunctionContexts.types index bd40854d948..17907418b09 100644 --- a/tests/baselines/reference/arrowFunctionContexts.types +++ b/tests/baselines/reference/arrowFunctionContexts.types @@ -33,9 +33,9 @@ class Derived extends Base { // Arrow function as function argument window.setTimeout(() => null, 100); >window.setTimeout(() => null, 100) : number ->window.setTimeout : { (handler: (...args: any[]) => void, timeout: number): number; (handler: any, timeout?: any, ...args: any[]): number; } +>window.setTimeout : (handler: TimerHandler, timeout?: number, ...arguments: any[]) => number >window : Window ->setTimeout : { (handler: (...args: any[]) => void, timeout: number): number; (handler: any, timeout?: any, ...args: any[]): number; } +>setTimeout : (handler: TimerHandler, timeout?: number, ...arguments: any[]) => number >() => null : () => any >null : null >100 : 100 @@ -136,9 +136,9 @@ module M2 { // Arrow function as function argument window.setTimeout(() => null, 100); >window.setTimeout(() => null, 100) : number ->window.setTimeout : { (handler: (...args: any[]) => void, timeout: number): number; (handler: any, timeout?: any, ...args: any[]): number; } +>window.setTimeout : (handler: TimerHandler, timeout?: number, ...arguments: any[]) => number >window : Window ->setTimeout : { (handler: (...args: any[]) => void, timeout: number): number; (handler: any, timeout?: any, ...args: any[]): number; } +>setTimeout : (handler: TimerHandler, timeout?: number, ...arguments: any[]) => number >() => null : () => any >null : null >100 : 100 @@ -207,34 +207,24 @@ module M2 { var generic1 = (n: T) => [n]; >generic1 : (n: T) => T[] >(n: T) => [n] : (n: T) => T[] ->T : T >n : T ->T : T >[n] : T[] >n : T var generic1: { (n: T): T[] }; // Incorrect error, Bug 829597 >generic1 : (n: T) => T[] ->T : T >n : T ->T : T ->T : T var generic2 = (n: T) => { return [n]; }; >generic2 : (n: T) => T[] >(n: T) => { return [n]; } : (n: T) => T[] ->T : T >n : T ->T : T >[n] : T[] >n : T var generic2: { (n: T): T[] }; >generic2 : (n: T) => T[] ->T : T >n : T ->T : T ->T : T // ((ParamList) => { ... } ) is a type assertion to an arrow function var asserted1 = ((n) => [n]); diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types index 8a006d7f1d4..dccfe1724cc 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types @@ -3,7 +3,6 @@ var a = () => { name: "foo", message: "bar" }; >a : () => Error >() => { name: "foo", message: "bar" } : () => Error >{ name: "foo", message: "bar" } : Error ->Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string >"foo" : "foo" @@ -15,7 +14,6 @@ var b = () => ({ name: "foo", message: "bar" }); >() => ({ name: "foo", message: "bar" }) : () => Error >({ name: "foo", message: "bar" }) : Error >{ name: "foo", message: "bar" } : Error ->Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string >"foo" : "foo" @@ -38,7 +36,6 @@ var d = () => ((({ name: "foo", message: "bar" }))); >((({ name: "foo", message: "bar" }))) : Error >(({ name: "foo", message: "bar" })) : Error >({ name: "foo", message: "bar" }) : Error ->Error : Error >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types index 615f19aaf6b..fea7c40d2b0 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types @@ -3,7 +3,6 @@ var a = () => { name: "foo", message: "bar" }; >a : () => Error >() => { name: "foo", message: "bar" } : () => Error >{ name: "foo", message: "bar" } : Error ->Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string >"foo" : "foo" @@ -15,7 +14,6 @@ var b = () => ({ name: "foo", message: "bar" }); >() => ({ name: "foo", message: "bar" }) : () => Error >({ name: "foo", message: "bar" }) : Error >{ name: "foo", message: "bar" } : Error ->Error : Error >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string >"foo" : "foo" @@ -38,7 +36,6 @@ var d = () => ((({ name: "foo", message: "bar" }))); >((({ name: "foo", message: "bar" }))) : Error >(({ name: "foo", message: "bar" })) : Error >({ name: "foo", message: "bar" }) : Error ->Error : Error >({ name: "foo", message: "bar" }) : { name: string; message: string; } >{ name: "foo", message: "bar" } : { name: string; message: string; } >name : string diff --git a/tests/baselines/reference/asOperatorAmbiguity.types b/tests/baselines/reference/asOperatorAmbiguity.types index 61aa0f00e66..09677db7d01 100644 --- a/tests/baselines/reference/asOperatorAmbiguity.types +++ b/tests/baselines/reference/asOperatorAmbiguity.types @@ -1,12 +1,8 @@ === tests/cases/conformance/expressions/asOperator/asOperatorAmbiguity.ts === interface A { x: T; } ->A : A ->T : T >x : T ->T : T interface B { m: string; } ->B : B >m : string // Make sure this is a type assertion to an array type, and not nested comparison operators. @@ -17,8 +13,6 @@ var y = x as A[]; >y : A[] >x as A[] : A[] >x : any ->A : A ->B : B var z = y[0].m; // z should be string >z : any diff --git a/tests/baselines/reference/assertInWrapSomeTypeParameter.types b/tests/baselines/reference/assertInWrapSomeTypeParameter.types index 289001b6c3a..b054bed4e01 100644 --- a/tests/baselines/reference/assertInWrapSomeTypeParameter.types +++ b/tests/baselines/reference/assertInWrapSomeTypeParameter.types @@ -1,18 +1,10 @@ === tests/cases/compiler/assertInWrapSomeTypeParameter.ts === class C> { >C : C ->T : T ->C : C ->T : T foo>(x: U) { >foo : >>(x: U) => any ->U : U ->C : C ->C : C ->T : T >x : U ->U : U return null; >null : null diff --git a/tests/baselines/reference/assign1.types b/tests/baselines/reference/assign1.types index 51d9c72c54e..db8b9f05ebe 100644 --- a/tests/baselines/reference/assign1.types +++ b/tests/baselines/reference/assign1.types @@ -3,8 +3,6 @@ module M { >M : typeof M interface I { ->I : I - salt:number; >salt : number @@ -14,7 +12,6 @@ module M { var x:I={salt:2,pepper:0}; >x : I ->I : I >{salt:2,pepper:0} : { salt: number; pepper: number; } >salt : number >2 : 2 diff --git a/tests/baselines/reference/assignAnyToEveryType.types b/tests/baselines/reference/assignAnyToEveryType.types index c3f475d058d..bddd4fcb45c 100644 --- a/tests/baselines/reference/assignAnyToEveryType.types +++ b/tests/baselines/reference/assignAnyToEveryType.types @@ -47,7 +47,6 @@ enum E { var g: E = x; >g : E ->E : E >x : any var g2 = E.A; @@ -70,19 +69,15 @@ class C { var h: C = x; >h : C ->C : C >x : any interface I { ->I : I - foo: string; >foo : string } var i: I = x; >i : I ->I : I >x : any var j: { (): string } = x; @@ -91,9 +86,7 @@ var j: { (): string } = x; var j2: { (x: T): string } = x; >j2 : (x: T) => string ->T : T >x : T ->T : T >x : any module M { @@ -111,9 +104,7 @@ M = x; function k(a: T) { >k : (a: T) => void ->T : T >a : T ->T : T a = x; >a = x : any diff --git a/tests/baselines/reference/assignEveryTypeToAny.types b/tests/baselines/reference/assignEveryTypeToAny.types index cfc24e1da65..a0b397a003b 100644 --- a/tests/baselines/reference/assignEveryTypeToAny.types +++ b/tests/baselines/reference/assignEveryTypeToAny.types @@ -98,15 +98,12 @@ x = f; >f : E interface I { ->I : I - foo: string; >foo : string } var g: I; >g : I ->I : I x = g; >x = g : I @@ -122,7 +119,6 @@ class C { var h: C; >h : C ->C : C x = h; >x = h : C @@ -149,16 +145,12 @@ x = { f(x: T) { return x; } } >x : any >{ f(x: T) { return x; } } : { f(x: T): T; } >f : (x: T) => T ->T : T >x : T ->T : T >x : T function j(a: T) { >j : (a: T) => void ->T : T >a : T ->T : T x = a; >x = a : T diff --git a/tests/baselines/reference/assignFromBooleanInterface.types b/tests/baselines/reference/assignFromBooleanInterface.types index 598f89bc2a4..93c798eb993 100644 --- a/tests/baselines/reference/assignFromBooleanInterface.types +++ b/tests/baselines/reference/assignFromBooleanInterface.types @@ -5,7 +5,6 @@ var x = true; var a: Boolean; >a : Boolean ->Boolean : Boolean x = a; >x = a : Boolean diff --git a/tests/baselines/reference/assignFromBooleanInterface2.types b/tests/baselines/reference/assignFromBooleanInterface2.types index 7472fec421a..758b160f6e3 100644 --- a/tests/baselines/reference/assignFromBooleanInterface2.types +++ b/tests/baselines/reference/assignFromBooleanInterface2.types @@ -1,14 +1,10 @@ === tests/cases/conformance/types/primitives/boolean/assignFromBooleanInterface2.ts === interface Boolean { ->Boolean : Boolean - doStuff(): string; >doStuff : () => string } interface NotBoolean { ->NotBoolean : NotBoolean - doStuff(): string; >doStuff : () => string } @@ -19,11 +15,9 @@ var x = true; var a: Boolean; >a : Boolean ->Boolean : Boolean var b: NotBoolean; >b : NotBoolean ->NotBoolean : NotBoolean a = x; >a = x : true diff --git a/tests/baselines/reference/assignFromNumberInterface.types b/tests/baselines/reference/assignFromNumberInterface.types index d37023d8a53..98d5b78edab 100644 --- a/tests/baselines/reference/assignFromNumberInterface.types +++ b/tests/baselines/reference/assignFromNumberInterface.types @@ -5,7 +5,6 @@ var x = 1; var a: Number; >a : Number ->Number : Number x = a; >x = a : Number diff --git a/tests/baselines/reference/assignFromNumberInterface2.types b/tests/baselines/reference/assignFromNumberInterface2.types index d2c4fc04658..01a293f3a76 100644 --- a/tests/baselines/reference/assignFromNumberInterface2.types +++ b/tests/baselines/reference/assignFromNumberInterface2.types @@ -1,14 +1,10 @@ === tests/cases/conformance/types/primitives/number/assignFromNumberInterface2.ts === interface Number { ->Number : Number - doStuff(): string; >doStuff : () => string } interface NotNumber { ->NotNumber : NotNumber - toString(radix?: number): string; >toString : (radix?: number) => string >radix : number @@ -38,11 +34,9 @@ var x = 1; var a: Number; >a : Number ->Number : Number var b: NotNumber; >b : NotNumber ->NotNumber : NotNumber a = x; >a = x : number diff --git a/tests/baselines/reference/assignFromStringInterface.types b/tests/baselines/reference/assignFromStringInterface.types index 07c2433e586..5c5c2f319b6 100644 --- a/tests/baselines/reference/assignFromStringInterface.types +++ b/tests/baselines/reference/assignFromStringInterface.types @@ -5,7 +5,6 @@ var x = ''; var a: String; >a : String ->String : String x = a; >x = a : String diff --git a/tests/baselines/reference/assignFromStringInterface2.types b/tests/baselines/reference/assignFromStringInterface2.types index 8ec212babce..103fea90217 100644 --- a/tests/baselines/reference/assignFromStringInterface2.types +++ b/tests/baselines/reference/assignFromStringInterface2.types @@ -1,14 +1,10 @@ === tests/cases/conformance/types/primitives/string/assignFromStringInterface2.ts === interface String { ->String : String - doStuff(): string; >doStuff : () => string } interface NotString { ->NotString : NotString - doStuff(): string; >doStuff : () => string @@ -48,7 +44,6 @@ interface NotString { match(regexp: RegExp): string[]; >match : { (regexp: string): string[]; (regexp: RegExp): string[]; } >regexp : RegExp ->RegExp : RegExp replace(searchValue: string, replaceValue: string): string; >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; } @@ -65,13 +60,11 @@ interface NotString { replace(searchValue: RegExp, replaceValue: string): string; >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; } >searchValue : RegExp ->RegExp : RegExp >replaceValue : string replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; } >searchValue : RegExp ->RegExp : RegExp >replaceValue : (substring: string, ...args: any[]) => string >substring : string >args : any[] @@ -83,7 +76,6 @@ interface NotString { search(regexp: RegExp): number; >search : { (regexp: string): number; (regexp: RegExp): number; } >regexp : RegExp ->RegExp : RegExp slice(start?: number, end?: number): string; >slice : (start?: number, end?: number) => string @@ -98,7 +90,6 @@ interface NotString { split(separator: RegExp, limit?: number): string[]; >split : { (separator: string, limit?: number): string[]; (separator: RegExp, limit?: number): string[]; } >separator : RegExp ->RegExp : RegExp >limit : number substring(start: number, end?: number): string; @@ -142,11 +133,9 @@ var x = ''; var a: String; >a : String ->String : String var b: NotString; >b : NotString ->NotString : NotString a = x; >a = x : string diff --git a/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.types b/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.types index bff7fe98da4..9011a098363 100644 --- a/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.types +++ b/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.types @@ -1,8 +1,5 @@ === tests/cases/compiler/assignLambdaToNominalSubtypeOfFunction.ts === interface IResultCallback extends Function { ->IResultCallback : IResultCallback ->Function : Function - x: number; >x : number } @@ -10,7 +7,6 @@ interface IResultCallback extends Function { function fn(cb: IResultCallback) { } >fn : (cb: IResultCallback) => void >cb : IResultCallback ->IResultCallback : IResultCallback fn((a, b) => true); >fn((a, b) => true) : void diff --git a/tests/baselines/reference/assignToFn.types b/tests/baselines/reference/assignToFn.types index 927f2261fcf..954eaa8b23d 100644 --- a/tests/baselines/reference/assignToFn.types +++ b/tests/baselines/reference/assignToFn.types @@ -3,8 +3,6 @@ module M { >M : typeof M interface I { ->I : I - f(n:number):boolean; >f : (n: number) => boolean >n : number @@ -12,7 +10,6 @@ module M { var x:I={ f:function(n) { return true; } }; >x : I ->I : I >{ f:function(n) { return true; } } : { f: (n: number) => true; } >f : (n: number) => true >function(n) { return true; } : (n: number) => true diff --git a/tests/baselines/reference/assignToModule.types b/tests/baselines/reference/assignToModule.types index 887e3d2c2b1..afbb933e9d1 100644 --- a/tests/baselines/reference/assignToModule.types +++ b/tests/baselines/reference/assignToModule.types @@ -1,7 +1,5 @@ === tests/cases/compiler/assignToModule.ts === module A {} ->A : any - A = undefined; // invalid LHS >A = undefined : undefined >A : any diff --git a/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.types b/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.types index 7ea260f8c15..a71c447b5c6 100644 --- a/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.types +++ b/tests/baselines/reference/assignToObjectTypeWithPrototypeProperty.types @@ -4,7 +4,6 @@ class XEvent {} var p: XEvent = XEvent.prototype; >p : XEvent ->XEvent : XEvent >XEvent.prototype : XEvent >XEvent : typeof XEvent >prototype : XEvent @@ -12,6 +11,5 @@ var p: XEvent = XEvent.prototype; var x: {prototype: XEvent} = XEvent; >x : { prototype: XEvent; } >prototype : XEvent ->XEvent : XEvent >XEvent : typeof XEvent diff --git a/tests/baselines/reference/assigningFromObjectToAnythingElse.types b/tests/baselines/reference/assigningFromObjectToAnythingElse.types index 2b31b0c7673..65e7012ffc3 100644 --- a/tests/baselines/reference/assigningFromObjectToAnythingElse.types +++ b/tests/baselines/reference/assigningFromObjectToAnythingElse.types @@ -1,11 +1,9 @@ === tests/cases/compiler/assigningFromObjectToAnythingElse.ts === var x: Object; >x : Object ->Object : Object var y: RegExp; >y : RegExp ->RegExp : RegExp y = x; >y = x : Object @@ -14,27 +12,22 @@ y = x; var a: String = Object.create(""); >a : String ->String : String >Object.create("") : any >Object.create : { (o: object): any; (o: object, properties: PropertyDescriptorMap & ThisType): any; } >Object : ObjectConstructor >create : { (o: object): any; (o: object, properties: PropertyDescriptorMap & ThisType): any; } ->Object : Object >"" : "" var c: String = Object.create(1); >c : String ->String : String >Object.create(1) : any >Object.create : { (o: object): any; (o: object, properties: PropertyDescriptorMap & ThisType): any; } >Object : ObjectConstructor >create : { (o: object): any; (o: object, properties: PropertyDescriptorMap & ThisType): any; } ->Number : Number >1 : 1 var w: Error = new Object(); >w : Error ->Error : Error >new Object() : Object >Object : ObjectConstructor diff --git a/tests/baselines/reference/assignmentCompatForEnums.types b/tests/baselines/reference/assignmentCompatForEnums.types index dde41372e11..8d2fdf0a8b3 100644 --- a/tests/baselines/reference/assignmentCompatForEnums.types +++ b/tests/baselines/reference/assignmentCompatForEnums.types @@ -11,7 +11,6 @@ var list = {}; function returnType(): TokenType { return null; } >returnType : () => TokenType ->TokenType : TokenType >null : null function foo() { @@ -24,7 +23,6 @@ function foo() { var x: TokenType = list['one']; >x : TokenType ->TokenType : TokenType >list['one'] : any >list : {} >'one' : "one" diff --git a/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.types b/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.types index 57371756706..40ea57b597a 100644 --- a/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.types +++ b/tests/baselines/reference/assignmentCompatInterfaceWithStringIndexSignature.types @@ -1,17 +1,12 @@ === tests/cases/compiler/assignmentCompatInterfaceWithStringIndexSignature.ts === interface IHandler { ->IHandler : IHandler - (e): boolean; >e : any } interface IHandlerMap { ->IHandlerMap : IHandlerMap - [type: string]: IHandler; >type : string ->IHandler : IHandler } class Foo { @@ -24,7 +19,6 @@ class Foo { function Biz(map: IHandlerMap) { } >Biz : (map: IHandlerMap) => void >map : IHandlerMap ->IHandlerMap : IHandlerMap Biz(new Foo()); >Biz(new Foo()) : void diff --git a/tests/baselines/reference/assignmentCompatOnNew.types b/tests/baselines/reference/assignmentCompatOnNew.types index 19994e61df8..a2c9500044a 100644 --- a/tests/baselines/reference/assignmentCompatOnNew.types +++ b/tests/baselines/reference/assignmentCompatOnNew.types @@ -5,7 +5,6 @@ class Foo{}; function bar(x: {new(): Foo;}){} >bar : (x: new () => Foo) => void >x : new () => Foo ->Foo : Foo bar(Foo); // Error, but should be allowed >bar(Foo) : void diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures.types b/tests/baselines/reference/assignmentCompatWithCallSignatures.types index f7faedf91e3..3d11a665035 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures.types +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures.types @@ -2,14 +2,11 @@ // void returning call signatures can be assigned a non-void returning call signature that otherwise matches interface T { ->T : T - (x: number): void; >x : number } var t: T; >t : T ->T : T var a: { (x: number): void }; >a : (x: number) => void @@ -26,14 +23,11 @@ a = t; >t : T interface S { ->S : S - (x: number): string; >x : number } var s: S; >s : S ->S : S var a2: { (x: number): string }; >a2 : (x: number) => string @@ -63,9 +57,7 @@ t = (x: T) => 1; >t = (x: T) => 1 : (x: T) => number >t : T >(x: T) => 1 : (x: T) => number ->T : T >x : T ->T : T >1 : 1 t = () => 1; @@ -85,9 +77,7 @@ a = (x: T) => 1; >a = (x: T) => 1 : (x: T) => number >a : (x: number) => void >(x: T) => 1 : (x: T) => number ->T : T >x : T ->T : T >1 : 1 a = () => 1; @@ -104,14 +94,11 @@ a = function (x: number) { return ''; } >'' : "" interface S2 { ->S2 : S2 - (x: string): void; >x : string } var s2: S2; >s2 : S2 ->S2 : S2 var a3: { (x: string): void }; >a3 : (x: string) => void diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures2.types b/tests/baselines/reference/assignmentCompatWithCallSignatures2.types index f20b03dbcce..e828d9170d6 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures2.types +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures2.types @@ -2,15 +2,12 @@ // void returning call signatures can be assigned a non-void returning call signature that otherwise matches interface T { ->T : T - f(x: number): void; >f : (x: number) => void >x : number } var t: T; >t : T ->T : T var a: { f(x: number): void }; >a : { f(x: number): void; } @@ -28,15 +25,12 @@ a = t; >t : T interface S { ->S : S - f(x: number): string; >f : (x: number) => string >x : number } var s: S; >s : S ->S : S var a2: { f(x: number): string }; >a2 : { f(x: number): string; } @@ -77,9 +71,7 @@ t = { f: (x:T) => 1 }; >{ f: (x:T) => 1 } : { f: (x: T) => number; } >f : (x: T) => number >(x:T) => 1 : (x: T) => number ->T : T >x : T ->T : T >1 : 1 t = { f: function f() { return 1 } }; @@ -113,9 +105,7 @@ a = { f: (x: T) => 1 }; >{ f: (x: T) => 1 } : { f: (x: T) => number; } >f : (x: T) => number >(x: T) => 1 : (x: T) => number ->T : T >x : T ->T : T >1 : 1 a = { f: function (x: number) { return ''; } } @@ -155,15 +145,12 @@ a = function (x: number) { return ''; } >'' : "" interface S2 { ->S2 : S2 - f(x: string): void; >f : (x: string) => void >x : string } var s2: S2; >s2 : S2 ->S2 : S2 var a3: { f(x: string): void }; >a3 : { f(x: string): void; } diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures3.types b/tests/baselines/reference/assignmentCompatWithCallSignatures3.types index 72cceae84ff..1301a2e2829 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures3.types +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures3.types @@ -46,53 +46,32 @@ var a6: (x: (arg: Base) => Derived) => Base; >a6 : (x: (arg: Base) => Derived) => Base >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived ->Base : Base var a7: (x: (arg: Base) => Derived) => (r: Base) => Derived; >a7 : (x: (arg: Base) => Derived) => (r: Base) => Derived >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived : Derived var a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; >a8 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >y : (arg2: Base) => Derived >arg2 : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived : Derived var a9: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; >a9 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >y : (arg2: Base) => Derived >arg2 : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived : Derived var a10: (...x: Derived[]) => Derived; >a10 : (...x: Derived[]) => Derived >x : Derived[] ->Derived : Derived ->Derived : Derived var a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; >a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base @@ -101,36 +80,22 @@ var a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; >y : { foo: string; bar: string; } >foo : string >bar : string ->Base : Base var a12: (x: Array, y: Array) => Array; >a12 : (x: Base[], y: Derived2[]) => Derived[] >x : Base[] ->Array : T[] ->Base : Base >y : Derived2[] ->Array : T[] ->Derived2 : Derived2 ->Array : T[] ->Derived : Derived var a13: (x: Array, y: Array) => Array; >a13 : (x: Base[], y: Derived[]) => Derived[] >x : Base[] ->Array : T[] ->Base : Base >y : Derived[] ->Array : T[] ->Derived : Derived ->Array : T[] ->Derived : Derived var a14: (x: { a: string; b: number }) => Object; >a14 : (x: { a: string; b: number; }) => Object >x : { a: string; b: number; } >a : string >b : number ->Object : Object var a15: { >a15 : { (x: number): number[]; (x: string): string[]; } @@ -145,16 +110,10 @@ var a16: { >a16 : { (x: T): number[]; (x: U): number[]; } (x: T): number[]; ->T : T ->Derived : Derived >x : T ->T : T (x: U): number[]; ->U : U ->Base : Base >x : U ->U : U } var a17: { >a17 : { (x: (a: number) => number): number[]; (x: (a: string) => string): string[]; } @@ -189,18 +148,13 @@ var a18: { (a: Date): Date; >a : Date ->Date : Date ->Date : Date }): any[]; } var b: (x: T) => T[]; >b : (x: T) => T[] ->T : T >x : T ->T : T ->T : T a = b; // ok >a = b : (x: T) => T[] @@ -214,9 +168,7 @@ b = a; // ok var b2: (x: T) => string[]; >b2 : (x: T) => string[] ->T : T >x : T ->T : T a2 = b2; // ok >a2 = b2 : (x: T) => string[] @@ -230,10 +182,7 @@ b2 = a2; // ok var b3: (x: T) => T; >b3 : (x: T) => T ->T : T >x : T ->T : T ->T : T a3 = b3; // ok >a3 = b3 : (x: T) => T @@ -247,13 +196,8 @@ b3 = a3; // ok var b4: (x: T, y: U) => T; >b4 : (x: T, y: U) => T ->T : T ->U : U >x : T ->T : T >y : U ->U : U ->T : T a4 = b4; // ok >a4 = b4 : (x: T, y: U) => T @@ -267,13 +211,8 @@ b4 = a4; // ok var b5: (x: (arg: T) => U) => T; >b5 : (x: (arg: T) => U) => T ->T : T ->U : U >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T a5 = b5; // ok >a5 = b5 : (x: (arg: T) => U) => T @@ -287,15 +226,8 @@ b5 = a5; // ok var b6: (x: (arg: T) => U) => T; >b6 : (x: (arg: T) => U) => T ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T a6 = b6; // ok >a6 = b6 : (x: (arg: T) => U) => T @@ -309,17 +241,9 @@ b6 = a6; // ok var b7: (x: (arg: T) => U) => (r: T) => U; >b7 : (x: (arg: T) => U) => (r: T) => U ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U >r : T ->T : T ->U : U a7 = b7; // ok >a7 = b7 : (x: (arg: T) => U) => (r: T) => U @@ -333,21 +257,11 @@ b7 = a7; // ok var b8: (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; >b8 : (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U >y : (arg2: T) => U >arg2 : T ->T : T ->U : U >r : T ->T : T ->U : U a8 = b8; // ok >a8 = b8 : (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U @@ -361,22 +275,13 @@ b8 = a8; // ok var b9: (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; >b9 : (x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U >y : (arg2: { foo: string; bing: number; }) => U >arg2 : { foo: string; bing: number; } >foo : string >bing : number ->U : U >r : T ->T : T ->U : U a9 = b9; // ok >a9 = b9 : (x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U @@ -390,11 +295,7 @@ b9 = a9; // ok var b10: (...x: T[]) => T; >b10 : (...x: T[]) => T ->T : T ->Derived : Derived >x : T[] ->T : T ->T : T a10 = b10; // ok >a10 = b10 : (...x: T[]) => T @@ -408,13 +309,8 @@ b10 = a10; // ok var b11: (x: T, y: T) => T; >b11 : (x: T, y: T) => T ->T : T ->Base : Base >x : T ->T : T >y : T ->T : T ->T : T a11 = b11; // ok >a11 = b11 : (x: T, y: T) => T @@ -428,16 +324,8 @@ b11 = a11; // ok var b12: >(x: Array, y: T) => Array; >b12 : (x: Base[], y: T) => Derived[] ->T : T ->Array : T[] ->Base : Base >x : Base[] ->Array : T[] ->Base : Base >y : T ->T : T ->Array : T[] ->Derived : Derived a12 = b12; // ok >a12 = b12 : (x: Base[], y: T) => Derived[] @@ -451,15 +339,8 @@ b12 = a12; // ok var b13: >(x: Array, y: T) => T; >b13 : (x: Base[], y: T) => T ->T : T ->Array : T[] ->Derived : Derived >x : Base[] ->Array : T[] ->Base : Base >y : T ->T : T ->T : T a13 = b13; // ok >a13 = b13 : (x: Base[], y: T) => T @@ -473,13 +354,9 @@ b13 = a13; // ok var b14: (x: { a: T; b: T }) => T; >b14 : (x: { a: T; b: T; }) => T ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T a14 = b14; // ok >a14 = b14 : (x: { a: T; b: T; }) => T @@ -493,10 +370,7 @@ b14 = a14; // ok var b15: (x: T) => T[]; >b15 : (x: T) => T[] ->T : T >x : T ->T : T ->T : T a15 = b15; // ok >a15 = b15 : (x: T) => T[] @@ -510,10 +384,7 @@ b15 = a15; // ok var b16: (x: T) => number[]; >b16 : (x: T) => number[] ->T : T ->Base : Base >x : T ->T : T a16 = b16; // ok >a16 = b16 : (x: T) => number[] @@ -527,12 +398,8 @@ b16 = a16; // ok var b17: (x: (a: T) => T) => T[]; // ok >b17 : (x: (a: T) => T) => T[] ->T : T >x : (a: T) => T >a : T ->T : T ->T : T ->T : T a17 = b17; // ok >a17 = b17 : (x: (a: T) => T) => T[] @@ -546,12 +413,8 @@ b17 = a17; // ok var b18: (x: (a: T) => T) => T[]; >b18 : (x: (a: T) => T) => T[] ->T : T >x : (a: T) => T >a : T ->T : T ->T : T ->T : T a18 = b18; // ok >a18 = b18 : (x: (a: T) => T) => T[] diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.types b/tests/baselines/reference/assignmentCompatWithCallSignatures4.types index 4e4f3a836df..351de0be4b9 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.types +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.types @@ -35,31 +35,19 @@ module Errors { >a7 : (x: (arg: Base) => Derived) => (r: Base) => Derived2 >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived2 : Derived2 var a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; >a8 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >y : (arg2: Base) => Derived >arg2 : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived : Derived var a10: (...x: Base[]) => Base; >a10 : (...x: Base[]) => Base >x : Base[] ->Base : Base ->Base : Base var a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; >a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base @@ -68,18 +56,11 @@ module Errors { >y : { foo: string; bar: string; } >foo : string >bar : string ->Base : Base var a12: (x: Array, y: Array) => Array; >a12 : (x: Base[], y: Derived2[]) => Derived[] >x : Base[] ->Array : T[] ->Base : Base >y : Derived2[] ->Array : T[] ->Derived2 : Derived2 ->Array : T[] ->Derived : Derived var a14: { >a14 : { (x: number): number[]; (x: string): string[]; } @@ -128,47 +109,27 @@ module Errors { >x : { (a: T): T; (a: T): T; } (a: T): T; ->T : T ->Derived : Derived >a : T ->T : T ->T : T (a: T): T; ->T : T ->Base : Base >a : T ->T : T ->T : T }): any[]; (x: { >x : { (a: T): T; (a: T): T; } (a: T): T; ->T : T ->Derived2 : Derived2 >a : T ->T : T ->T : T (a: T): T; ->T : T ->Base : Base >a : T ->T : T ->T : T }): any[]; }; var b2: (x: T) => U[]; >b2 : (x: T) => U[] ->T : T ->U : U >x : T ->T : T ->U : U a2 = b2; >a2 = b2 : (x: T) => U[] @@ -182,19 +143,9 @@ module Errors { var b7: (x: (arg: T) => U) => (r: T) => V; >b7 : (x: (arg: T) => U) => (r: T) => V ->T : T ->Base : Base ->U : U ->Derived : Derived ->V : V ->Derived2 : Derived2 >x : (arg: T) => U >arg : T ->T : T ->U : U >r : T ->T : T ->V : V a7 = b7; >a7 = b7 : (x: (arg: T) => U) => (r: T) => V @@ -208,21 +159,12 @@ module Errors { var b8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; >b8 : (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U >y : (arg2: { foo: number; }) => U >arg2 : { foo: number; } >foo : number ->U : U >r : T ->T : T ->U : U a8 = b8; // error, { foo: number } and Base are incompatible >a8 = b8 : (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U @@ -237,11 +179,7 @@ module Errors { var b10: (...x: T[]) => T; >b10 : (...x: T[]) => T ->T : T ->Derived : Derived >x : T[] ->T : T ->T : T a10 = b10; >a10 = b10 : (...x: T[]) => T @@ -255,13 +193,8 @@ module Errors { var b11: (x: T, y: T) => T; >b11 : (x: T, y: T) => T ->T : T ->Derived : Derived >x : T ->T : T >y : T ->T : T ->T : T a11 = b11; >a11 = b11 : (x: T, y: T) => T @@ -275,16 +208,8 @@ module Errors { var b12: >(x: Array, y: Array) => T; >b12 : (x: Base[], y: Base[]) => T ->T : T ->Array : T[] ->Derived2 : Derived2 >x : Base[] ->Array : T[] ->Base : Base >y : Base[] ->Array : T[] ->Base : Base ->T : T a12 = b12; >a12 = b12 : (x: Base[], y: Base[]) => T @@ -298,13 +223,9 @@ module Errors { var b15: (x: { a: T; b: T }) => T; >b15 : (x: { a: T; b: T; }) => T ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T a15 = b15; >a15 = b15 : (x: { a: T; b: T; }) => T @@ -318,13 +239,9 @@ module Errors { var b15a: (x: { a: T; b: T }) => number; >b15a : (x: { a: T; b: T; }) => number ->T : T ->Base : Base >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T a15 = b15a; >a15 = b15a : (x: { a: T; b: T; }) => number @@ -338,12 +255,8 @@ module Errors { var b16: (x: (a: T) => T) => T[]; >b16 : (x: (a: T) => T) => T[] ->T : T >x : (a: T) => T >a : T ->T : T ->T : T ->T : T a16 = b16; >a16 = b16 : (x: (a: T) => T) => T[] @@ -357,11 +270,8 @@ module Errors { var b17: (x: (a: T) => T) => any[]; >b17 : (x: (a: T) => T) => any[] ->T : T >x : (a: T) => T >a : T ->T : T ->T : T a17 = b17; >a17 = b17 : (x: (a: T) => T) => any[] @@ -380,16 +290,11 @@ module Errors { // target type has generic call signature var a2: (x: T) => T[]; >a2 : (x: T) => T[] ->T : T >x : T ->T : T ->T : T var b2: (x: T) => string[]; >b2 : (x: T) => string[] ->T : T >x : T ->T : T a2 = b2; >a2 = b2 : (x: T) => string[] @@ -404,16 +309,11 @@ module Errors { // target type has generic call signature var a3: (x: T) => string[]; >a3 : (x: T) => string[] ->T : T >x : T ->T : T var b3: (x: T) => T[]; >b3 : (x: T) => T[] ->T : T >x : T ->T : T ->T : T a3 = b3; >a3 = b3 : (x: T) => T[] diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures5.types b/tests/baselines/reference/assignmentCompatWithCallSignatures5.types index 2652a2a4e68..5492c477254 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures5.types +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures5.types @@ -22,106 +22,61 @@ class OtherDerived extends Base { bing: string; } var a: (x: T) => T[]; >a : (x: T) => T[] ->T : T >x : T ->T : T ->T : T var a2: (x: T) => string[]; >a2 : (x: T) => string[] ->T : T >x : T ->T : T var a3: (x: T) => void; >a3 : (x: T) => void ->T : T >x : T ->T : T var a4: (x: T, y: U) => string; >a4 : (x: T, y: U) => string ->T : T ->U : U >x : T ->T : T >y : U ->U : U var a5: (x: (arg: T) => U) => T; >a5 : (x: (arg: T) => U) => T ->T : T ->U : U >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T var a6: (x: (arg: T) => Derived) => T; >a6 : (x: (arg: T) => Derived) => T ->T : T ->Base : Base >x : (arg: T) => Derived >arg : T ->T : T ->Derived : Derived ->T : T var a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; >a11 : (x: { foo: T; }, y: { foo: T; bar: T; }) => Base ->T : T >x : { foo: T; } >foo : T ->T : T >y : { foo: T; bar: T; } >foo : T ->T : T >bar : T ->T : T ->Base : Base var a15: (x: { a: T; b: T }) => T[]; >a15 : (x: { a: T; b: T; }) => T[] ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T var a16: (x: { a: T; b: T }) => T[]; >a16 : (x: { a: T; b: T; }) => T[] ->T : T ->Base : Base >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T var a17: { >a17 : { (x: (a: T) => T): T[]; (x: (a: T) => T): T[]; } (x: (a: T) => T): T[]; ->T : T ->Derived : Derived >x : (a: T) => T >a : T ->T : T ->T : T ->T : T (x: (a: T) => T): T[]; ->T : T ->Base : Base >x : (a: T) => T >a : T ->T : T ->T : T ->T : T }; var a18: { @@ -131,46 +86,27 @@ var a18: { >x : { (a: T): T; (a: T): T; } (a: T): T; ->T : T ->Derived : Derived >a : T ->T : T ->T : T (a: T): T; ->T : T ->Base : Base >a : T ->T : T ->T : T }): any[]; (x: { >x : { (a: T): T; (a: T): T; } (a: T): T; ->T : T ->Derived2 : Derived2 >a : T ->T : T ->T : T (a: T): T; ->T : T ->Base : Base >a : T ->T : T ->T : T }): any[]; }; var b: (x: T) => T[]; >b : (x: T) => T[] ->T : T >x : T ->T : T ->T : T a = b; // ok >a = b : (x: T) => T[] @@ -184,9 +120,7 @@ b = a; // ok var b2: (x: T) => string[]; >b2 : (x: T) => string[] ->T : T >x : T ->T : T a2 = b2; // ok >a2 = b2 : (x: T) => string[] @@ -200,10 +134,7 @@ b2 = a2; // ok var b3: (x: T) => T; >b3 : (x: T) => T ->T : T >x : T ->T : T ->T : T a3 = b3; // ok >a3 = b3 : (x: T) => T @@ -217,12 +148,8 @@ b3 = a3; // ok var b4: (x: T, y: U) => string; >b4 : (x: T, y: U) => string ->T : T ->U : U >x : T ->T : T >y : U ->U : U a4 = b4; // ok >a4 = b4 : (x: T, y: U) => string @@ -236,13 +163,8 @@ b4 = a4; // ok var b5: (x: (arg: T) => U) => T; >b5 : (x: (arg: T) => U) => T ->T : T ->U : U >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T a5 = b5; // ok >a5 = b5 : (x: (arg: T) => U) => T @@ -256,15 +178,8 @@ b5 = a5; // ok var b6: (x: (arg: T) => U) => T; >b6 : (x: (arg: T) => U) => T ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T a6 = b6; // ok >a6 = b6 : (x: (arg: T) => U) => T @@ -278,17 +193,11 @@ b6 = a6; // ok var b11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; >b11 : (x: { foo: T; }, y: { foo: U; bar: U; }) => Base ->T : T ->U : U >x : { foo: T; } >foo : T ->T : T >y : { foo: U; bar: U; } >foo : U ->U : U >bar : U ->U : U ->Base : Base a11 = b11; // ok >a11 = b11 : (x: { foo: T; }, y: { foo: U; bar: U; }) => Base @@ -302,14 +211,9 @@ b11 = a11; // ok var b15: (x: { a: U; b: V; }) => U[]; >b15 : (x: { a: U; b: V; }) => U[] ->U : U ->V : V >x : { a: U; b: V; } >a : U ->U : U >b : V ->V : V ->U : U a15 = b15; // ok, T = U, T = V >a15 = b15 : (x: { a: U; b: V; }) => U[] @@ -323,13 +227,9 @@ b15 = a15; // ok var b16: (x: { a: T; b: T }) => T[]; >b16 : (x: { a: T; b: T; }) => T[] ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T a15 = b16; // ok >a15 = b16 : (x: { a: T; b: T; }) => T[] @@ -343,12 +243,8 @@ b15 = a16; // ok var b17: (x: (a: T) => T) => T[]; >b17 : (x: (a: T) => T) => T[] ->T : T >x : (a: T) => T >a : T ->T : T ->T : T ->T : T a17 = b17; // ok >a17 = b17 : (x: (a: T) => T) => T[] @@ -363,10 +259,7 @@ b17 = a17; // ok var b18: (x: (a: T) => T) => any[]; >b18 : (x: (a: T) => T) => any[] >x : (a: T) => T ->T : T >a : T ->T : T ->T : T a18 = b18; // ok >a18 = b18 : (x: (a: T) => T) => any[] diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures6.types b/tests/baselines/reference/assignmentCompatWithCallSignatures6.types index b45f3357942..aa7a3839f2a 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures6.types +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures6.types @@ -21,101 +21,60 @@ class OtherDerived extends Base { bing: string; } >bing : string interface A { ->A : A - a: (x: T) => T[]; >a : (x: T) => T[] ->T : T >x : T ->T : T ->T : T a2: (x: T) => string[]; >a2 : (x: T) => string[] ->T : T >x : T ->T : T a3: (x: T) => void; >a3 : (x: T) => void ->T : T >x : T ->T : T a4: (x: T, y: U) => string; >a4 : (x: T, y: U) => string ->T : T ->U : U >x : T ->T : T >y : U ->U : U a5: (x: (arg: T) => U) => T; >a5 : (x: (arg: T) => U) => T ->T : T ->U : U >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T a6: (x: (arg: T) => Derived) => T; >a6 : (x: (arg: T) => Derived) => T ->T : T ->Base : Base >x : (arg: T) => Derived >arg : T ->T : T ->Derived : Derived ->T : T a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; >a11 : (x: { foo: T; }, y: { foo: T; bar: T; }) => Base ->T : T >x : { foo: T; } >foo : T ->T : T >y : { foo: T; bar: T; } >foo : T ->T : T >bar : T ->T : T ->Base : Base a15: (x: { a: T; b: T }) => T[]; >a15 : (x: { a: T; b: T; }) => T[] ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T a16: (x: { a: T; b: T }) => T[]; >a16 : (x: { a: T; b: T; }) => T[] ->T : T ->Base : Base >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T } var x: A; >x : A ->A : A var b: (x: T) => T[]; >b : (x: T) => T[] ->T : T >x : T ->T : T ->T : T x.a = b; >x.a = b : (x: T) => T[] @@ -133,9 +92,7 @@ b = x.a; var b2: (x: T) => string[]; >b2 : (x: T) => string[] ->T : T >x : T ->T : T x.a2 = b2; >x.a2 = b2 : (x: T) => string[] @@ -153,10 +110,7 @@ b2 = x.a2; var b3: (x: T) => T; >b3 : (x: T) => T ->T : T >x : T ->T : T ->T : T x.a3 = b3; >x.a3 = b3 : (x: T) => T @@ -174,12 +128,8 @@ b3 = x.a3; var b4: (x: T, y: U) => string; >b4 : (x: T, y: U) => string ->T : T ->U : U >x : T ->T : T >y : U ->U : U x.a4 = b4; >x.a4 = b4 : (x: T, y: U) => string @@ -197,13 +147,8 @@ b4 = x.a4; var b5: (x: (arg: T) => U) => T; >b5 : (x: (arg: T) => U) => T ->T : T ->U : U >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T x.a5 = b5; >x.a5 = b5 : (x: (arg: T) => U) => T @@ -221,17 +166,11 @@ b5 = x.a5; var b11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; >b11 : (x: { foo: T; }, y: { foo: U; bar: U; }) => Base ->T : T ->U : U >x : { foo: T; } >foo : T ->T : T >y : { foo: U; bar: U; } >foo : U ->U : U >bar : U ->U : U ->Base : Base x.a11 = b11; >x.a11 = b11 : (x: { foo: T; }, y: { foo: U; bar: U; }) => Base @@ -249,13 +188,9 @@ b11 = x.a11; var b16: (x: { a: T; b: T }) => T[]; >b16 : (x: { a: T; b: T; }) => T[] ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T x.a16 = b16; >x.a16 = b16 : (x: { a: T; b: T; }) => T[] diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.types b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.types index 1bb87d3255f..95ca5cb4dc3 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.types +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.types @@ -2,8 +2,6 @@ // call signatures in derived types must have the same or fewer optional parameters as the base type interface Base { ->Base : Base - a: () => number; >a : () => number @@ -32,7 +30,6 @@ interface Base { } var b: Base; >b : Base ->Base : Base var a: () => number; >a : () => number diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.types b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.types index a2c726527cb..44719238f82 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.types +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.types @@ -2,8 +2,6 @@ // call signatures in derived types must have the same or fewer optional parameters as the target for assignment interface Base { ->Base : Base - a: (...args: number[]) => number; >a : (...args: number[]) => number >args : number[] diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures.types b/tests/baselines/reference/assignmentCompatWithConstructSignatures.types index 038988807e5..e331da983af 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures.types +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures.types @@ -2,14 +2,11 @@ // void returning call signatures can be assigned a non-void returning call signature that otherwise matches interface T { ->T : T - new (x: number): void; >x : number } var t: T; >t : T ->T : T var a: { new (x: number): void }; >a : new (x: number) => void @@ -26,14 +23,11 @@ a = t; >t : T interface S { ->S : S - new (x: number): string; >x : number } var s: S; >s : S ->S : S var a2: { new (x: number): string }; >a2 : new (x: number) => string @@ -60,14 +54,11 @@ a = a2; >a2 : new (x: number) => string interface S2 { ->S2 : S2 - (x: string): void; >x : string } var s2: S2; >s2 : S2 ->S2 : S2 var a3: { (x: string): void }; >a3 : (x: string) => void diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.types b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.types index f797dcf83fa..08b45447a05 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.types +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.types @@ -2,15 +2,12 @@ // void returning call signatures can be assigned a non-void returning call signature that otherwise matches interface T { ->T : T - f: new (x: number) => void; >f : new (x: number) => void >x : number } var t: T; >t : T ->T : T var a: { f: new (x: number) => void }; >a : { f: new (x: number) => void; } @@ -28,15 +25,12 @@ a = t; >t : T interface S { ->S : S - f: new (x: number) => string; >f : new (x: number) => string >x : number } var s: S; >s : S ->S : S var a2: { f: new (x: number) => string }; >a2 : { f: new (x: number) => string; } @@ -91,15 +85,12 @@ a = function (x: number) { return ''; } >'' : "" interface S2 { ->S2 : S2 - f(x: string): void; >f : (x: string) => void >x : string } var s2: S2; >s2 : S2 ->S2 : S2 var a3: { f(x: string): void }; >a3 : { f(x: string): void; } diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.types b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.types index 807f31b0e6e..ead3b46ea33 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.types +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.types @@ -46,53 +46,32 @@ var a6: new (x: (arg: Base) => Derived) => Base; >a6 : new (x: (arg: Base) => Derived) => Base >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived ->Base : Base var a7: new (x: (arg: Base) => Derived) => (r: Base) => Derived; >a7 : new (x: (arg: Base) => Derived) => (r: Base) => Derived >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived : Derived var a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; >a8 : new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >y : (arg2: Base) => Derived >arg2 : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived : Derived var a9: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; >a9 : new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >y : (arg2: Base) => Derived >arg2 : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived : Derived var a10: new (...x: Derived[]) => Derived; >a10 : new (...x: Derived[]) => Derived >x : Derived[] ->Derived : Derived ->Derived : Derived var a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; >a11 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base @@ -101,36 +80,22 @@ var a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; >y : { foo: string; bar: string; } >foo : string >bar : string ->Base : Base var a12: new (x: Array, y: Array) => Array; >a12 : new (x: Base[], y: Derived2[]) => Derived[] >x : Base[] ->Array : T[] ->Base : Base >y : Derived2[] ->Array : T[] ->Derived2 : Derived2 ->Array : T[] ->Derived : Derived var a13: new (x: Array, y: Array) => Array; >a13 : new (x: Base[], y: Derived[]) => Derived[] >x : Base[] ->Array : T[] ->Base : Base >y : Derived[] ->Array : T[] ->Derived : Derived ->Array : T[] ->Derived : Derived var a14: new (x: { a: string; b: number }) => Object; >a14 : new (x: { a: string; b: number; }) => Object >x : { a: string; b: number; } >a : string >b : number ->Object : Object var a15: { >a15 : { new (x: number): number[]; new (x: string): string[]; } @@ -145,16 +110,10 @@ var a16: { >a16 : { new (x: T): number[]; new (x: U): number[]; } new (x: T): number[]; ->T : T ->Derived : Derived >x : T ->T : T new (x: U): number[]; ->U : U ->Base : Base >x : U ->U : U } var a17: { >a17 : { new (x: new (a: number) => number): number[]; new (x: new (a: string) => string): string[]; } @@ -189,18 +148,13 @@ var a18: { new (a: Date): Date; >a : Date ->Date : Date ->Date : Date }): any[]; } var b: new (x: T) => T[]; >b : new (x: T) => T[] ->T : T >x : T ->T : T ->T : T a = b; // ok >a = b : new (x: T) => T[] @@ -214,9 +168,7 @@ b = a; // ok var b2: new (x: T) => string[]; >b2 : new (x: T) => string[] ->T : T >x : T ->T : T a2 = b2; // ok >a2 = b2 : new (x: T) => string[] @@ -230,10 +182,7 @@ b2 = a2; // ok var b3: new (x: T) => T; >b3 : new (x: T) => T ->T : T >x : T ->T : T ->T : T a3 = b3; // ok >a3 = b3 : new (x: T) => T @@ -247,13 +196,8 @@ b3 = a3; // ok var b4: new (x: T, y: U) => T; >b4 : new (x: T, y: U) => T ->T : T ->U : U >x : T ->T : T >y : U ->U : U ->T : T a4 = b4; // ok >a4 = b4 : new (x: T, y: U) => T @@ -267,13 +211,8 @@ b4 = a4; // ok var b5: new (x: (arg: T) => U) => T; >b5 : new (x: (arg: T) => U) => T ->T : T ->U : U >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T a5 = b5; // ok >a5 = b5 : new (x: (arg: T) => U) => T @@ -287,15 +226,8 @@ b5 = a5; // ok var b6: new (x: (arg: T) => U) => T; >b6 : new (x: (arg: T) => U) => T ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T a6 = b6; // ok >a6 = b6 : new (x: (arg: T) => U) => T @@ -309,17 +241,9 @@ b6 = a6; // ok var b7: new (x: (arg: T) => U) => (r: T) => U; >b7 : new (x: (arg: T) => U) => (r: T) => U ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U >r : T ->T : T ->U : U a7 = b7; // ok >a7 = b7 : new (x: (arg: T) => U) => (r: T) => U @@ -333,21 +257,11 @@ b7 = a7; // ok var b8: new (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; >b8 : new (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U >y : (arg2: T) => U >arg2 : T ->T : T ->U : U >r : T ->T : T ->U : U a8 = b8; // ok >a8 = b8 : new (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U @@ -361,22 +275,13 @@ b8 = a8; // ok var b9: new (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; >b9 : new (x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U >y : (arg2: { foo: string; bing: number; }) => U >arg2 : { foo: string; bing: number; } >foo : string >bing : number ->U : U >r : T ->T : T ->U : U a9 = b9; // ok >a9 = b9 : new (x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U @@ -390,11 +295,7 @@ b9 = a9; // ok var b10: new (...x: T[]) => T; >b10 : new (...x: T[]) => T ->T : T ->Derived : Derived >x : T[] ->T : T ->T : T a10 = b10; // ok >a10 = b10 : new (...x: T[]) => T @@ -408,13 +309,8 @@ b10 = a10; // ok var b11: new (x: T, y: T) => T; >b11 : new (x: T, y: T) => T ->T : T ->Base : Base >x : T ->T : T >y : T ->T : T ->T : T a11 = b11; // ok >a11 = b11 : new (x: T, y: T) => T @@ -428,16 +324,8 @@ b11 = a11; // ok var b12: new >(x: Array, y: T) => Array; >b12 : new (x: Base[], y: T) => Derived[] ->T : T ->Array : T[] ->Base : Base >x : Base[] ->Array : T[] ->Base : Base >y : T ->T : T ->Array : T[] ->Derived : Derived a12 = b12; // ok >a12 = b12 : new (x: Base[], y: T) => Derived[] @@ -451,15 +339,8 @@ b12 = a12; // ok var b13: new >(x: Array, y: T) => T; >b13 : new (x: Base[], y: T) => T ->T : T ->Array : T[] ->Derived : Derived >x : Base[] ->Array : T[] ->Base : Base >y : T ->T : T ->T : T a13 = b13; // ok >a13 = b13 : new (x: Base[], y: T) => T @@ -473,13 +354,9 @@ b13 = a13; // ok var b14: new (x: { a: T; b: T }) => T; >b14 : new (x: { a: T; b: T; }) => T ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T a14 = b14; // ok >a14 = b14 : new (x: { a: T; b: T; }) => T @@ -493,10 +370,7 @@ b14 = a14; // ok var b15: new (x: T) => T[]; >b15 : new (x: T) => T[] ->T : T >x : T ->T : T ->T : T a15 = b15; // ok >a15 = b15 : new (x: T) => T[] @@ -510,10 +384,7 @@ b15 = a15; // ok var b16: new (x: T) => number[]; >b16 : new (x: T) => number[] ->T : T ->Base : Base >x : T ->T : T a16 = b16; // ok >a16 = b16 : new (x: T) => number[] @@ -527,12 +398,8 @@ b16 = a16; // ok var b17: new (x: new (a: T) => T) => T[]; // ok >b17 : new (x: new (a: T) => T) => T[] ->T : T >x : new (a: T) => T >a : T ->T : T ->T : T ->T : T a17 = b17; // ok >a17 = b17 : new (x: new (a: T) => T) => T[] @@ -546,12 +413,8 @@ b17 = a17; // ok var b18: new (x: new (a: T) => T) => T[]; >b18 : new (x: new (a: T) => T) => T[] ->T : T >x : new (a: T) => T >a : T ->T : T ->T : T ->T : T a18 = b18; // ok >a18 = b18 : new (x: new (a: T) => T) => T[] diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.types b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.types index 1844e5ac657..beba928bd18 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.types +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.types @@ -35,31 +35,19 @@ module Errors { >a7 : new (x: (arg: Base) => Derived) => (r: Base) => Derived2 >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived2 : Derived2 var a8: new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; >a8 : new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >y : (arg2: Base) => Derived >arg2 : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived : Derived var a10: new (...x: Base[]) => Base; >a10 : new (...x: Base[]) => Base >x : Base[] ->Base : Base ->Base : Base var a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base; >a11 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base @@ -68,18 +56,11 @@ module Errors { >y : { foo: string; bar: string; } >foo : string >bar : string ->Base : Base var a12: new (x: Array, y: Array) => Array; >a12 : new (x: Base[], y: Derived2[]) => Derived[] >x : Base[] ->Array : T[] ->Base : Base >y : Derived2[] ->Array : T[] ->Derived2 : Derived2 ->Array : T[] ->Derived : Derived var a14: { >a14 : { new (x: number): number[]; new (x: string): string[]; } @@ -128,47 +109,27 @@ module Errors { >x : { new (a: T): T; new (a: T): T; } new (a: T): T; ->T : T ->Derived : Derived >a : T ->T : T ->T : T new (a: T): T; ->T : T ->Base : Base >a : T ->T : T ->T : T }): any[]; new (x: { >x : { new (a: T): T; new (a: T): T; } new (a: T): T; ->T : T ->Derived2 : Derived2 >a : T ->T : T ->T : T new (a: T): T; ->T : T ->Base : Base >a : T ->T : T ->T : T }): any[]; }; var b2: new (x: T) => U[]; >b2 : new (x: T) => U[] ->T : T ->U : U >x : T ->T : T ->U : U a2 = b2; // ok >a2 = b2 : new (x: T) => U[] @@ -182,19 +143,9 @@ module Errors { var b7: new (x: (arg: T) => U) => (r: T) => V; >b7 : new (x: (arg: T) => U) => (r: T) => V ->T : T ->Base : Base ->U : U ->Derived : Derived ->V : V ->Derived2 : Derived2 >x : (arg: T) => U >arg : T ->T : T ->U : U >r : T ->T : T ->V : V a7 = b7; // ok >a7 = b7 : new (x: (arg: T) => U) => (r: T) => V @@ -208,21 +159,12 @@ module Errors { var b8: new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; >b8 : new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U >y : (arg2: { foo: number; }) => U >arg2 : { foo: number; } >foo : number ->U : U >r : T ->T : T ->U : U a8 = b8; // error, type mismatch >a8 = b8 : new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U @@ -237,11 +179,7 @@ module Errors { var b10: new (...x: T[]) => T; >b10 : new (...x: T[]) => T ->T : T ->Derived : Derived >x : T[] ->T : T ->T : T a10 = b10; // ok >a10 = b10 : new (...x: T[]) => T @@ -255,13 +193,8 @@ module Errors { var b11: new (x: T, y: T) => T; >b11 : new (x: T, y: T) => T ->T : T ->Derived : Derived >x : T ->T : T >y : T ->T : T ->T : T a11 = b11; // ok >a11 = b11 : new (x: T, y: T) => T @@ -275,16 +208,8 @@ module Errors { var b12: new >(x: Array, y: Array) => T; >b12 : new (x: Base[], y: Base[]) => T ->T : T ->Array : T[] ->Derived2 : Derived2 >x : Base[] ->Array : T[] ->Base : Base >y : Base[] ->Array : T[] ->Base : Base ->T : T a12 = b12; // ok >a12 = b12 : new (x: Base[], y: Base[]) => T @@ -298,13 +223,9 @@ module Errors { var b15: new (x: { a: T; b: T }) => T; >b15 : new (x: { a: T; b: T; }) => T ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T a15 = b15; // ok >a15 = b15 : new (x: { a: T; b: T; }) => T @@ -318,13 +239,9 @@ module Errors { var b15a: new (x: { a: T; b: T }) => number; >b15a : new (x: { a: T; b: T; }) => number ->T : T ->Base : Base >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T a15 = b15a; // ok >a15 = b15a : new (x: { a: T; b: T; }) => number @@ -338,12 +255,8 @@ module Errors { var b16: new (x: (a: T) => T) => T[]; >b16 : new (x: (a: T) => T) => T[] ->T : T >x : (a: T) => T >a : T ->T : T ->T : T ->T : T a16 = b16; // error >a16 = b16 : new (x: (a: T) => T) => T[] @@ -357,11 +270,8 @@ module Errors { var b17: new (x: (a: T) => T) => any[]; >b17 : new (x: (a: T) => T) => any[] ->T : T >x : (a: T) => T >a : T ->T : T ->T : T a17 = b17; // error >a17 = b17 : new (x: (a: T) => T) => any[] @@ -380,16 +290,11 @@ module Errors { // target type has generic call signature var a2: new (x: T) => T[]; >a2 : new (x: T) => T[] ->T : T >x : T ->T : T ->T : T var b2: new (x: T) => string[]; >b2 : new (x: T) => string[] ->T : T >x : T ->T : T a2 = b2; // ok >a2 = b2 : new (x: T) => string[] @@ -404,16 +309,11 @@ module Errors { // target type has generic call signature var a3: new (x: T) => string[]; >a3 : new (x: T) => string[] ->T : T >x : T ->T : T var b3: new (x: T) => T[]; >b3 : new (x: T) => T[] ->T : T >x : T ->T : T ->T : T a3 = b3; // ok >a3 = b3 : new (x: T) => T[] diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.types b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.types index 6e6a1457a76..1190d9a75b6 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.types +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.types @@ -22,106 +22,61 @@ class OtherDerived extends Base { bing: string; } var a: new (x: T) => T[]; >a : new (x: T) => T[] ->T : T >x : T ->T : T ->T : T var a2: new (x: T) => string[]; >a2 : new (x: T) => string[] ->T : T >x : T ->T : T var a3: new (x: T) => void; >a3 : new (x: T) => void ->T : T >x : T ->T : T var a4: new (x: T, y: U) => string; >a4 : new (x: T, y: U) => string ->T : T ->U : U >x : T ->T : T >y : U ->U : U var a5: new (x: new (arg: T) => U) => T; >a5 : new (x: new (arg: T) => U) => T ->T : T ->U : U >x : new (arg: T) => U >arg : T ->T : T ->U : U ->T : T var a6: new (x: new (arg: T) => Derived) => T; >a6 : new (x: new (arg: T) => Derived) => T ->T : T ->Base : Base >x : new (arg: T) => Derived >arg : T ->T : T ->Derived : Derived ->T : T var a11: new (x: { foo: T }, y: { foo: T; bar: T }) => Base; >a11 : new (x: { foo: T; }, y: { foo: T; bar: T; }) => Base ->T : T >x : { foo: T; } >foo : T ->T : T >y : { foo: T; bar: T; } >foo : T ->T : T >bar : T ->T : T ->Base : Base var a15: new (x: { a: T; b: T }) => T[]; >a15 : new (x: { a: T; b: T; }) => T[] ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T var a16: new (x: { a: T; b: T }) => T[]; >a16 : new (x: { a: T; b: T; }) => T[] ->T : T ->Base : Base >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T var a17: { >a17 : { new (x: new (a: T) => T): T[]; new (x: new (a: T) => T): T[]; } new (x: new (a: T) => T): T[]; ->T : T ->Derived : Derived >x : new (a: T) => T >a : T ->T : T ->T : T ->T : T new (x: new (a: T) => T): T[]; ->T : T ->Base : Base >x : new (a: T) => T >a : T ->T : T ->T : T ->T : T }; var a18: { @@ -131,46 +86,27 @@ var a18: { >x : { new (a: T): T; new (a: T): T; } new (a: T): T; ->T : T ->Derived : Derived >a : T ->T : T ->T : T new (a: T): T; ->T : T ->Base : Base >a : T ->T : T ->T : T }): any[]; new (x: { >x : { new (a: T): T; new (a: T): T; } new (a: T): T; ->T : T ->Derived2 : Derived2 >a : T ->T : T ->T : T new (a: T): T; ->T : T ->Base : Base >a : T ->T : T ->T : T }): any[]; }; var b: new (x: T) => T[]; >b : new (x: T) => T[] ->T : T >x : T ->T : T ->T : T a = b; // ok >a = b : new (x: T) => T[] @@ -184,9 +120,7 @@ b = a; // ok var b2: new (x: T) => string[]; >b2 : new (x: T) => string[] ->T : T >x : T ->T : T a2 = b2; // ok >a2 = b2 : new (x: T) => string[] @@ -200,10 +134,7 @@ b2 = a2; // ok var b3: new (x: T) => T; >b3 : new (x: T) => T ->T : T >x : T ->T : T ->T : T a3 = b3; // ok >a3 = b3 : new (x: T) => T @@ -217,12 +148,8 @@ b3 = a3; // ok var b4: new (x: T, y: U) => string; >b4 : new (x: T, y: U) => string ->T : T ->U : U >x : T ->T : T >y : U ->U : U a4 = b4; // ok >a4 = b4 : new (x: T, y: U) => string @@ -236,13 +163,8 @@ b4 = a4; // ok var b5: new (x: new (arg: T) => U) => T; >b5 : new (x: new (arg: T) => U) => T ->T : T ->U : U >x : new (arg: T) => U >arg : T ->T : T ->U : U ->T : T a5 = b5; // ok >a5 = b5 : new (x: new (arg: T) => U) => T @@ -256,15 +178,8 @@ b5 = a5; // ok var b6: new (x: new (arg: T) => U) => T; >b6 : new (x: new (arg: T) => U) => T ->T : T ->Base : Base ->U : U ->Derived : Derived >x : new (arg: T) => U >arg : T ->T : T ->U : U ->T : T a6 = b6; // ok >a6 = b6 : new (x: new (arg: T) => U) => T @@ -278,17 +193,11 @@ b6 = a6; // ok var b11: new (x: { foo: T }, y: { foo: U; bar: U }) => Base; >b11 : new (x: { foo: T; }, y: { foo: U; bar: U; }) => Base ->T : T ->U : U >x : { foo: T; } >foo : T ->T : T >y : { foo: U; bar: U; } >foo : U ->U : U >bar : U ->U : U ->Base : Base a11 = b11; // ok >a11 = b11 : new (x: { foo: T; }, y: { foo: U; bar: U; }) => Base @@ -302,14 +211,9 @@ b11 = a11; // ok var b15: new (x: { a: U; b: V; }) => U[]; >b15 : new (x: { a: U; b: V; }) => U[] ->U : U ->V : V >x : { a: U; b: V; } >a : U ->U : U >b : V ->V : V ->U : U a15 = b15; // ok >a15 = b15 : new (x: { a: U; b: V; }) => U[] @@ -323,13 +227,9 @@ b15 = a15; // ok var b16: new (x: { a: T; b: T }) => T[]; >b16 : new (x: { a: T; b: T; }) => T[] ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T a15 = b16; // ok >a15 = b16 : new (x: { a: T; b: T; }) => T[] @@ -343,12 +243,8 @@ b15 = a16; // ok var b17: new (x: new (a: T) => T) => T[]; >b17 : new (x: new (a: T) => T) => T[] ->T : T >x : new (a: T) => T >a : T ->T : T ->T : T ->T : T a17 = b17; // ok >a17 = b17 : new (x: new (a: T) => T) => T[] @@ -363,10 +259,7 @@ b17 = a17; // ok var b18: new (x: new (a: T) => T) => any[]; >b18 : new (x: new (a: T) => T) => any[] >x : new (a: T) => T ->T : T >a : T ->T : T ->T : T a18 = b18; // ok >a18 = b18 : new (x: new (a: T) => T) => any[] diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.types b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.types index 74a20b9b21e..bd4992a599a 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.types +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.types @@ -21,101 +21,60 @@ class OtherDerived extends Base { bing: string; } >bing : string interface A { ->A : A - a: new (x: T) => T[]; >a : new (x: T) => T[] ->T : T >x : T ->T : T ->T : T a2: new (x: T) => string[]; >a2 : new (x: T) => string[] ->T : T >x : T ->T : T a3: new (x: T) => void; >a3 : new (x: T) => void ->T : T >x : T ->T : T a4: new (x: T, y: U) => string; >a4 : new (x: T, y: U) => string ->T : T ->U : U >x : T ->T : T >y : U ->U : U a5: new (x: (arg: T) => U) => T; >a5 : new (x: (arg: T) => U) => T ->T : T ->U : U >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T a6: new (x: (arg: T) => Derived) => T; >a6 : new (x: (arg: T) => Derived) => T ->T : T ->Base : Base >x : (arg: T) => Derived >arg : T ->T : T ->Derived : Derived ->T : T a11: new (x: { foo: T }, y: { foo: T; bar: T }) => Base; >a11 : new (x: { foo: T; }, y: { foo: T; bar: T; }) => Base ->T : T >x : { foo: T; } >foo : T ->T : T >y : { foo: T; bar: T; } >foo : T ->T : T >bar : T ->T : T ->Base : Base a15: new (x: { a: T; b: T }) => T[]; >a15 : new (x: { a: T; b: T; }) => T[] ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T a16: new (x: { a: T; b: T }) => T[]; >a16 : new (x: { a: T; b: T; }) => T[] ->T : T ->Base : Base >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T } var x: A; >x : A ->A : A var b: new (x: T) => T[]; >b : new (x: T) => T[] ->T : T >x : T ->T : T ->T : T x.a = b; >x.a = b : new (x: T) => T[] @@ -133,9 +92,7 @@ b = x.a; var b2: new (x: T) => string[]; >b2 : new (x: T) => string[] ->T : T >x : T ->T : T x.a2 = b2; >x.a2 = b2 : new (x: T) => string[] @@ -153,10 +110,7 @@ b2 = x.a2; var b3: new (x: T) => T; >b3 : new (x: T) => T ->T : T >x : T ->T : T ->T : T x.a3 = b3; >x.a3 = b3 : new (x: T) => T @@ -174,12 +128,8 @@ b3 = x.a3; var b4: new (x: T, y: U) => string; >b4 : new (x: T, y: U) => string ->T : T ->U : U >x : T ->T : T >y : U ->U : U x.a4 = b4; >x.a4 = b4 : new (x: T, y: U) => string @@ -197,13 +147,8 @@ b4 = x.a4; var b5: new (x: (arg: T) => U) => T; >b5 : new (x: (arg: T) => U) => T ->T : T ->U : U >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T x.a5 = b5; >x.a5 = b5 : new (x: (arg: T) => U) => T @@ -221,17 +166,11 @@ b5 = x.a5; var b11: new (x: { foo: T }, y: { foo: U; bar: U }) => Base; >b11 : new (x: { foo: T; }, y: { foo: U; bar: U; }) => Base ->T : T ->U : U >x : { foo: T; } >foo : T ->T : T >y : { foo: U; bar: U; } >foo : U ->U : U >bar : U ->U : U ->Base : Base x.a11 = b11; >x.a11 = b11 : new (x: { foo: T; }, y: { foo: U; bar: U; }) => Base @@ -249,13 +188,9 @@ b11 = x.a11; var b16: new (x: { a: T; b: T }) => T[]; >b16 : new (x: { a: T; b: T; }) => T[] ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T x.a16 = b16; >x.a16 = b16 : new (x: { a: T; b: T; }) => T[] diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.types b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.types index c2f13da17bf..e304d4a2076 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.types +++ b/tests/baselines/reference/assignmentCompatWithConstructSignaturesWithOptionalParameters.types @@ -2,8 +2,6 @@ // call signatures in derived types must have the same or fewer optional parameters as the base type interface Base { ->Base : Base - a: new () => number; >a : new () => number @@ -32,7 +30,6 @@ interface Base { } var b: Base; >b : Base ->Base : Base var a: new () => number; >a : new () => number diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.types b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.types index ac503fb1873..c975a7bbd7b 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.types +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures.types @@ -3,17 +3,13 @@ var f: (x: S) => void >f : (x: S) => void ->S : S >p : string >x : S ->S : S var g: (x: T[]) => void >g : (x: T[]) => void ->T : T >p : string >x : T[] ->T : T f = g; // ok >f = g : (x: T[]) => void diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.types b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.types index a5f3f06b9c8..31b075d5bce 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.types +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures2.types @@ -2,34 +2,22 @@ // some complex cases of assignment compat of generic signatures. No contextual signature instantiation interface A { ->A : A - (x: T, ...y: T[][]): void ->T : T >x : T ->T : T >y : T[][] ->T : T } interface B { ->B : B - (x: S, ...y: S[]): void ->S : S >x : S ->S : S >y : S[] ->S : S } var a: A; >a : A ->A : A var b: B; >b : B ->B : B // Both ok a = b; diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.types b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.types index 0e2eec9c02d..5130dd25e01 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.types +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures3.types @@ -2,49 +2,24 @@ // some complex cases of assignment compat of generic signatures that stress contextual signature instantiation interface I { ->I : I ->T : T ->S : S - (f: (x: T) => (y: S) => U): U ->U : U >f : (x: T) => (y: S) => U >x : T ->T : T >y : S ->S : S ->U : U ->U : U } var g: (x: T) => (y: S) => I >g : (x: T) => (y: S) => I ->T : T >x : T ->T : T ->S : S >y : S ->S : S ->I : I ->T : T ->S : S var h: (x: T) => (y: S) => { (f: (x: T) => (y: S) => U): U } >h : (x: T) => (y: S) => (f: (x: T) => (y: S) => U) => U ->T : T >x : T ->T : T ->S : S >y : S ->S : S ->U : U >f : (x: T) => (y: S) => U >x : T ->T : T >y : S ->S : S ->U : U ->U : U g = h // ok >g = h : (x: T) => (y: S) => (f: (x: T) => (y: S) => U) => U diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.types b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.types index 38485a78463..827130aadc9 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.types +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignatures4.types @@ -2,30 +2,17 @@ // some complex cases of assignment compat of generic signatures. interface I2 { ->I2 : I2 ->T : T - p: T >p : T ->T : T } var x: >(z: T) => void >x : >(z: T) => void ->T : T ->I2 : I2 ->T : T >z : T ->T : T var y: >>(z: T) => void >y : >>(z: T) => void ->T : T ->I2 : I2 ->I2 : I2 ->T : T >z : T ->T : T // These both do not make sense as we would eventually be comparing I2 to I2>, and they are self referencing anyway x = y diff --git a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.types b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.types index 28bcc4e190a..8f4ff989875 100644 --- a/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.types +++ b/tests/baselines/reference/assignmentCompatWithGenericCallSignaturesWithOptionalParameters.types @@ -6,39 +6,27 @@ module ClassTypeParam { class Base { >Base : Base ->T : T a: () => T; >a : () => T ->T : T a2: (x?: T) => T; >a2 : (x?: T) => T >x : T ->T : T ->T : T a3: (x: T) => T; >a3 : (x: T) => T >x : T ->T : T ->T : T a4: (x: T, y?: T) => T; >a4 : (x: T, y?: T) => T >x : T ->T : T >y : T ->T : T ->T : T a5: (x?: T, y?: T) => T; >a5 : (x?: T, y?: T) => T >x : T ->T : T >y : T ->T : T ->T : T init = () => { >init : () => void @@ -59,7 +47,6 @@ module ClassTypeParam { >a : () => T >(x?: T) => null : (x?: T) => any >x : T ->T : T >null : null this.a = (x: T) => null; // error, too many required params @@ -69,7 +56,6 @@ module ClassTypeParam { >a : () => T >(x: T) => null : (x: T) => any >x : T ->T : T >null : null this.a2 = () => null; // ok, same T of required params @@ -87,7 +73,6 @@ module ClassTypeParam { >a2 : (x?: T) => T >(x?: T) => null : (x?: T) => any >x : T ->T : T >null : null this.a2 = (x: T) => null; // ok, same number of params @@ -97,7 +82,6 @@ module ClassTypeParam { >a2 : (x?: T) => T >(x: T) => null : (x: T) => any >x : T ->T : T >null : null this.a3 = () => null; // ok, fewer required params @@ -115,7 +99,6 @@ module ClassTypeParam { >a3 : (x: T) => T >(x?: T) => null : (x?: T) => any >x : T ->T : T >null : null this.a3 = (x: T) => null; // ok, same T of required params @@ -125,7 +108,6 @@ module ClassTypeParam { >a3 : (x: T) => T >(x: T) => null : (x: T) => any >x : T ->T : T >null : null this.a3 = (x: T, y: T) => null; // error, too many required params @@ -135,9 +117,7 @@ module ClassTypeParam { >a3 : (x: T) => T >(x: T, y: T) => null : (x: T, y: T) => any >x : T ->T : T >y : T ->T : T >null : null this.a4 = () => null; // ok, fewer required params @@ -155,9 +135,7 @@ module ClassTypeParam { >a4 : (x: T, y?: T) => T >(x?: T, y?: T) => null : (x?: T, y?: T) => any >x : T ->T : T >y : T ->T : T >null : null this.a4 = (x: T) => null; // ok, same T of required params @@ -167,7 +145,6 @@ module ClassTypeParam { >a4 : (x: T, y?: T) => T >(x: T) => null : (x: T) => any >x : T ->T : T >null : null this.a4 = (x: T, y: T) => null; // ok, same number of params @@ -177,9 +154,7 @@ module ClassTypeParam { >a4 : (x: T, y?: T) => T >(x: T, y: T) => null : (x: T, y: T) => any >x : T ->T : T >y : T ->T : T >null : null @@ -198,9 +173,7 @@ module ClassTypeParam { >a5 : (x?: T, y?: T) => T >(x?: T, y?: T) => null : (x?: T, y?: T) => any >x : T ->T : T >y : T ->T : T >null : null this.a5 = (x: T) => null; // ok, all present params match @@ -210,7 +183,6 @@ module ClassTypeParam { >a5 : (x?: T, y?: T) => T >(x: T) => null : (x: T) => any >x : T ->T : T >null : null this.a5 = (x: T, y: T) => null; // ok, same number of params @@ -220,9 +192,7 @@ module ClassTypeParam { >a5 : (x?: T, y?: T) => T >(x: T, y: T) => null : (x: T, y: T) => any >x : T ->T : T >y : T ->T : T >null : null } } @@ -236,92 +206,60 @@ module GenericSignaturesInvalid { a: () => T; >a : () => T ->T : T ->T : T a2: (x?: T) => T; >a2 : (x?: T) => T ->T : T >x : T ->T : T ->T : T a3: (x: T) => T; >a3 : (x: T) => T ->T : T >x : T ->T : T ->T : T a4: (x: T, y?: T) => T; >a4 : (x: T, y?: T) => T ->T : T >x : T ->T : T >y : T ->T : T ->T : T a5: (x?: T, y?: T) => T; >a5 : (x?: T, y?: T) => T ->T : T >x : T ->T : T >y : T ->T : T ->T : T } class Target { >Target : Target ->T : T a: () => T; >a : () => T ->T : T a2: (x?: T) => T; >a2 : (x?: T) => T >x : T ->T : T ->T : T a3: (x: T) => T; >a3 : (x: T) => T >x : T ->T : T ->T : T a4: (x: T, y?: T) => T; >a4 : (x: T, y?: T) => T >x : T ->T : T >y : T ->T : T ->T : T a5: (x?: T, y?: T) => T; >a5 : (x?: T, y?: T) => T >x : T ->T : T >y : T ->T : T ->T : T } function foo() { >foo : () => void ->T : T var b: Base2; >b : Base2 ->Base2 : Base2 var t: Target; >t : Target ->Target : Target ->T : T // all errors b.a = t.a; @@ -559,40 +497,24 @@ module GenericSignaturesValid { a: () => T; >a : () => T ->T : T ->T : T a2: (x?: T) => T; >a2 : (x?: T) => T ->T : T >x : T ->T : T ->T : T a3: (x: T) => T; >a3 : (x: T) => T ->T : T >x : T ->T : T ->T : T a4: (x: T, y?: T) => T; >a4 : (x: T, y?: T) => T ->T : T >x : T ->T : T >y : T ->T : T ->T : T a5: (x?: T, y?: T) => T; >a5 : (x?: T, y?: T) => T ->T : T >x : T ->T : T >y : T ->T : T ->T : T init = () => { >init : () => void @@ -604,7 +526,6 @@ module GenericSignaturesValid { >this : this >a : () => T >() => null : () => any ->T : T >null : null this.a = (x?: T) => null; // ok, same T of required params @@ -613,9 +534,7 @@ module GenericSignaturesValid { >this : this >a : () => T >(x?: T) => null : (x?: T) => any ->T : T >x : T ->T : T >null : null this.a = (x: T) => null; // error, too many required params @@ -624,9 +543,7 @@ module GenericSignaturesValid { >this : this >a : () => T >(x: T) => null : (x: T) => any ->T : T >x : T ->T : T >null : null this.a2 = () => null; // ok, same T of required params @@ -635,7 +552,6 @@ module GenericSignaturesValid { >this : this >a2 : (x?: T) => T >() => null : () => any ->T : T >null : null this.a2 = (x?: T) => null; // ok, same T of required params @@ -644,9 +560,7 @@ module GenericSignaturesValid { >this : this >a2 : (x?: T) => T >(x?: T) => null : (x?: T) => any ->T : T >x : T ->T : T >null : null this.a2 = (x: T) => null; // ok, same number of params @@ -655,9 +569,7 @@ module GenericSignaturesValid { >this : this >a2 : (x?: T) => T >(x: T) => null : (x: T) => any ->T : T >x : T ->T : T >null : null this.a3 = () => null; // ok, fewer required params @@ -666,7 +578,6 @@ module GenericSignaturesValid { >this : this >a3 : (x: T) => T >() => null : () => any ->T : T >null : null this.a3 = (x?: T) => null; // ok, fewer required params @@ -675,9 +586,7 @@ module GenericSignaturesValid { >this : this >a3 : (x: T) => T >(x?: T) => null : (x?: T) => any ->T : T >x : T ->T : T >null : null this.a3 = (x: T) => null; // ok, same T of required params @@ -686,9 +595,7 @@ module GenericSignaturesValid { >this : this >a3 : (x: T) => T >(x: T) => null : (x: T) => any ->T : T >x : T ->T : T >null : null this.a3 = (x: T, y: T) => null; // error, too many required params @@ -697,11 +604,8 @@ module GenericSignaturesValid { >this : this >a3 : (x: T) => T >(x: T, y: T) => null : (x: T, y: T) => any ->T : T >x : T ->T : T >y : T ->T : T >null : null this.a4 = () => null; // ok, fewer required params @@ -710,7 +614,6 @@ module GenericSignaturesValid { >this : this >a4 : (x: T, y?: T) => T >() => null : () => any ->T : T >null : null this.a4 = (x?: T, y?: T) => null; // ok, fewer required params @@ -719,11 +622,8 @@ module GenericSignaturesValid { >this : this >a4 : (x: T, y?: T) => T >(x?: T, y?: T) => null : (x?: T, y?: T) => any ->T : T >x : T ->T : T >y : T ->T : T >null : null this.a4 = (x: T) => null; // ok, same T of required params @@ -732,9 +632,7 @@ module GenericSignaturesValid { >this : this >a4 : (x: T, y?: T) => T >(x: T) => null : (x: T) => any ->T : T >x : T ->T : T >null : null this.a4 = (x: T, y: T) => null; // ok, same number of params @@ -743,11 +641,8 @@ module GenericSignaturesValid { >this : this >a4 : (x: T, y?: T) => T >(x: T, y: T) => null : (x: T, y: T) => any ->T : T >x : T ->T : T >y : T ->T : T >null : null @@ -757,7 +652,6 @@ module GenericSignaturesValid { >this : this >a5 : (x?: T, y?: T) => T >() => null : () => any ->T : T >null : null this.a5 = (x?: T, y?: T) => null; // ok, fewer required params @@ -766,11 +660,8 @@ module GenericSignaturesValid { >this : this >a5 : (x?: T, y?: T) => T >(x?: T, y?: T) => null : (x?: T, y?: T) => any ->T : T >x : T ->T : T >y : T ->T : T >null : null this.a5 = (x: T) => null; // ok, all present params match @@ -779,9 +670,7 @@ module GenericSignaturesValid { >this : this >a5 : (x?: T, y?: T) => T >(x: T) => null : (x: T) => any ->T : T >x : T ->T : T >null : null this.a5 = (x: T, y: T) => null; // ok, same number of params @@ -790,11 +679,8 @@ module GenericSignaturesValid { >this : this >a5 : (x?: T, y?: T) => T >(x: T, y: T) => null : (x: T, y: T) => any ->T : T >x : T ->T : T >y : T ->T : T >null : null } } diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.types b/tests/baselines/reference/assignmentCompatWithNumericIndexer.types index b1d61b0d71e..d4900b9ba21 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer.types +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.types @@ -2,17 +2,12 @@ // Derived type indexer must be subtype of base type indexer interface Base { foo: string; } ->Base : Base >foo : string interface Derived extends Base { bar: string; } ->Derived : Derived ->Base : Base >bar : string interface Derived2 extends Derived { baz: string; } ->Derived2 : Derived2 ->Derived : Derived >baz : string class A { @@ -20,17 +15,14 @@ class A { [x: number]: Base; >x : number ->Base : Base } var a: A; >a : A ->A : A var b: { [x: number]: Derived; } >b : { [x: number]: Derived; } >x : number ->Derived : Derived a = b; >a = b : { [x: number]: Derived; } @@ -45,7 +37,6 @@ b = a; // error var b2: { [x: number]: Derived2; } >b2 : { [x: number]: Derived2; } >x : number ->Derived2 : Derived2 a = b2; >a = b2 : { [x: number]: Derived2; } @@ -62,38 +53,28 @@ module Generics { class A { >A : A ->T : T ->Base : Base [x: number]: T; >x : number ->T : T } class B extends A { >B : B >A : A ->Base : Base [x: number]: Derived; // ok >x : number ->Derived : Derived } function foo() { >foo : () => void ->T : T ->Base : Base var a: A; >a : A ->A : A ->T : T var b: { [x: number]: Derived; } >b : { [x: number]: Derived; } >x : number ->Derived : Derived a = b; // error >a = b : { [x: number]: Derived; } @@ -108,7 +89,6 @@ module Generics { var b2: { [x: number]: Derived2; } >b2 : { [x: number]: Derived2; } >x : number ->Derived2 : Derived2 a = b2; // error >a = b2 : { [x: number]: Derived2; } @@ -123,7 +103,6 @@ module Generics { var b3: { [x: number]: T; } >b3 : { [x: number]: T; } >x : number ->T : T a = b3; // ok >a = b3 : { [x: number]: T; } diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.types b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.types index c980c8ef9ea..75147982b89 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.types +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.types @@ -2,35 +2,25 @@ // Derived type indexer must be subtype of base type indexer interface Base { foo: string; } ->Base : Base >foo : string interface Derived extends Base { bar: string; } ->Derived : Derived ->Base : Base >bar : string interface Derived2 extends Derived { baz: string; } ->Derived2 : Derived2 ->Derived : Derived >baz : string interface A { ->A : A - [x: number]: Base; >x : number ->Base : Base } var a: A; >a : A ->A : A var b: { [x: number]: Derived; } >b : { [x: number]: Derived; } >x : number ->Derived : Derived a = b; >a = b : { [x: number]: Derived; } @@ -45,7 +35,6 @@ b = a; // error var b2: { [x: number]: Derived2; } >b2 : { [x: number]: Derived2; } >x : number ->Derived2 : Derived2 a = b2; >a = b2 : { [x: number]: Derived2; } @@ -61,39 +50,24 @@ module Generics { >Generics : typeof Generics interface A { ->A : A ->T : T ->Base : Base - [x: number]: T; >x : number ->T : T } interface B extends A { ->B : B ->A : A ->Base : Base - [x: number]: Derived; // ok >x : number ->Derived : Derived } function foo() { >foo : () => void ->T : T ->Base : Base var a: A; >a : A ->A : A ->T : T var b: { [x: number]: Derived; } >b : { [x: number]: Derived; } >x : number ->Derived : Derived a = b; // error >a = b : { [x: number]: Derived; } @@ -108,7 +82,6 @@ module Generics { var b2: { [x: number]: Derived2; } >b2 : { [x: number]: Derived2; } >x : number ->Derived2 : Derived2 a = b2; // error >a = b2 : { [x: number]: Derived2; } @@ -123,7 +96,6 @@ module Generics { var b3: { [x: number]: T; } >b3 : { [x: number]: T; } >x : number ->T : T a = b3; // ok >a = b3 : { [x: number]: T; } diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.types b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.types index 3f7b0549254..7943f95907a 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.types +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.types @@ -2,17 +2,12 @@ // Derived type indexer must be subtype of base type indexer interface Base { foo: string; } ->Base : Base >foo : string interface Derived extends Base { bar: string; } ->Derived : Derived ->Base : Base >bar : string interface Derived2 extends Derived { baz: string; } ->Derived2 : Derived2 ->Derived : Derived >baz : string class A { @@ -20,17 +15,14 @@ class A { [x: number]: Derived; >x : number ->Derived : Derived } var a: A; >a : A ->A : A var b: { [x: number]: Base; }; >b : { [x: number]: Base; } >x : number ->Base : Base a = b; // error >a = b : { [x: number]: Base; } @@ -48,13 +40,11 @@ class B2 extends A { [x: number]: Derived2; // ok >x : number ->Derived2 : Derived2 } var b2: { [x: number]: Derived2; }; >b2 : { [x: number]: Derived2; } >x : number ->Derived2 : Derived2 a = b2; // ok >a = b2 : { [x: number]: Derived2; } @@ -71,28 +61,20 @@ module Generics { class A { >A : A ->T : T ->Derived : Derived [x: number]: T; >x : number ->T : T } function foo() { >foo : () => void ->T : T ->Derived : Derived var a: A; >a : A ->A : A ->T : T var b: { [x: number]: Derived; }; >b : { [x: number]: Derived; } >x : number ->Derived : Derived a = b; // error >a = b : { [x: number]: Derived; } @@ -107,7 +89,6 @@ module Generics { var b2: { [x: number]: T; }; >b2 : { [x: number]: T; } >x : number ->T : T a = b2; // ok >a = b2 : { [x: number]: T; } diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers.types b/tests/baselines/reference/assignmentCompatWithObjectMembers.types index ced87c605c9..539fe1ed809 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers.types @@ -15,27 +15,21 @@ module SimpleTypes { var s: S; >s : S ->S : S var t: T; >t : T ->T : T interface S2 { foo: string; } ->S2 : S2 >foo : string interface T2 { foo: string; } ->T2 : T2 >foo : string var s2: S2; >s2 : S2 ->S2 : S2 var t2: T2; >t2 : T2 ->T2 : T2 var a: { foo: string; } >a : { foo: string; } @@ -159,38 +153,28 @@ module ObjectTypes { class S { foo: S; } >S : S >foo : S ->S : S class T { foo: T; } >T : T >foo : T ->T : T var s: S; >s : S ->S : S var t: T; >t : T ->T : T interface S2 { foo: S2; } ->S2 : S2 >foo : S2 ->S2 : S2 interface T2 { foo: T2; } ->T2 : T2 >foo : T2 ->T2 : T2 var s2: S2; >s2 : S2 ->S2 : S2 var t2: T2; >t2 : T2 ->T2 : T2 var a: { foo: typeof a; } >a : { foo: any; } diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers2.types b/tests/baselines/reference/assignmentCompatWithObjectMembers2.types index 76316afd3cc..204872fca3e 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers2.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers2.types @@ -12,29 +12,23 @@ class T { foo: string; } var s: S; >s : S ->S : S var t: T; >t : T ->T : T interface S2 { foo: string; bar?: string } ->S2 : S2 >foo : string >bar : string interface T2 { foo: string; baz?: string } ->T2 : T2 >foo : string >baz : string var s2: S2; >s2 : S2 ->S2 : S2 var t2: T2; >t2 : T2 ->T2 : T2 var a: { foo: string; bar?: string } >a : { foo: string; bar?: string; } diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers3.types b/tests/baselines/reference/assignmentCompatWithObjectMembers3.types index 88eadd4c36a..d0a87a67535 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers3.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers3.types @@ -4,39 +4,31 @@ class S implements S2 { foo: string; } >S : S ->S2 : S2 >foo : string class T implements T2 { foo: string; } >T : T ->T2 : T2 >foo : string var s: S; >s : S ->S : S var t: T; >t : T ->T : T interface S2 { foo: string; bar?: string } ->S2 : S2 >foo : string >bar : string interface T2 { foo: string; baz?: string } ->T2 : T2 >foo : string >baz : string var s2: S2; >s2 : S2 ->S2 : S2 var t2: T2; >t2 : T2 ->T2 : T2 var a: { foo: string; bar?: string } >a : { foo: string; bar?: string; } @@ -50,14 +42,12 @@ var b: { foo: string; baz?: string } var a2: S2 = { foo: '' }; >a2 : S2 ->S2 : S2 >{ foo: '' } : { foo: string; } >foo : string >'' : "" var b2: T2 = { foo: '' }; >b2 : T2 ->T2 : T2 >{ foo: '' } : { foo: string; } >foo : string >'' : "" diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.types b/tests/baselines/reference/assignmentCompatWithObjectMembers4.types index 1d7fb3eae7b..77bbcee40d3 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.types @@ -21,48 +21,36 @@ module OnlyDerived { class S { foo: Derived; } >S : S >foo : Derived ->Derived : Derived class T { foo: Derived2; } >T : T >foo : Derived2 ->Derived2 : Derived2 var s: S; >s : S ->S : S var t: T; >t : T ->T : T interface S2 { foo: Derived; } ->S2 : S2 >foo : Derived ->Derived : Derived interface T2 { foo: Derived2; } ->T2 : T2 >foo : Derived2 ->Derived2 : Derived2 var s2: S2; >s2 : S2 ->S2 : S2 var t2: T2; >t2 : T2 ->T2 : T2 var a: { foo: Derived; } >a : { foo: Derived; } >foo : Derived ->Derived : Derived var b: { foo: Derived2; } >b : { foo: Derived2; } >foo : Derived2 ->Derived2 : Derived2 var a2 = { foo: new Derived() }; >a2 : { foo: Derived; } @@ -194,48 +182,36 @@ module WithBase { class S { foo: Base; } >S : S >foo : Base ->Base : Base class T { foo: Derived2; } >T : T >foo : Derived2 ->Derived2 : Derived2 var s: S; >s : S ->S : S var t: T; >t : T ->T : T interface S2 { foo: Base; } ->S2 : S2 >foo : Base ->Base : Base interface T2 { foo: Derived2; } ->T2 : T2 >foo : Derived2 ->Derived2 : Derived2 var s2: S2; >s2 : S2 ->S2 : S2 var t2: T2; >t2 : T2 ->T2 : T2 var a: { foo: Base; } >a : { foo: Base; } >foo : Base ->Base : Base var b: { foo: Derived2; } >b : { foo: Derived2; } >foo : Derived2 ->Derived2 : Derived2 var a2 = { foo: new Base() }; >a2 : { foo: Base; } diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers5.types b/tests/baselines/reference/assignmentCompatWithObjectMembers5.types index 87c213ff0fd..bcd092b0ca0 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers5.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers5.types @@ -8,18 +8,14 @@ class C { var c: C; >c : C ->C : C interface I { ->I : I - fooo: string; >fooo : string } var i: I; >i : I ->I : I c = i; // error >c = i : I diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.types b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.types index ec65f474f20..0728ec31dd5 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersAccessibility.types @@ -13,8 +13,6 @@ module TargetIsPublic { } interface I { ->I : I - foo: string; >foo : string } @@ -25,11 +23,9 @@ module TargetIsPublic { var b: Base; >b : Base ->Base : Base var i: I; >i : I ->I : I // sources class D { @@ -47,11 +43,9 @@ module TargetIsPublic { } var d: D; >d : D ->D : D var e: E; >e : E ->E : E a = b; >a = b : Base @@ -172,8 +166,6 @@ module TargetIsPublic { } interface I extends Base { ->I : I ->Base : Base } var a: { foo: string; } @@ -182,11 +174,9 @@ module TargetIsPublic { var b: Base; >b : Base ->Base : Base var i: I; >i : I ->I : I // sources class D { @@ -205,11 +195,9 @@ module TargetIsPublic { var d: D; >d : D ->D : D var e: E; >e : E ->E : E a = b; // error >a = b : Base diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types index aea92a9aa3f..7a722766aec 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types @@ -12,29 +12,23 @@ class T { 1.: string; } var s: S; >s : S ->S : S var t: T; >t : T ->T : T interface S2 { 1: string; bar?: string } ->S2 : S2 >1 : string >bar : string interface T2 { 1.0: string; baz?: string } ->T2 : T2 >1.0 : string >baz : string var s2: S2; >s2 : S2 ->S2 : S2 var t2: T2; >t2 : T2 ->T2 : T2 var a: { 1.: string; bar?: string } >a : { 1.: string; bar?: string; } diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.types b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.types index 8727b7567b6..53f56a7d0a7 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.types @@ -20,20 +20,15 @@ module TargetHasOptional { // targets interface C { ->C : C - opt?: Base >opt : Base ->Base : Base } var c: C; >c : C ->C : C var a: { opt?: Base; } >a : { opt?: Base; } >opt : Base ->Base : Base var b: typeof a = { opt: new Base() } >b : { opt?: Base; } @@ -45,37 +40,25 @@ module TargetHasOptional { // sources interface D { ->D : D - opt: Base; >opt : Base ->Base : Base } interface E { ->E : E - opt: Derived; >opt : Derived ->Derived : Derived } interface F { ->F : F - opt?: Derived; >opt : Derived ->Derived : Derived } var d: D; >d : D ->D : D var e: E; >e : E ->E : E var f: F; >f : F ->F : F // all ok c = d; @@ -149,20 +132,15 @@ module SourceHasOptional { // targets interface C { ->C : C - opt: Base >opt : Base ->Base : Base } var c: C; >c : C ->C : C var a: { opt: Base; } >a : { opt: Base; } >opt : Base ->Base : Base var b = { opt: new Base() } >b : { opt: Base; } @@ -173,37 +151,25 @@ module SourceHasOptional { // sources interface D { ->D : D - opt?: Base; >opt : Base ->Base : Base } interface E { ->E : E - opt?: Derived; >opt : Derived ->Derived : Derived } interface F { ->F : F - opt: Derived; >opt : Derived ->Derived : Derived } var d: D; >d : D ->D : D var e: E; >e : E ->E : E var f: F; >f : F ->F : F c = d; // error >c = d : D diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.types b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.types index 3481816b544..f2caff7f489 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.types @@ -21,20 +21,15 @@ module TargetHasOptional { // targets interface C { ->C : C - opt?: Base >opt : Base ->Base : Base } var c: C; >c : C ->C : C var a: { opt?: Base; } >a : { opt?: Base; } >opt : Base ->Base : Base var b: typeof a = { opt: new Base() } >b : { opt?: Base; } @@ -46,37 +41,25 @@ module TargetHasOptional { // sources interface D { ->D : D - other: Base; >other : Base ->Base : Base } interface E { ->E : E - other: Derived; >other : Derived ->Derived : Derived } interface F { ->F : F - other?: Derived; >other : Derived ->Derived : Derived } var d: D; >d : D ->D : D var e: E; >e : E ->E : E var f: F; >f : F ->F : F // disallowed by weak type checking c = d; @@ -151,20 +134,15 @@ module SourceHasOptional { // targets interface C { ->C : C - opt: Base >opt : Base ->Base : Base } var c: C; >c : C ->C : C var a: { opt: Base; } >a : { opt: Base; } >opt : Base ->Base : Base var b = { opt: new Base() } >b : { opt: Base; } @@ -175,37 +153,25 @@ module SourceHasOptional { // sources interface D { ->D : D - other?: Base; >other : Base ->Base : Base } interface E { ->E : E - other?: Derived; >other : Derived ->Derived : Derived } interface F { ->F : F - other: Derived; >other : Derived ->Derived : Derived } var d: D; >d : D ->D : D var e: E; >e : E ->E : E var f: F; >f : F ->F : F c = d; // error >c = d : D diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.types b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.types index a8be024ca60..3210c1810a3 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.types @@ -15,29 +15,23 @@ module JustStrings { var s: S; >s : S ->S : S var t: T; >t : T ->T : T interface S2 { '1': string; bar?: string } ->S2 : S2 >'1' : string >bar : string interface T2 { '1.0': string; baz?: string } ->T2 : T2 >'1.0' : string >baz : string var s2: S2; >s2 : S2 ->S2 : S2 var t2: T2; >t2 : T2 ->T2 : T2 var a: { '1.': string; bar?: string } >a : { '1.': string; bar?: string; } @@ -170,29 +164,23 @@ module NumbersAndStrings { var s: S; >s : S ->S : S var t: T; >t : T ->T : T interface S2 { '1': string; bar?: string } ->S2 : S2 >'1' : string >bar : string interface T2 { 1.0: string; baz?: string } ->T2 : T2 >1.0 : string >baz : string var s2: S2; >s2 : S2 ->S2 : S2 var t2: T2; >t2 : T2 ->T2 : T2 var a: { '1.': string; bar?: string } >a : { '1.': string; bar?: string; } diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.types b/tests/baselines/reference/assignmentCompatWithStringIndexer.types index 2ecb1889406..7b9febebfb4 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer.types +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.types @@ -2,17 +2,12 @@ // index signatures must be compatible in assignments interface Base { foo: string; } ->Base : Base >foo : string interface Derived extends Base { bar: string; } ->Derived : Derived ->Base : Base >bar : string interface Derived2 extends Derived { baz: string; } ->Derived2 : Derived2 ->Derived : Derived >baz : string class A { @@ -20,17 +15,14 @@ class A { [x: string]: Base; >x : string ->Base : Base } var a: A; >a : A ->A : A var b: { [x: string]: Derived; } >b : { [x: string]: Derived; } >x : string ->Derived : Derived a = b; // ok >a = b : { [x: string]: Derived; } @@ -45,7 +37,6 @@ b = a; // error var b2: { [x: string]: Derived2; } >b2 : { [x: string]: Derived2; } >x : string ->Derived2 : Derived2 a = b2; // ok >a = b2 : { [x: string]: Derived2; } @@ -62,33 +53,25 @@ module Generics { class A { >A : A ->T : T ->Base : Base [x: string]: T; >x : string ->T : T } class B extends A { >B : B >A : A ->Base : Base [x: string]: Derived; // ok >x : string ->Derived : Derived } var b1: { [x: string]: Derived; }; >b1 : { [x: string]: Derived; } >x : string ->Derived : Derived var a1: A; >a1 : A ->A : A ->Base : Base a1 = b1; // ok >a1 = b1 : { [x: string]: Derived; } @@ -103,17 +86,14 @@ module Generics { class B2 extends A { >B2 : B2 >A : A ->Base : Base [x: string]: Derived2; // ok >x : string ->Derived2 : Derived2 } var b2: { [x: string]: Derived2; }; >b2 : { [x: string]: Derived2; } >x : string ->Derived2 : Derived2 a1 = b2; // ok >a1 = b2 : { [x: string]: Derived2; } @@ -127,18 +107,13 @@ module Generics { function foo() { >foo : () => void ->T : T ->Base : Base var b3: { [x: string]: Derived; }; >b3 : { [x: string]: Derived; } >x : string ->Derived : Derived var a3: A; >a3 : A ->A : A ->T : T a3 = b3; // error >a3 = b3 : { [x: string]: Derived; } @@ -153,7 +128,6 @@ module Generics { var b4: { [x: string]: Derived2; }; >b4 : { [x: string]: Derived2; } >x : string ->Derived2 : Derived2 a3 = b4; // error >a3 = b4 : { [x: string]: Derived2; } diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer2.types b/tests/baselines/reference/assignmentCompatWithStringIndexer2.types index 4c9d2729a6c..0f520bdccb9 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer2.types +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer2.types @@ -2,35 +2,25 @@ // index signatures must be compatible in assignments interface Base { foo: string; } ->Base : Base >foo : string interface Derived extends Base { bar: string; } ->Derived : Derived ->Base : Base >bar : string interface Derived2 extends Derived { baz: string; } ->Derived2 : Derived2 ->Derived : Derived >baz : string interface A { ->A : A - [x: string]: Base; >x : string ->Base : Base } var a: A; >a : A ->A : A var b: { [x: string]: Derived; } >b : { [x: string]: Derived; } >x : string ->Derived : Derived a = b; // ok >a = b : { [x: string]: Derived; } @@ -45,7 +35,6 @@ b = a; // error var b2: { [x: string]: Derived2; } >b2 : { [x: string]: Derived2; } >x : string ->Derived2 : Derived2 a = b2; // ok >a = b2 : { [x: string]: Derived2; } @@ -61,34 +50,21 @@ module Generics { >Generics : typeof Generics interface A { ->A : A ->T : T ->Base : Base - [x: string]: T; >x : string ->T : T } interface B extends A { ->B : B ->A : A ->Base : Base - [x: string]: Derived; // ok >x : string ->Derived : Derived } var b1: { [x: string]: Derived; }; >b1 : { [x: string]: Derived; } >x : string ->Derived : Derived var a1: A; >a1 : A ->A : A ->Base : Base a1 = b1; // ok >a1 = b1 : { [x: string]: Derived; } @@ -101,19 +77,13 @@ module Generics { >a1 : A interface B2 extends A { ->B2 : B2 ->A : A ->Base : Base - [x: string]: Derived2; // ok >x : string ->Derived2 : Derived2 } var b2: { [x: string]: Derived2; }; >b2 : { [x: string]: Derived2; } >x : string ->Derived2 : Derived2 a1 = b2; // ok >a1 = b2 : { [x: string]: Derived2; } @@ -127,18 +97,13 @@ module Generics { function foo() { >foo : () => void ->T : T ->Base : Base var b3: { [x: string]: Derived; }; >b3 : { [x: string]: Derived; } >x : string ->Derived : Derived var a3: A; >a3 : A ->A : A ->T : T a3 = b3; // error >a3 = b3 : { [x: string]: Derived; } @@ -153,7 +118,6 @@ module Generics { var b4: { [x: string]: Derived2; }; >b4 : { [x: string]: Derived2; } >x : string ->Derived2 : Derived2 a3 = b4; // error >a3 = b4 : { [x: string]: Derived2; } diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer3.types b/tests/baselines/reference/assignmentCompatWithStringIndexer3.types index eda67798465..89caebb3113 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer3.types +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer3.types @@ -2,22 +2,16 @@ // Derived type indexer must be subtype of base type indexer interface Base { foo: string; } ->Base : Base >foo : string interface Derived extends Base { bar: string; } ->Derived : Derived ->Base : Base >bar : string interface Derived2 extends Derived { baz: string; } ->Derived2 : Derived2 ->Derived : Derived >baz : string var a: A; >a : any ->A : No type information available! var b1: { [x: string]: string; } >b1 : { [x: string]: string; } @@ -38,23 +32,16 @@ module Generics { class A { >A : A ->T : T ->Derived : Derived [x: string]: T; >x : string ->T : T } function foo() { >foo : () => void ->T : T ->Derived : Derived var a: A; >a : A ->A : A ->T : T var b: { [x: string]: string; } >b : { [x: string]: string; } diff --git a/tests/baselines/reference/assignmentCompatability1.types b/tests/baselines/reference/assignmentCompatability1.types index 6f47a6e5244..1aa3eac973a 100644 --- a/tests/baselines/reference/assignmentCompatability1.types +++ b/tests/baselines/reference/assignmentCompatability1.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability10.types b/tests/baselines/reference/assignmentCompatability10.types index 9784acfdabc..d5d25915940 100644 --- a/tests/baselines/reference/assignmentCompatability10.types +++ b/tests/baselines/reference/assignmentCompatability10.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 @@ -25,12 +19,8 @@ module __test2__ { export class classWithPublicAndOptional { constructor(public one: T, public two?: U) {} } var x4 = new classWithPublicAndOptional(1);; >classWithPublicAndOptional : classWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >x4 : classWithPublicAndOptional >new classWithPublicAndOptional(1) : classWithPublicAndOptional >classWithPublicAndOptional : typeof classWithPublicAndOptional diff --git a/tests/baselines/reference/assignmentCompatability11.types b/tests/baselines/reference/assignmentCompatability11.types index d035fe74084..728aee1517a 100644 --- a/tests/baselines/reference/assignmentCompatability11.types +++ b/tests/baselines/reference/assignmentCompatability11.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability12.types b/tests/baselines/reference/assignmentCompatability12.types index 34e83a7dc44..0b1eed65e43 100644 --- a/tests/baselines/reference/assignmentCompatability12.types +++ b/tests/baselines/reference/assignmentCompatability12.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability13.types b/tests/baselines/reference/assignmentCompatability13.types index 3ee0e4a15b5..62f82be12ac 100644 --- a/tests/baselines/reference/assignmentCompatability13.types +++ b/tests/baselines/reference/assignmentCompatability13.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability14.types b/tests/baselines/reference/assignmentCompatability14.types index 0eee6b21695..8321cc0fc61 100644 --- a/tests/baselines/reference/assignmentCompatability14.types +++ b/tests/baselines/reference/assignmentCompatability14.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability15.types b/tests/baselines/reference/assignmentCompatability15.types index 426c55f55dc..688e6e4be84 100644 --- a/tests/baselines/reference/assignmentCompatability15.types +++ b/tests/baselines/reference/assignmentCompatability15.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability16.types b/tests/baselines/reference/assignmentCompatability16.types index bc37bd93de6..053cbfd26a9 100644 --- a/tests/baselines/reference/assignmentCompatability16.types +++ b/tests/baselines/reference/assignmentCompatability16.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability17.types b/tests/baselines/reference/assignmentCompatability17.types index b6d6854d8a9..5a1c5a0a48f 100644 --- a/tests/baselines/reference/assignmentCompatability17.types +++ b/tests/baselines/reference/assignmentCompatability17.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability18.types b/tests/baselines/reference/assignmentCompatability18.types index cae2094c992..936b35a7c9f 100644 --- a/tests/baselines/reference/assignmentCompatability18.types +++ b/tests/baselines/reference/assignmentCompatability18.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability19.types b/tests/baselines/reference/assignmentCompatability19.types index 41fad382aa5..e822dde2891 100644 --- a/tests/baselines/reference/assignmentCompatability19.types +++ b/tests/baselines/reference/assignmentCompatability19.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability2.types b/tests/baselines/reference/assignmentCompatability2.types index 58fb86b5c7f..33383d1a185 100644 --- a/tests/baselines/reference/assignmentCompatability2.types +++ b/tests/baselines/reference/assignmentCompatability2.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability20.types b/tests/baselines/reference/assignmentCompatability20.types index 666ad22e681..1e6cf213af3 100644 --- a/tests/baselines/reference/assignmentCompatability20.types +++ b/tests/baselines/reference/assignmentCompatability20.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability21.types b/tests/baselines/reference/assignmentCompatability21.types index 2b0c8e90b7b..fdd8eea98d6 100644 --- a/tests/baselines/reference/assignmentCompatability21.types +++ b/tests/baselines/reference/assignmentCompatability21.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability22.types b/tests/baselines/reference/assignmentCompatability22.types index d94f7b51ee7..70561e334e5 100644 --- a/tests/baselines/reference/assignmentCompatability22.types +++ b/tests/baselines/reference/assignmentCompatability22.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability23.types b/tests/baselines/reference/assignmentCompatability23.types index 8c3f1155f71..e8c26edf9ee 100644 --- a/tests/baselines/reference/assignmentCompatability23.types +++ b/tests/baselines/reference/assignmentCompatability23.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability24.types b/tests/baselines/reference/assignmentCompatability24.types index 63fccee0c1c..f997ac68bf1 100644 --- a/tests/baselines/reference/assignmentCompatability24.types +++ b/tests/baselines/reference/assignmentCompatability24.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 @@ -27,9 +21,7 @@ module __test2__ { >obj : (a: Tstring) => Tstring >function f(a: Tstring) { return a; } : (a: Tstring) => Tstring >f : (a: Tstring) => Tstring ->Tstring : Tstring >a : Tstring ->Tstring : Tstring >a : Tstring export var __val__obj = obj; diff --git a/tests/baselines/reference/assignmentCompatability25.types b/tests/baselines/reference/assignmentCompatability25.types index 3f24a798d65..776e9992d89 100644 --- a/tests/baselines/reference/assignmentCompatability25.types +++ b/tests/baselines/reference/assignmentCompatability25.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability26.types b/tests/baselines/reference/assignmentCompatability26.types index 9653a606705..0350170475a 100644 --- a/tests/baselines/reference/assignmentCompatability26.types +++ b/tests/baselines/reference/assignmentCompatability26.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability27.types b/tests/baselines/reference/assignmentCompatability27.types index c04554e5764..512e7f09dd2 100644 --- a/tests/baselines/reference/assignmentCompatability27.types +++ b/tests/baselines/reference/assignmentCompatability27.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability28.types b/tests/baselines/reference/assignmentCompatability28.types index bdf277b0664..5f0a2f41bc5 100644 --- a/tests/baselines/reference/assignmentCompatability28.types +++ b/tests/baselines/reference/assignmentCompatability28.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability29.types b/tests/baselines/reference/assignmentCompatability29.types index 7a87e4f8bee..6e7393cd504 100644 --- a/tests/baselines/reference/assignmentCompatability29.types +++ b/tests/baselines/reference/assignmentCompatability29.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability3.types b/tests/baselines/reference/assignmentCompatability3.types index 4525500cfec..06db684c39e 100644 --- a/tests/baselines/reference/assignmentCompatability3.types +++ b/tests/baselines/reference/assignmentCompatability3.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability30.types b/tests/baselines/reference/assignmentCompatability30.types index ca541edb554..acde0fb4e75 100644 --- a/tests/baselines/reference/assignmentCompatability30.types +++ b/tests/baselines/reference/assignmentCompatability30.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability31.types b/tests/baselines/reference/assignmentCompatability31.types index 2c4ec726bcb..ab26f09ac37 100644 --- a/tests/baselines/reference/assignmentCompatability31.types +++ b/tests/baselines/reference/assignmentCompatability31.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability32.types b/tests/baselines/reference/assignmentCompatability32.types index e7e9c3ef929..81cfe862821 100644 --- a/tests/baselines/reference/assignmentCompatability32.types +++ b/tests/baselines/reference/assignmentCompatability32.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability33.types b/tests/baselines/reference/assignmentCompatability33.types index 9420c0f1bc9..2d0077363bd 100644 --- a/tests/baselines/reference/assignmentCompatability33.types +++ b/tests/baselines/reference/assignmentCompatability33.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 @@ -25,10 +19,7 @@ module __test2__ { export var obj: { (a: Tstring): Tstring; }; >obj : (a: Tstring) => Tstring ->Tstring : Tstring >a : Tstring ->Tstring : Tstring ->Tstring : Tstring export var __val__obj = obj; >__val__obj : (a: Tstring) => Tstring diff --git a/tests/baselines/reference/assignmentCompatability34.types b/tests/baselines/reference/assignmentCompatability34.types index 323dd84c787..73a1e988239 100644 --- a/tests/baselines/reference/assignmentCompatability34.types +++ b/tests/baselines/reference/assignmentCompatability34.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 @@ -25,10 +19,7 @@ module __test2__ { export var obj: { (a:Tnumber):Tnumber;}; >obj : (a: Tnumber) => Tnumber ->Tnumber : Tnumber >a : Tnumber ->Tnumber : Tnumber ->Tnumber : Tnumber export var __val__obj = obj; >__val__obj : (a: Tnumber) => Tnumber diff --git a/tests/baselines/reference/assignmentCompatability35.types b/tests/baselines/reference/assignmentCompatability35.types index 50da60fd0d9..bbef43af9f4 100644 --- a/tests/baselines/reference/assignmentCompatability35.types +++ b/tests/baselines/reference/assignmentCompatability35.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability36.types b/tests/baselines/reference/assignmentCompatability36.types index 59ccc04195f..1d93b502cc8 100644 --- a/tests/baselines/reference/assignmentCompatability36.types +++ b/tests/baselines/reference/assignmentCompatability36.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability37.types b/tests/baselines/reference/assignmentCompatability37.types index 44f1b7d120b..099741162d3 100644 --- a/tests/baselines/reference/assignmentCompatability37.types +++ b/tests/baselines/reference/assignmentCompatability37.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 @@ -25,9 +19,7 @@ module __test2__ { export var aa:{ new (param: Tnumber); };; >aa : new (param: Tnumber) => any ->Tnumber : Tnumber >param : Tnumber ->Tnumber : Tnumber export var __val__aa = aa; >__val__aa : new (param: Tnumber) => any diff --git a/tests/baselines/reference/assignmentCompatability38.types b/tests/baselines/reference/assignmentCompatability38.types index ae23533fb08..e6be5038f0f 100644 --- a/tests/baselines/reference/assignmentCompatability38.types +++ b/tests/baselines/reference/assignmentCompatability38.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 @@ -25,9 +19,7 @@ module __test2__ { export var aa:{ new (param: Tstring); };; >aa : new (param: Tstring) => any ->Tstring : Tstring >param : Tstring ->Tstring : Tstring export var __val__aa = aa; >__val__aa : new (param: Tstring) => any diff --git a/tests/baselines/reference/assignmentCompatability39.types b/tests/baselines/reference/assignmentCompatability39.types index 9621c62d07c..b23efbbbcfa 100644 --- a/tests/baselines/reference/assignmentCompatability39.types +++ b/tests/baselines/reference/assignmentCompatability39.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 @@ -25,12 +19,8 @@ module __test2__ { export class classWithTwoPublic { constructor(public one: T, public two: U) {} } var x2 = new classWithTwoPublic(1, "a");; >classWithTwoPublic : classWithTwoPublic ->T : T ->U : U >one : T ->T : T >two : U ->U : U >x2 : classWithTwoPublic >new classWithTwoPublic(1, "a") : classWithTwoPublic >classWithTwoPublic : typeof classWithTwoPublic diff --git a/tests/baselines/reference/assignmentCompatability4.types b/tests/baselines/reference/assignmentCompatability4.types index bc5e805875c..285fe32e0ae 100644 --- a/tests/baselines/reference/assignmentCompatability4.types +++ b/tests/baselines/reference/assignmentCompatability4.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability40.types b/tests/baselines/reference/assignmentCompatability40.types index 31a598ffe25..e95d4c6d685 100644 --- a/tests/baselines/reference/assignmentCompatability40.types +++ b/tests/baselines/reference/assignmentCompatability40.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 @@ -25,9 +19,7 @@ module __test2__ { export class classWithPrivate { constructor(private one: T) {} } var x5 = new classWithPrivate(1);; >classWithPrivate : classWithPrivate ->T : T >one : T ->T : T >x5 : classWithPrivate >new classWithPrivate(1) : classWithPrivate >classWithPrivate : typeof classWithPrivate diff --git a/tests/baselines/reference/assignmentCompatability41.types b/tests/baselines/reference/assignmentCompatability41.types index 343cd4e81b6..dd52e0b9a04 100644 --- a/tests/baselines/reference/assignmentCompatability41.types +++ b/tests/baselines/reference/assignmentCompatability41.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 @@ -25,12 +19,8 @@ module __test2__ { export class classWithTwoPrivate { constructor(private one: T, private two: U) {} } var x6 = new classWithTwoPrivate(1, "a");; >classWithTwoPrivate : classWithTwoPrivate ->T : T ->U : U >one : T ->T : T >two : U ->U : U >x6 : classWithTwoPrivate >new classWithTwoPrivate(1, "a") : classWithTwoPrivate >classWithTwoPrivate : typeof classWithTwoPrivate diff --git a/tests/baselines/reference/assignmentCompatability42.types b/tests/baselines/reference/assignmentCompatability42.types index 168d718e1e4..3b4ada6639b 100644 --- a/tests/baselines/reference/assignmentCompatability42.types +++ b/tests/baselines/reference/assignmentCompatability42.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 @@ -25,12 +19,8 @@ module __test2__ { export class classWithPublicPrivate { constructor(public one: T, private two: U) {} } var x7 = new classWithPublicPrivate(1, "a");; >classWithPublicPrivate : classWithPublicPrivate ->T : T ->U : U >one : T ->T : T >two : U ->U : U >x7 : classWithPublicPrivate >new classWithPublicPrivate(1, "a") : classWithPublicPrivate >classWithPublicPrivate : typeof classWithPublicPrivate diff --git a/tests/baselines/reference/assignmentCompatability43.types b/tests/baselines/reference/assignmentCompatability43.types index 8693eb35fbe..68af6d88275 100644 --- a/tests/baselines/reference/assignmentCompatability43.types +++ b/tests/baselines/reference/assignmentCompatability43.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 @@ -24,15 +18,9 @@ module __test2__ { >__test2__ : typeof __test2__ export interface interfaceTwo { one: T; two: U; }; var obj2: interfaceTwo = { one: 1, two: "a" };; ->interfaceTwo : interfaceTwo ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj2 : interfaceTwo ->interfaceTwo : interfaceTwo >{ one: 1, two: "a" } : { one: number; two: string; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability5.types b/tests/baselines/reference/assignmentCompatability5.types index 755ce16ec69..2273acaabf2 100644 --- a/tests/baselines/reference/assignmentCompatability5.types +++ b/tests/baselines/reference/assignmentCompatability5.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 @@ -24,12 +18,8 @@ module __test2__ { >__test2__ : typeof __test2__ export interface interfaceOne { one: T; }; var obj1: interfaceOne = { one: 1 };; ->interfaceOne : interfaceOne ->T : T >one : T ->T : T >obj1 : interfaceOne ->interfaceOne : interfaceOne >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability6.types b/tests/baselines/reference/assignmentCompatability6.types index d437d5a7469..334ded9f90d 100644 --- a/tests/baselines/reference/assignmentCompatability6.types +++ b/tests/baselines/reference/assignmentCompatability6.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 @@ -24,12 +18,8 @@ module __test2__ { >__test2__ : typeof __test2__ export interface interfaceWithOptional { one?: T; }; var obj3: interfaceWithOptional = { };; ->interfaceWithOptional : interfaceWithOptional ->T : T >one : T ->T : T >obj3 : interfaceWithOptional ->interfaceWithOptional : interfaceWithOptional >{ } : {} export var __val__obj3 = obj3; diff --git a/tests/baselines/reference/assignmentCompatability7.types b/tests/baselines/reference/assignmentCompatability7.types index 3dad9966d83..9f3035a6c00 100644 --- a/tests/baselines/reference/assignmentCompatability7.types +++ b/tests/baselines/reference/assignmentCompatability7.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 @@ -24,15 +18,9 @@ module __test2__ { >__test2__ : typeof __test2__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability8.types b/tests/baselines/reference/assignmentCompatability8.types index d4cc5ebc33e..82c78c7a4c1 100644 --- a/tests/baselines/reference/assignmentCompatability8.types +++ b/tests/baselines/reference/assignmentCompatability8.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 @@ -25,9 +19,7 @@ module __test2__ { export class classWithPublic { constructor(public one: T) {} } var x1 = new classWithPublic(1);; >classWithPublic : classWithPublic ->T : T >one : T ->T : T >x1 : classWithPublic >new classWithPublic(1) : classWithPublic >classWithPublic : typeof classWithPublic diff --git a/tests/baselines/reference/assignmentCompatability9.types b/tests/baselines/reference/assignmentCompatability9.types index 671697f35f7..c640b9d8cf9 100644 --- a/tests/baselines/reference/assignmentCompatability9.types +++ b/tests/baselines/reference/assignmentCompatability9.types @@ -3,15 +3,9 @@ module __test1__ { >__test1__ : typeof __test1__ export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->T : T ->U : U >one : T ->T : T >two : U ->U : U >obj4 : interfaceWithPublicAndOptional ->interfaceWithPublicAndOptional : interfaceWithPublicAndOptional >{ one: 1 } : { one: number; } >one : number >1 : 1 @@ -25,9 +19,7 @@ module __test2__ { export class classWithOptional { constructor(public one?: T) {} } var x3 = new classWithOptional();; >classWithOptional : classWithOptional ->T : T >one : T ->T : T >x3 : classWithOptional >new classWithOptional() : classWithOptional >classWithOptional : typeof classWithOptional diff --git a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.types b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.types index 8d92d936bad..bf093a4b752 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.types +++ b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.types @@ -2,8 +2,6 @@ // 3.8.4 Assignment Compatibility interface Applicable { ->Applicable : Applicable - apply(blah: any); // also works for 'apply' >apply : (blah: any) => any >blah : any @@ -11,7 +9,6 @@ interface Applicable { var x: Applicable; >x : Applicable ->Applicable : Applicable // Should fail x = ''; @@ -47,7 +44,6 @@ x = f; function fn(c: Applicable) { } >fn : (c: Applicable) => void >c : Applicable ->Applicable : Applicable // Should Fail fn(''); diff --git a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.types b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.types index 7b512d28fe9..20420a7ce39 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.types +++ b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.types @@ -2,8 +2,6 @@ // 3.8.4 Assignment Compatibility interface Callable { ->Callable : Callable - call(blah: any); // also works for 'apply' >call : (blah: any) => any >blah : any @@ -11,7 +9,6 @@ interface Callable { var x: Callable; >x : Callable ->Callable : Callable // Should fail x = ''; @@ -47,7 +44,6 @@ x = f; function fn(c: Callable) { } >fn : (c: Callable) => void >c : Callable ->Callable : Callable // Should Fail fn(''); diff --git a/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.types b/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.types index fab8e2baae6..bb224950e8f 100644 --- a/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.types +++ b/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.types @@ -1,21 +1,16 @@ === tests/cases/compiler/assignmentCompatibilityForConstrainedTypeParameters.ts === function foo() { >foo : () => void ->T : T >bar : string function bar() { >bar : () => void ->S : S ->T : T var x: S; >x : S ->S : S var y: T; >y : T ->T : T y = x; >y = x : S diff --git a/tests/baselines/reference/assignmentNonObjectTypeConstraints.types b/tests/baselines/reference/assignmentNonObjectTypeConstraints.types index 2037d058aff..06af56203d4 100644 --- a/tests/baselines/reference/assignmentNonObjectTypeConstraints.types +++ b/tests/baselines/reference/assignmentNonObjectTypeConstraints.types @@ -7,9 +7,7 @@ const enum E { A, B, C } function foo(x: T) { >foo : (x: T) => void ->T : T >x : T ->T : T var y: number = x; // Ok >y : number @@ -38,16 +36,10 @@ class B { b } function bar(x: T) { >bar : (x: T) => void ->T : T ->A : A ->B : B >x : T ->T : T var y: A | B = x; // Ok >y : A | B ->A : A ->B : B >x : T } diff --git a/tests/baselines/reference/assignmentStricterConstraints.types b/tests/baselines/reference/assignmentStricterConstraints.types index c1a7c86c744..dfbc3f66352 100644 --- a/tests/baselines/reference/assignmentStricterConstraints.types +++ b/tests/baselines/reference/assignmentStricterConstraints.types @@ -2,13 +2,8 @@ var f = function (x: T, y: S): void { >f : (x: T, y: S) => void >function (x: T, y: S): void { x = y} : (x: T, y: S) => void ->T : T ->S : S ->T : T >x : T ->T : T >y : S ->S : S x = y >x = y : S @@ -19,12 +14,8 @@ var f = function (x: T, y: S): void { var g = function (x: T, y: S): void { } >g : (x: T, y: S) => void >function (x: T, y: S): void { } : (x: T, y: S) => void ->T : T ->S : S >x : T ->T : T >y : S ->S : S g = f >g = f : (x: T, y: S) => void diff --git a/tests/baselines/reference/assignmentToObject.types b/tests/baselines/reference/assignmentToObject.types index f39b1210c01..56b396d9e42 100644 --- a/tests/baselines/reference/assignmentToObject.types +++ b/tests/baselines/reference/assignmentToObject.types @@ -11,6 +11,5 @@ var b: {} = a; // ok var c: Object = a; // should be error >c : Object ->Object : Object >a : { toString: number; } diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.types b/tests/baselines/reference/assignmentToObjectAndFunction.types index d7c6a4f4b12..882eb29ecd1 100644 --- a/tests/baselines/reference/assignmentToObjectAndFunction.types +++ b/tests/baselines/reference/assignmentToObjectAndFunction.types @@ -1,14 +1,12 @@ === tests/cases/compiler/assignmentToObjectAndFunction.ts === var errObj: Object = { toString: 0 }; // Error, incompatible toString >errObj : Object ->Object : Object >{ toString: 0 } : { toString: number; } >toString : number >0 : 0 var goodObj: Object = { >goodObj : Object ->Object : Object >{ toString(x?) { return ""; }} : { toString(x?: any): string; } toString(x?) { @@ -22,7 +20,6 @@ var goodObj: Object = { var errFun: Function = {}; // Error for no call signature >errFun : Function ->Function : Function >{} : {} function foo() { } @@ -38,7 +35,6 @@ module foo { var goodFundule: Function = foo; // ok >goodFundule : Function ->Function : Function >foo : typeof foo function bar() { } @@ -55,7 +51,6 @@ module bar { var goodFundule2: Function = bar; // ok >goodFundule2 : Function ->Function : Function >bar : typeof bar function bad() { } @@ -71,6 +66,5 @@ module bad { var badFundule: Function = bad; // error >badFundule : Function ->Function : Function >bad : typeof bad diff --git a/tests/baselines/reference/assignmentToReferenceTypes.types b/tests/baselines/reference/assignmentToReferenceTypes.types index 78c5e283368..e45fd99363d 100644 --- a/tests/baselines/reference/assignmentToReferenceTypes.types +++ b/tests/baselines/reference/assignmentToReferenceTypes.types @@ -2,7 +2,6 @@ // Should all be allowed module M { ->M : any } M = null; >M = null : null diff --git a/tests/baselines/reference/assignmentTypeNarrowing.types b/tests/baselines/reference/assignmentTypeNarrowing.types index a945084a459..2e2e6ad44eb 100644 --- a/tests/baselines/reference/assignmentTypeNarrowing.types +++ b/tests/baselines/reference/assignmentTypeNarrowing.types @@ -1,7 +1,6 @@ === tests/cases/conformance/expressions/assignmentOperator/assignmentTypeNarrowing.ts === let x: string | number | boolean | RegExp; >x : string | number | boolean | RegExp ->RegExp : RegExp x = ""; >x = "" : "" diff --git a/tests/baselines/reference/assignments.types b/tests/baselines/reference/assignments.types index 70d034a4101..f83b6eadbe0 100644 --- a/tests/baselines/reference/assignments.types +++ b/tests/baselines/reference/assignments.types @@ -9,8 +9,6 @@ // Assign to an interface module M { } ->M : any - M = null; // Error >M = null : null >M : any @@ -67,8 +65,6 @@ function fn2(p) { } interface I { } ->I : I - I = null; // Error >I = null : null >I : any diff --git a/tests/baselines/reference/asyncAliasReturnType_es5.types b/tests/baselines/reference/asyncAliasReturnType_es5.types index 2b8b576a4d3..87090b795e3 100644 --- a/tests/baselines/reference/asyncAliasReturnType_es5.types +++ b/tests/baselines/reference/asyncAliasReturnType_es5.types @@ -1,11 +1,7 @@ === tests/cases/conformance/async/es5/asyncAliasReturnType_es5.ts === type PromiseAlias = Promise; >PromiseAlias : Promise ->T : T ->Promise : Promise ->T : T async function f(): PromiseAlias { >f : () => Promise ->PromiseAlias : Promise } diff --git a/tests/baselines/reference/asyncAliasReturnType_es6.types b/tests/baselines/reference/asyncAliasReturnType_es6.types index 8426d2a3542..85d74896056 100644 --- a/tests/baselines/reference/asyncAliasReturnType_es6.types +++ b/tests/baselines/reference/asyncAliasReturnType_es6.types @@ -1,11 +1,7 @@ === tests/cases/conformance/async/es6/asyncAliasReturnType_es6.ts === type PromiseAlias = Promise; >PromiseAlias : Promise ->T : T ->Promise : Promise ->T : T async function f(): PromiseAlias { >f : () => Promise ->PromiseAlias : Promise } diff --git a/tests/baselines/reference/asyncArrowFunction10_es2017.types b/tests/baselines/reference/asyncArrowFunction10_es2017.types index b9a95c7189b..c03dff71b2c 100644 --- a/tests/baselines/reference/asyncArrowFunction10_es2017.types +++ b/tests/baselines/reference/asyncArrowFunction10_es2017.types @@ -2,11 +2,9 @@ var foo = async (): Promise => { >foo : () => Promise >async (): Promise => { // Legal to use 'await' in a type context. var v: await;} : () => Promise ->Promise : Promise // Legal to use 'await' in a type context. var v: await; >v : any ->await : No type information available! } diff --git a/tests/baselines/reference/asyncArrowFunction10_es5.types b/tests/baselines/reference/asyncArrowFunction10_es5.types index a1c02c7b6fd..89b51279710 100644 --- a/tests/baselines/reference/asyncArrowFunction10_es5.types +++ b/tests/baselines/reference/asyncArrowFunction10_es5.types @@ -2,11 +2,9 @@ var foo = async (): Promise => { >foo : () => Promise >async (): Promise => { // Legal to use 'await' in a type context. var v: await;} : () => Promise ->Promise : Promise // Legal to use 'await' in a type context. var v: await; >v : any ->await : No type information available! } diff --git a/tests/baselines/reference/asyncArrowFunction10_es6.types b/tests/baselines/reference/asyncArrowFunction10_es6.types index 85a55d92479..36207135e68 100644 --- a/tests/baselines/reference/asyncArrowFunction10_es6.types +++ b/tests/baselines/reference/asyncArrowFunction10_es6.types @@ -2,11 +2,9 @@ var foo = async (): Promise => { >foo : () => Promise >async (): Promise => { // Legal to use 'await' in a type context. var v: await;} : () => Promise ->Promise : Promise // Legal to use 'await' in a type context. var v: await; >v : any ->await : No type information available! } diff --git a/tests/baselines/reference/asyncArrowFunction1_es2017.types b/tests/baselines/reference/asyncArrowFunction1_es2017.types index 3f2c057e61f..096ab2eacbe 100644 --- a/tests/baselines/reference/asyncArrowFunction1_es2017.types +++ b/tests/baselines/reference/asyncArrowFunction1_es2017.types @@ -2,6 +2,5 @@ var foo = async (): Promise => { >foo : () => Promise >async (): Promise => {} : () => Promise ->Promise : Promise }; diff --git a/tests/baselines/reference/asyncArrowFunction1_es5.types b/tests/baselines/reference/asyncArrowFunction1_es5.types index 062cfd88974..65c278d72bd 100644 --- a/tests/baselines/reference/asyncArrowFunction1_es5.types +++ b/tests/baselines/reference/asyncArrowFunction1_es5.types @@ -2,6 +2,5 @@ var foo = async (): Promise => { >foo : () => Promise >async (): Promise => {} : () => Promise ->Promise : Promise }; diff --git a/tests/baselines/reference/asyncArrowFunction1_es6.types b/tests/baselines/reference/asyncArrowFunction1_es6.types index f3c5d0887f1..377a21558ef 100644 --- a/tests/baselines/reference/asyncArrowFunction1_es6.types +++ b/tests/baselines/reference/asyncArrowFunction1_es6.types @@ -2,6 +2,5 @@ var foo = async (): Promise => { >foo : () => Promise >async (): Promise => {} : () => Promise ->Promise : Promise }; diff --git a/tests/baselines/reference/asyncArrowFunction6_es2017.types b/tests/baselines/reference/asyncArrowFunction6_es2017.types index d1d8b98944f..e6da9771b74 100644 --- a/tests/baselines/reference/asyncArrowFunction6_es2017.types +++ b/tests/baselines/reference/asyncArrowFunction6_es2017.types @@ -5,5 +5,4 @@ var foo = async (a = await): Promise => { >a : any >await : any > : any ->Promise : Promise } diff --git a/tests/baselines/reference/asyncArrowFunction6_es5.types b/tests/baselines/reference/asyncArrowFunction6_es5.types index d5458c6bc1c..9b1ff5a8ecf 100644 --- a/tests/baselines/reference/asyncArrowFunction6_es5.types +++ b/tests/baselines/reference/asyncArrowFunction6_es5.types @@ -5,5 +5,4 @@ var foo = async (a = await): Promise => { >a : any >await : any > : any ->Promise : Promise } diff --git a/tests/baselines/reference/asyncArrowFunction6_es6.types b/tests/baselines/reference/asyncArrowFunction6_es6.types index 66957807462..43f2914a353 100644 --- a/tests/baselines/reference/asyncArrowFunction6_es6.types +++ b/tests/baselines/reference/asyncArrowFunction6_es6.types @@ -5,5 +5,4 @@ var foo = async (a = await): Promise => { >a : any >await : any > : any ->Promise : Promise } diff --git a/tests/baselines/reference/asyncArrowFunction7_es2017.types b/tests/baselines/reference/asyncArrowFunction7_es2017.types index 48c2195dec5..233be1873b2 100644 --- a/tests/baselines/reference/asyncArrowFunction7_es2017.types +++ b/tests/baselines/reference/asyncArrowFunction7_es2017.types @@ -2,7 +2,6 @@ var bar = async (): Promise => { >bar : () => Promise >async (): Promise => { // 'await' here is an identifier, and not an await expression. var foo = async (a = await): Promise => { }} : () => Promise ->Promise : Promise // 'await' here is an identifier, and not an await expression. var foo = async (a = await): Promise => { @@ -11,6 +10,5 @@ var bar = async (): Promise => { >a : any >await : any > : any ->Promise : Promise } } diff --git a/tests/baselines/reference/asyncArrowFunction7_es5.types b/tests/baselines/reference/asyncArrowFunction7_es5.types index cb468123db7..e65f6c1646e 100644 --- a/tests/baselines/reference/asyncArrowFunction7_es5.types +++ b/tests/baselines/reference/asyncArrowFunction7_es5.types @@ -2,7 +2,6 @@ var bar = async (): Promise => { >bar : () => Promise >async (): Promise => { // 'await' here is an identifier, and not an await expression. var foo = async (a = await): Promise => { }} : () => Promise ->Promise : Promise // 'await' here is an identifier, and not an await expression. var foo = async (a = await): Promise => { @@ -11,6 +10,5 @@ var bar = async (): Promise => { >a : any >await : any > : any ->Promise : Promise } } diff --git a/tests/baselines/reference/asyncArrowFunction7_es6.types b/tests/baselines/reference/asyncArrowFunction7_es6.types index 8687451f03b..1ad05e652a8 100644 --- a/tests/baselines/reference/asyncArrowFunction7_es6.types +++ b/tests/baselines/reference/asyncArrowFunction7_es6.types @@ -2,7 +2,6 @@ var bar = async (): Promise => { >bar : () => Promise >async (): Promise => { // 'await' here is an identifier, and not an await expression. var foo = async (a = await): Promise => { }} : () => Promise ->Promise : Promise // 'await' here is an identifier, and not an await expression. var foo = async (a = await): Promise => { @@ -11,6 +10,5 @@ var bar = async (): Promise => { >a : any >await : any > : any ->Promise : Promise } } diff --git a/tests/baselines/reference/asyncArrowFunction8_es2017.types b/tests/baselines/reference/asyncArrowFunction8_es2017.types index 9e8ca263df4..df476cab5c3 100644 --- a/tests/baselines/reference/asyncArrowFunction8_es2017.types +++ b/tests/baselines/reference/asyncArrowFunction8_es2017.types @@ -2,7 +2,6 @@ var foo = async (): Promise => { >foo : () => Promise >async (): Promise => { var v = { [await]: foo }} : () => Promise ->Promise : Promise var v = { [await]: foo } >v : { [x: number]: () => Promise; } diff --git a/tests/baselines/reference/asyncArrowFunction8_es5.types b/tests/baselines/reference/asyncArrowFunction8_es5.types index 8fd40113995..05095f154fc 100644 --- a/tests/baselines/reference/asyncArrowFunction8_es5.types +++ b/tests/baselines/reference/asyncArrowFunction8_es5.types @@ -2,7 +2,6 @@ var foo = async (): Promise => { >foo : () => Promise >async (): Promise => { var v = { [await]: foo }} : () => Promise ->Promise : Promise var v = { [await]: foo } >v : { [x: number]: () => Promise; } diff --git a/tests/baselines/reference/asyncArrowFunction8_es6.types b/tests/baselines/reference/asyncArrowFunction8_es6.types index 7c53be7843e..89545c2fa84 100644 --- a/tests/baselines/reference/asyncArrowFunction8_es6.types +++ b/tests/baselines/reference/asyncArrowFunction8_es6.types @@ -2,7 +2,6 @@ var foo = async (): Promise => { >foo : () => Promise >async (): Promise => { var v = { [await]: foo }} : () => Promise ->Promise : Promise var v = { [await]: foo } >v : { [x: number]: () => Promise; } diff --git a/tests/baselines/reference/asyncAwaitIsolatedModules_es2017.types b/tests/baselines/reference/asyncAwaitIsolatedModules_es2017.types index b4619989757..24fb4ce9a81 100644 --- a/tests/baselines/reference/asyncAwaitIsolatedModules_es2017.types +++ b/tests/baselines/reference/asyncAwaitIsolatedModules_es2017.types @@ -4,22 +4,18 @@ import { MyPromise } from "missing"; declare var p: Promise; >p : Promise ->Promise : Promise declare var mp: MyPromise; >mp : any ->MyPromise : any async function f0() { } >f0 : () => Promise async function f1(): Promise { } >f1 : () => Promise ->Promise : Promise async function f3(): MyPromise { } >f3 : () => any ->MyPromise : any let f4 = async function() { } >f4 : () => Promise @@ -28,12 +24,10 @@ let f4 = async function() { } let f5 = async function(): Promise { } >f5 : () => Promise >async function(): Promise { } : () => Promise ->Promise : Promise let f6 = async function(): MyPromise { } >f6 : () => any >async function(): MyPromise { } : () => any ->MyPromise : any let f7 = async () => { }; >f7 : () => Promise @@ -42,12 +36,10 @@ let f7 = async () => { }; let f8 = async (): Promise => { }; >f8 : () => Promise >async (): Promise => { } : () => Promise ->Promise : Promise let f9 = async (): MyPromise => { }; >f9 : () => any >async (): MyPromise => { } : () => any ->MyPromise : any let f10 = async () => p; >f10 : () => Promise @@ -62,13 +54,11 @@ let f11 = async () => mp; let f12 = async (): Promise => mp; >f12 : () => Promise >async (): Promise => mp : () => Promise ->Promise : Promise >mp : any let f13 = async (): MyPromise => p; >f13 : () => any >async (): MyPromise => p : () => any ->MyPromise : any >p : Promise let o = { @@ -80,11 +70,9 @@ let o = { async m2(): Promise { }, >m2 : () => Promise ->Promise : Promise async m3(): MyPromise { } >m3 : () => any ->MyPromise : any }; @@ -96,22 +84,18 @@ class C { async m2(): Promise { } >m2 : () => Promise ->Promise : Promise async m3(): MyPromise { } >m3 : () => any ->MyPromise : any static async m4() { } >m4 : () => Promise static async m5(): Promise { } >m5 : () => Promise ->Promise : Promise static async m6(): MyPromise { } >m6 : () => any ->MyPromise : any } module M { diff --git a/tests/baselines/reference/asyncAwaitIsolatedModules_es5.types b/tests/baselines/reference/asyncAwaitIsolatedModules_es5.types index 8630666ec62..cf6aa2eada1 100644 --- a/tests/baselines/reference/asyncAwaitIsolatedModules_es5.types +++ b/tests/baselines/reference/asyncAwaitIsolatedModules_es5.types @@ -4,22 +4,18 @@ import { MyPromise } from "missing"; declare var p: Promise; >p : Promise ->Promise : Promise declare var mp: MyPromise; >mp : any ->MyPromise : any async function f0() { } >f0 : () => Promise async function f1(): Promise { } >f1 : () => Promise ->Promise : Promise async function f3(): MyPromise { } >f3 : () => any ->MyPromise : any let f4 = async function() { } >f4 : () => Promise @@ -28,12 +24,10 @@ let f4 = async function() { } let f5 = async function(): Promise { } >f5 : () => Promise >async function(): Promise { } : () => Promise ->Promise : Promise let f6 = async function(): MyPromise { } >f6 : () => any >async function(): MyPromise { } : () => any ->MyPromise : any let f7 = async () => { }; >f7 : () => Promise @@ -42,12 +36,10 @@ let f7 = async () => { }; let f8 = async (): Promise => { }; >f8 : () => Promise >async (): Promise => { } : () => Promise ->Promise : Promise let f9 = async (): MyPromise => { }; >f9 : () => any >async (): MyPromise => { } : () => any ->MyPromise : any let f10 = async () => p; >f10 : () => Promise @@ -62,13 +54,11 @@ let f11 = async () => mp; let f12 = async (): Promise => mp; >f12 : () => Promise >async (): Promise => mp : () => Promise ->Promise : Promise >mp : any let f13 = async (): MyPromise => p; >f13 : () => any >async (): MyPromise => p : () => any ->MyPromise : any >p : Promise let o = { @@ -80,11 +70,9 @@ let o = { async m2(): Promise { }, >m2 : () => Promise ->Promise : Promise async m3(): MyPromise { } >m3 : () => any ->MyPromise : any }; @@ -96,22 +84,18 @@ class C { async m2(): Promise { } >m2 : () => Promise ->Promise : Promise async m3(): MyPromise { } >m3 : () => any ->MyPromise : any static async m4() { } >m4 : () => Promise static async m5(): Promise { } >m5 : () => Promise ->Promise : Promise static async m6(): MyPromise { } >m6 : () => any ->MyPromise : any } module M { diff --git a/tests/baselines/reference/asyncAwaitIsolatedModules_es6.types b/tests/baselines/reference/asyncAwaitIsolatedModules_es6.types index 7c2d9d0fa0b..a847c040191 100644 --- a/tests/baselines/reference/asyncAwaitIsolatedModules_es6.types +++ b/tests/baselines/reference/asyncAwaitIsolatedModules_es6.types @@ -4,22 +4,18 @@ import { MyPromise } from "missing"; declare var p: Promise; >p : Promise ->Promise : Promise declare var mp: MyPromise; >mp : any ->MyPromise : any async function f0() { } >f0 : () => Promise async function f1(): Promise { } >f1 : () => Promise ->Promise : Promise async function f3(): MyPromise { } >f3 : () => any ->MyPromise : any let f4 = async function() { } >f4 : () => Promise @@ -28,12 +24,10 @@ let f4 = async function() { } let f5 = async function(): Promise { } >f5 : () => Promise >async function(): Promise { } : () => Promise ->Promise : Promise let f6 = async function(): MyPromise { } >f6 : () => any >async function(): MyPromise { } : () => any ->MyPromise : any let f7 = async () => { }; >f7 : () => Promise @@ -42,12 +36,10 @@ let f7 = async () => { }; let f8 = async (): Promise => { }; >f8 : () => Promise >async (): Promise => { } : () => Promise ->Promise : Promise let f9 = async (): MyPromise => { }; >f9 : () => any >async (): MyPromise => { } : () => any ->MyPromise : any let f10 = async () => p; >f10 : () => Promise @@ -62,13 +54,11 @@ let f11 = async () => mp; let f12 = async (): Promise => mp; >f12 : () => Promise >async (): Promise => mp : () => Promise ->Promise : Promise >mp : any let f13 = async (): MyPromise => p; >f13 : () => any >async (): MyPromise => p : () => any ->MyPromise : any >p : Promise let o = { @@ -80,11 +70,9 @@ let o = { async m2(): Promise { }, >m2 : () => Promise ->Promise : Promise async m3(): MyPromise { } >m3 : () => any ->MyPromise : any }; @@ -96,22 +84,18 @@ class C { async m2(): Promise { } >m2 : () => Promise ->Promise : Promise async m3(): MyPromise { } >m3 : () => any ->MyPromise : any static async m4() { } >m4 : () => Promise static async m5(): Promise { } >m5 : () => Promise ->Promise : Promise static async m6(): MyPromise { } >m6 : () => any ->MyPromise : any } module M { diff --git a/tests/baselines/reference/asyncAwaitNestedClasses_es5.types b/tests/baselines/reference/asyncAwaitNestedClasses_es5.types index fd61951d5cc..40f0e5ce9b9 100644 --- a/tests/baselines/reference/asyncAwaitNestedClasses_es5.types +++ b/tests/baselines/reference/asyncAwaitNestedClasses_es5.types @@ -10,7 +10,6 @@ class A { static func2(): Promise { >func2 : () => Promise ->Promise : Promise return new Promise((resolve) => { resolve(null); }); >new Promise((resolve) => { resolve(null); }) : Promise diff --git a/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar.types b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar.types index 424959ddb22..865fe3550b0 100644 --- a/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar.types +++ b/tests/baselines/reference/asyncAwaitWithCapturedBlockScopeVar.types @@ -95,7 +95,6 @@ async function fn3() { async function fn4(): Promise { >fn4 : () => Promise ->Promise : Promise let ar = []; >ar : any[] diff --git a/tests/baselines/reference/asyncAwait_es2017.types b/tests/baselines/reference/asyncAwait_es2017.types index 42b54aa56be..4d657ab2ca3 100644 --- a/tests/baselines/reference/asyncAwait_es2017.types +++ b/tests/baselines/reference/asyncAwait_es2017.types @@ -1,9 +1,6 @@ === tests/cases/conformance/async/es2017/asyncAwait_es2017.ts === type MyPromise = Promise; >MyPromise : Promise ->T : T ->Promise : Promise ->T : T declare var MyPromise: typeof Promise; >MyPromise : PromiseConstructor @@ -11,22 +8,18 @@ declare var MyPromise: typeof Promise; declare var p: Promise; >p : Promise ->Promise : Promise declare var mp: MyPromise; >mp : Promise ->MyPromise : Promise async function f0() { } >f0 : () => Promise async function f1(): Promise { } >f1 : () => Promise ->Promise : Promise async function f3(): MyPromise { } >f3 : () => Promise ->MyPromise : Promise let f4 = async function() { } >f4 : () => Promise @@ -35,12 +28,10 @@ let f4 = async function() { } let f5 = async function(): Promise { } >f5 : () => Promise >async function(): Promise { } : () => Promise ->Promise : Promise let f6 = async function(): MyPromise { } >f6 : () => Promise >async function(): MyPromise { } : () => Promise ->MyPromise : Promise let f7 = async () => { }; >f7 : () => Promise @@ -49,12 +40,10 @@ let f7 = async () => { }; let f8 = async (): Promise => { }; >f8 : () => Promise >async (): Promise => { } : () => Promise ->Promise : Promise let f9 = async (): MyPromise => { }; >f9 : () => Promise >async (): MyPromise => { } : () => Promise ->MyPromise : Promise let f10 = async () => p; >f10 : () => Promise @@ -69,13 +58,11 @@ let f11 = async () => mp; let f12 = async (): Promise => mp; >f12 : () => Promise >async (): Promise => mp : () => Promise ->Promise : Promise >mp : Promise let f13 = async (): MyPromise => p; >f13 : () => Promise >async (): MyPromise => p : () => Promise ->MyPromise : Promise >p : Promise let o = { @@ -87,11 +74,9 @@ let o = { async m2(): Promise { }, >m2 : () => Promise ->Promise : Promise async m3(): MyPromise { } >m3 : () => Promise ->MyPromise : Promise }; @@ -103,22 +88,18 @@ class C { async m2(): Promise { } >m2 : () => Promise ->Promise : Promise async m3(): MyPromise { } >m3 : () => Promise ->MyPromise : Promise static async m4() { } >m4 : () => Promise static async m5(): Promise { } >m5 : () => Promise ->Promise : Promise static async m6(): MyPromise { } >m6 : () => Promise ->MyPromise : Promise } module M { diff --git a/tests/baselines/reference/asyncAwait_es5.types b/tests/baselines/reference/asyncAwait_es5.types index 6be39599fa1..fb10a6dd043 100644 --- a/tests/baselines/reference/asyncAwait_es5.types +++ b/tests/baselines/reference/asyncAwait_es5.types @@ -1,9 +1,6 @@ === tests/cases/conformance/async/es5/asyncAwait_es5.ts === type MyPromise = Promise; >MyPromise : Promise ->T : T ->Promise : Promise ->T : T declare var MyPromise: typeof Promise; >MyPromise : PromiseConstructor @@ -11,22 +8,18 @@ declare var MyPromise: typeof Promise; declare var p: Promise; >p : Promise ->Promise : Promise declare var mp: MyPromise; >mp : Promise ->MyPromise : Promise async function f0() { } >f0 : () => Promise async function f1(): Promise { } >f1 : () => Promise ->Promise : Promise async function f3(): MyPromise { } >f3 : () => Promise ->MyPromise : Promise let f4 = async function() { } >f4 : () => Promise @@ -35,12 +28,10 @@ let f4 = async function() { } let f5 = async function(): Promise { } >f5 : () => Promise >async function(): Promise { } : () => Promise ->Promise : Promise let f6 = async function(): MyPromise { } >f6 : () => Promise >async function(): MyPromise { } : () => Promise ->MyPromise : Promise let f7 = async () => { }; >f7 : () => Promise @@ -49,12 +40,10 @@ let f7 = async () => { }; let f8 = async (): Promise => { }; >f8 : () => Promise >async (): Promise => { } : () => Promise ->Promise : Promise let f9 = async (): MyPromise => { }; >f9 : () => Promise >async (): MyPromise => { } : () => Promise ->MyPromise : Promise let f10 = async () => p; >f10 : () => Promise @@ -69,13 +58,11 @@ let f11 = async () => mp; let f12 = async (): Promise => mp; >f12 : () => Promise >async (): Promise => mp : () => Promise ->Promise : Promise >mp : Promise let f13 = async (): MyPromise => p; >f13 : () => Promise >async (): MyPromise => p : () => Promise ->MyPromise : Promise >p : Promise let o = { @@ -87,11 +74,9 @@ let o = { async m2(): Promise { }, >m2 : () => Promise ->Promise : Promise async m3(): MyPromise { } >m3 : () => Promise ->MyPromise : Promise }; @@ -103,22 +88,18 @@ class C { async m2(): Promise { } >m2 : () => Promise ->Promise : Promise async m3(): MyPromise { } >m3 : () => Promise ->MyPromise : Promise static async m4() { } >m4 : () => Promise static async m5(): Promise { } >m5 : () => Promise ->Promise : Promise static async m6(): MyPromise { } >m6 : () => Promise ->MyPromise : Promise } module M { diff --git a/tests/baselines/reference/asyncAwait_es6.types b/tests/baselines/reference/asyncAwait_es6.types index de6b7177e42..cd9a05ee48e 100644 --- a/tests/baselines/reference/asyncAwait_es6.types +++ b/tests/baselines/reference/asyncAwait_es6.types @@ -1,9 +1,6 @@ === tests/cases/conformance/async/es6/asyncAwait_es6.ts === type MyPromise = Promise; >MyPromise : Promise ->T : T ->Promise : Promise ->T : T declare var MyPromise: typeof Promise; >MyPromise : PromiseConstructor @@ -11,22 +8,18 @@ declare var MyPromise: typeof Promise; declare var p: Promise; >p : Promise ->Promise : Promise declare var mp: MyPromise; >mp : Promise ->MyPromise : Promise async function f0() { } >f0 : () => Promise async function f1(): Promise { } >f1 : () => Promise ->Promise : Promise async function f3(): MyPromise { } >f3 : () => Promise ->MyPromise : Promise let f4 = async function() { } >f4 : () => Promise @@ -35,12 +28,10 @@ let f4 = async function() { } let f5 = async function(): Promise { } >f5 : () => Promise >async function(): Promise { } : () => Promise ->Promise : Promise let f6 = async function(): MyPromise { } >f6 : () => Promise >async function(): MyPromise { } : () => Promise ->MyPromise : Promise let f7 = async () => { }; >f7 : () => Promise @@ -49,12 +40,10 @@ let f7 = async () => { }; let f8 = async (): Promise => { }; >f8 : () => Promise >async (): Promise => { } : () => Promise ->Promise : Promise let f9 = async (): MyPromise => { }; >f9 : () => Promise >async (): MyPromise => { } : () => Promise ->MyPromise : Promise let f10 = async () => p; >f10 : () => Promise @@ -69,13 +58,11 @@ let f11 = async () => mp; let f12 = async (): Promise => mp; >f12 : () => Promise >async (): Promise => mp : () => Promise ->Promise : Promise >mp : Promise let f13 = async (): MyPromise => p; >f13 : () => Promise >async (): MyPromise => p : () => Promise ->MyPromise : Promise >p : Promise let o = { @@ -87,11 +74,9 @@ let o = { async m2(): Promise { }, >m2 : () => Promise ->Promise : Promise async m3(): MyPromise { } >m3 : () => Promise ->MyPromise : Promise }; @@ -103,22 +88,18 @@ class C { async m2(): Promise { } >m2 : () => Promise ->Promise : Promise async m3(): MyPromise { } >m3 : () => Promise ->MyPromise : Promise static async m4() { } >m4 : () => Promise static async m5(): Promise { } >m5 : () => Promise ->Promise : Promise static async m6(): MyPromise { } >m6 : () => Promise ->MyPromise : Promise } module M { diff --git a/tests/baselines/reference/asyncDeclare_es5.types b/tests/baselines/reference/asyncDeclare_es5.types index 91f034324eb..6329d72ec7d 100644 --- a/tests/baselines/reference/asyncDeclare_es5.types +++ b/tests/baselines/reference/asyncDeclare_es5.types @@ -1,5 +1,4 @@ === tests/cases/conformance/async/es5/asyncDeclare_es5.ts === declare async function foo(): Promise; >foo : () => Promise ->Promise : Promise diff --git a/tests/baselines/reference/asyncDeclare_es6.types b/tests/baselines/reference/asyncDeclare_es6.types index b4cb50157a3..384240cd1c9 100644 --- a/tests/baselines/reference/asyncDeclare_es6.types +++ b/tests/baselines/reference/asyncDeclare_es6.types @@ -1,5 +1,4 @@ === tests/cases/conformance/async/es6/asyncDeclare_es6.ts === declare async function foo(): Promise; >foo : () => Promise ->Promise : Promise diff --git a/tests/baselines/reference/asyncFunctionDeclaration11_es2017.types b/tests/baselines/reference/asyncFunctionDeclaration11_es2017.types index b86601bf33d..0ddbebfd337 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration11_es2017.types +++ b/tests/baselines/reference/asyncFunctionDeclaration11_es2017.types @@ -1,5 +1,4 @@ === tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration11_es2017.ts === async function await(): Promise { >await : () => Promise ->Promise : Promise } diff --git a/tests/baselines/reference/asyncFunctionDeclaration11_es5.types b/tests/baselines/reference/asyncFunctionDeclaration11_es5.types index fdda0b0a084..28db2d69bff 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration11_es5.types +++ b/tests/baselines/reference/asyncFunctionDeclaration11_es5.types @@ -1,5 +1,4 @@ === tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration11_es5.ts === async function await(): Promise { >await : () => Promise ->Promise : Promise } diff --git a/tests/baselines/reference/asyncFunctionDeclaration11_es6.types b/tests/baselines/reference/asyncFunctionDeclaration11_es6.types index 65896e7b3b5..22afecd2566 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration11_es6.types +++ b/tests/baselines/reference/asyncFunctionDeclaration11_es6.types @@ -1,5 +1,4 @@ === tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration11_es6.ts === async function await(): Promise { >await : () => Promise ->Promise : Promise } diff --git a/tests/baselines/reference/asyncFunctionDeclaration12_es2017.types b/tests/baselines/reference/asyncFunctionDeclaration12_es2017.types index 5f4155c4975..46fd50a46e3 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration12_es2017.types +++ b/tests/baselines/reference/asyncFunctionDeclaration12_es2017.types @@ -4,5 +4,4 @@ var v = async function await(): Promise { } >async function : () => any >await : any >(): Promise { } : () => Promise ->Promise : Promise diff --git a/tests/baselines/reference/asyncFunctionDeclaration12_es5.types b/tests/baselines/reference/asyncFunctionDeclaration12_es5.types index c7e3a6feeb5..1432adc522d 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration12_es5.types +++ b/tests/baselines/reference/asyncFunctionDeclaration12_es5.types @@ -4,5 +4,4 @@ var v = async function await(): Promise { } >async function : () => any >await : any >(): Promise { } : () => Promise ->Promise : Promise diff --git a/tests/baselines/reference/asyncFunctionDeclaration12_es6.types b/tests/baselines/reference/asyncFunctionDeclaration12_es6.types index 4eb4fcde054..251b01f7dc0 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration12_es6.types +++ b/tests/baselines/reference/asyncFunctionDeclaration12_es6.types @@ -4,5 +4,4 @@ var v = async function await(): Promise { } >async function : () => any >await : any >(): Promise { } : () => Promise ->Promise : Promise diff --git a/tests/baselines/reference/asyncFunctionDeclaration13_es2017.types b/tests/baselines/reference/asyncFunctionDeclaration13_es2017.types index c93c19da496..0aff4cfd564 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration13_es2017.types +++ b/tests/baselines/reference/asyncFunctionDeclaration13_es2017.types @@ -1,11 +1,9 @@ === tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration13_es2017.ts === async function foo(): Promise { >foo : () => Promise ->Promise : Promise // Legal to use 'await' in a type context. var v: await; >v : any ->await : No type information available! } diff --git a/tests/baselines/reference/asyncFunctionDeclaration13_es5.types b/tests/baselines/reference/asyncFunctionDeclaration13_es5.types index c8ec02c275d..6d8dec2ddbf 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration13_es5.types +++ b/tests/baselines/reference/asyncFunctionDeclaration13_es5.types @@ -1,11 +1,9 @@ === tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration13_es5.ts === async function foo(): Promise { >foo : () => Promise ->Promise : Promise // Legal to use 'await' in a type context. var v: await; >v : any ->await : No type information available! } diff --git a/tests/baselines/reference/asyncFunctionDeclaration13_es6.types b/tests/baselines/reference/asyncFunctionDeclaration13_es6.types index 7e963caab85..8ea5795be3c 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration13_es6.types +++ b/tests/baselines/reference/asyncFunctionDeclaration13_es6.types @@ -1,11 +1,9 @@ === tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration13_es6.ts === async function foo(): Promise { >foo : () => Promise ->Promise : Promise // Legal to use 'await' in a type context. var v: await; >v : any ->await : No type information available! } diff --git a/tests/baselines/reference/asyncFunctionDeclaration14_es2017.types b/tests/baselines/reference/asyncFunctionDeclaration14_es2017.types index 1e505f93a2c..aca13d27113 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration14_es2017.types +++ b/tests/baselines/reference/asyncFunctionDeclaration14_es2017.types @@ -1,7 +1,6 @@ === tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration14_es2017.ts === async function foo(): Promise { >foo : () => Promise ->Promise : Promise return; } diff --git a/tests/baselines/reference/asyncFunctionDeclaration14_es5.types b/tests/baselines/reference/asyncFunctionDeclaration14_es5.types index 5c2575c9cc9..04c18734bc0 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration14_es5.types +++ b/tests/baselines/reference/asyncFunctionDeclaration14_es5.types @@ -1,7 +1,6 @@ === tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration14_es5.ts === async function foo(): Promise { >foo : () => Promise ->Promise : Promise return; } diff --git a/tests/baselines/reference/asyncFunctionDeclaration14_es6.types b/tests/baselines/reference/asyncFunctionDeclaration14_es6.types index 7727ffafaeb..f7d6ae6a918 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration14_es6.types +++ b/tests/baselines/reference/asyncFunctionDeclaration14_es6.types @@ -1,7 +1,6 @@ === tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration14_es6.ts === async function foo(): Promise { >foo : () => Promise ->Promise : Promise return; } diff --git a/tests/baselines/reference/asyncFunctionDeclaration15_es5.types b/tests/baselines/reference/asyncFunctionDeclaration15_es5.types index 5ed68d1ab24..dc7f69e0d02 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration15_es5.types +++ b/tests/baselines/reference/asyncFunctionDeclaration15_es5.types @@ -12,7 +12,6 @@ declare let obj: { then: string; }; declare let thenable: Thenable; >thenable : Thenable ->Thenable : Thenable async function fn1() { } // valid: Promise >fn1 : () => Promise @@ -28,11 +27,9 @@ async function fn4(): number { } // error async function fn5(): PromiseLike { } // error >fn5 : () => PromiseLike ->PromiseLike : PromiseLike async function fn6(): Thenable { } // error >fn6 : () => Thenable ->Thenable : Thenable async function fn7() { return; } // valid: Promise >fn7 : () => Promise diff --git a/tests/baselines/reference/asyncFunctionDeclaration15_es6.types b/tests/baselines/reference/asyncFunctionDeclaration15_es6.types index b3b176cc812..9955f7708e6 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration15_es6.types +++ b/tests/baselines/reference/asyncFunctionDeclaration15_es6.types @@ -12,7 +12,6 @@ declare let obj: { then: string; }; declare let thenable: Thenable; >thenable : Thenable ->Thenable : Thenable async function fn1() { } // valid: Promise >fn1 : () => Promise @@ -28,11 +27,9 @@ async function fn4(): number { } // error async function fn5(): PromiseLike { } // error >fn5 : () => PromiseLike ->PromiseLike : PromiseLike async function fn6(): Thenable { } // error >fn6 : () => Thenable ->Thenable : Thenable async function fn7() { return; } // valid: Promise >fn7 : () => Promise diff --git a/tests/baselines/reference/asyncFunctionDeclaration1_es2017.types b/tests/baselines/reference/asyncFunctionDeclaration1_es2017.types index ff97e686c43..6e862303e8e 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration1_es2017.types +++ b/tests/baselines/reference/asyncFunctionDeclaration1_es2017.types @@ -1,5 +1,4 @@ === tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration1_es2017.ts === async function foo(): Promise { >foo : () => Promise ->Promise : Promise } diff --git a/tests/baselines/reference/asyncFunctionDeclaration1_es5.types b/tests/baselines/reference/asyncFunctionDeclaration1_es5.types index b1336715bfb..c2f7b9d99c3 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration1_es5.types +++ b/tests/baselines/reference/asyncFunctionDeclaration1_es5.types @@ -1,5 +1,4 @@ === tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration1_es5.ts === async function foo(): Promise { >foo : () => Promise ->Promise : Promise } diff --git a/tests/baselines/reference/asyncFunctionDeclaration1_es6.types b/tests/baselines/reference/asyncFunctionDeclaration1_es6.types index 5cba25724f0..18eb92432bc 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration1_es6.types +++ b/tests/baselines/reference/asyncFunctionDeclaration1_es6.types @@ -1,5 +1,4 @@ === tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration1_es6.ts === async function foo(): Promise { >foo : () => Promise ->Promise : Promise } diff --git a/tests/baselines/reference/asyncFunctionDeclaration6_es2017.types b/tests/baselines/reference/asyncFunctionDeclaration6_es2017.types index 5a1b84feae4..8ffd052c814 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration6_es2017.types +++ b/tests/baselines/reference/asyncFunctionDeclaration6_es2017.types @@ -4,5 +4,4 @@ async function foo(a = await): Promise { >a : any >await : any > : any ->Promise : Promise } diff --git a/tests/baselines/reference/asyncFunctionDeclaration6_es5.types b/tests/baselines/reference/asyncFunctionDeclaration6_es5.types index 02dd3d4be49..e03f663dc68 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration6_es5.types +++ b/tests/baselines/reference/asyncFunctionDeclaration6_es5.types @@ -4,5 +4,4 @@ async function foo(a = await): Promise { >a : any >await : any > : any ->Promise : Promise } diff --git a/tests/baselines/reference/asyncFunctionDeclaration6_es6.types b/tests/baselines/reference/asyncFunctionDeclaration6_es6.types index b65c4ef61d3..00e4afc840d 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration6_es6.types +++ b/tests/baselines/reference/asyncFunctionDeclaration6_es6.types @@ -4,5 +4,4 @@ async function foo(a = await): Promise { >a : any >await : any > : any ->Promise : Promise } diff --git a/tests/baselines/reference/asyncFunctionDeclaration7_es2017.types b/tests/baselines/reference/asyncFunctionDeclaration7_es2017.types index 1d25294f229..f16c9283df3 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration7_es2017.types +++ b/tests/baselines/reference/asyncFunctionDeclaration7_es2017.types @@ -1,7 +1,6 @@ === tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration7_es2017.ts === async function bar(): Promise { >bar : () => Promise ->Promise : Promise // 'await' here is an identifier, and not a yield expression. async function foo(a = await): Promise { @@ -9,6 +8,5 @@ async function bar(): Promise { >a : any >await : any > : any ->Promise : Promise } } diff --git a/tests/baselines/reference/asyncFunctionDeclaration7_es5.types b/tests/baselines/reference/asyncFunctionDeclaration7_es5.types index f3bc39f8019..f6622a6ce54 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration7_es5.types +++ b/tests/baselines/reference/asyncFunctionDeclaration7_es5.types @@ -1,7 +1,6 @@ === tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration7_es5.ts === async function bar(): Promise { >bar : () => Promise ->Promise : Promise // 'await' here is an identifier, and not a yield expression. async function foo(a = await): Promise { @@ -9,6 +8,5 @@ async function bar(): Promise { >a : any >await : any > : any ->Promise : Promise } } diff --git a/tests/baselines/reference/asyncFunctionDeclaration7_es6.types b/tests/baselines/reference/asyncFunctionDeclaration7_es6.types index 8a55a2377e2..b30bb44317d 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration7_es6.types +++ b/tests/baselines/reference/asyncFunctionDeclaration7_es6.types @@ -1,7 +1,6 @@ === tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration7_es6.ts === async function bar(): Promise { >bar : () => Promise ->Promise : Promise // 'await' here is an identifier, and not a yield expression. async function foo(a = await): Promise { @@ -9,6 +8,5 @@ async function bar(): Promise { >a : any >await : any > : any ->Promise : Promise } } diff --git a/tests/baselines/reference/asyncFunctionDeclaration9_es2017.types b/tests/baselines/reference/asyncFunctionDeclaration9_es2017.types index 47bab654da4..e137ff2f05f 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration9_es2017.types +++ b/tests/baselines/reference/asyncFunctionDeclaration9_es2017.types @@ -1,7 +1,6 @@ === tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration9_es2017.ts === async function foo(): Promise { >foo : () => Promise ->Promise : Promise var v = { [await]: foo } >v : { [x: number]: () => Promise; } diff --git a/tests/baselines/reference/asyncFunctionDeclaration9_es5.types b/tests/baselines/reference/asyncFunctionDeclaration9_es5.types index a049fbc9faa..9db2c54c2b6 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration9_es5.types +++ b/tests/baselines/reference/asyncFunctionDeclaration9_es5.types @@ -1,7 +1,6 @@ === tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration9_es5.ts === async function foo(): Promise { >foo : () => Promise ->Promise : Promise var v = { [await]: foo } >v : { [x: number]: () => Promise; } diff --git a/tests/baselines/reference/asyncFunctionDeclaration9_es6.types b/tests/baselines/reference/asyncFunctionDeclaration9_es6.types index ad3ad1e7b0e..c0a9edc7326 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration9_es6.types +++ b/tests/baselines/reference/asyncFunctionDeclaration9_es6.types @@ -1,7 +1,6 @@ === tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration9_es6.ts === async function foo(): Promise { >foo : () => Promise ->Promise : Promise var v = { [await]: foo } >v : { [x: number]: () => Promise; } diff --git a/tests/baselines/reference/asyncFunctionReturnType.types b/tests/baselines/reference/asyncFunctionReturnType.types index d1dab14ba87..d2cb63e0a35 100644 --- a/tests/baselines/reference/asyncFunctionReturnType.types +++ b/tests/baselines/reference/asyncFunctionReturnType.types @@ -11,7 +11,6 @@ async function fAsync() { async function fAsyncExplicit(): Promise<[number, boolean]> { >fAsyncExplicit : () => Promise<[number, boolean]> ->Promise : Promise // This is contextually typed as a tuple. return [1, true]; @@ -22,8 +21,6 @@ async function fAsyncExplicit(): Promise<[number, boolean]> { // https://github.com/Microsoft/TypeScript/issues/13128 interface Obj { ->Obj : Obj - stringProp: string; >stringProp : string @@ -34,9 +31,6 @@ interface Obj { async function fIndexedTypeForStringProp(obj: Obj): Promise { >fIndexedTypeForStringProp : (obj: Obj) => Promise >obj : Obj ->Obj : Obj ->Promise : Promise ->Obj : Obj return obj.stringProp; >obj.stringProp : string @@ -47,9 +41,6 @@ async function fIndexedTypeForStringProp(obj: Obj): Promise { async function fIndexedTypeForPromiseOfStringProp(obj: Obj): Promise { >fIndexedTypeForPromiseOfStringProp : (obj: Obj) => Promise >obj : Obj ->Obj : Obj ->Promise : Promise ->Obj : Obj return Promise.resolve(obj.stringProp); >Promise.resolve(obj.stringProp) : Promise @@ -64,16 +55,12 @@ async function fIndexedTypeForPromiseOfStringProp(obj: Obj): Promise { >fIndexedTypeForExplicitPromiseOfStringProp : (obj: Obj) => Promise >obj : Obj ->Obj : Obj ->Promise : Promise ->Obj : Obj return Promise.resolve(obj.stringProp); >Promise.resolve(obj.stringProp) : Promise >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor >resolve : { (value: T | PromiseLike): Promise; (): Promise; } ->Obj : Obj >obj.stringProp : string >obj : Obj >stringProp : string @@ -82,9 +69,6 @@ async function fIndexedTypeForExplicitPromiseOfStringProp(obj: Obj): Promise { >fIndexedTypeForAnyProp : (obj: Obj) => Promise >obj : Obj ->Obj : Obj ->Promise : Promise ->Obj : Obj return obj.anyProp; >obj.anyProp : any @@ -95,9 +79,6 @@ async function fIndexedTypeForAnyProp(obj: Obj): Promise { async function fIndexedTypeForPromiseOfAnyProp(obj: Obj): Promise { >fIndexedTypeForPromiseOfAnyProp : (obj: Obj) => Promise >obj : Obj ->Obj : Obj ->Promise : Promise ->Obj : Obj return Promise.resolve(obj.anyProp); >Promise.resolve(obj.anyProp) : Promise @@ -112,16 +93,12 @@ async function fIndexedTypeForPromiseOfAnyProp(obj: Obj): Promise { >fIndexedTypeForExplicitPromiseOfAnyProp : (obj: Obj) => Promise >obj : Obj ->Obj : Obj ->Promise : Promise ->Obj : Obj return Promise.resolve(obj.anyProp); >Promise.resolve(obj.anyProp) : Promise >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor >resolve : { (value: T | PromiseLike): Promise; (): Promise; } ->Obj : Obj >obj.anyProp : any >obj : Obj >anyProp : any @@ -129,12 +106,7 @@ async function fIndexedTypeForExplicitPromiseOfAnyProp(obj: Obj): Promise(obj: TObj): Promise { >fGenericIndexedTypeForStringProp : (obj: TObj) => Promise ->TObj : TObj ->Obj : Obj >obj : TObj ->TObj : TObj ->Promise : Promise ->TObj : TObj return obj.stringProp; >obj.stringProp : string @@ -144,12 +116,7 @@ async function fGenericIndexedTypeForStringProp(obj: TObj): Pr async function fGenericIndexedTypeForPromiseOfStringProp(obj: TObj): Promise { >fGenericIndexedTypeForPromiseOfStringProp : (obj: TObj) => Promise ->TObj : TObj ->Obj : Obj >obj : TObj ->TObj : TObj ->Promise : Promise ->TObj : TObj return Promise.resolve(obj.stringProp); >Promise.resolve(obj.stringProp) : Promise @@ -163,19 +130,13 @@ async function fGenericIndexedTypeForPromiseOfStringProp(obj: async function fGenericIndexedTypeForExplicitPromiseOfStringProp(obj: TObj): Promise { >fGenericIndexedTypeForExplicitPromiseOfStringProp : (obj: TObj) => Promise ->TObj : TObj ->Obj : Obj >obj : TObj ->TObj : TObj ->Promise : Promise ->TObj : TObj return Promise.resolve(obj.stringProp); >Promise.resolve(obj.stringProp) : Promise >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor >resolve : { (value: T | PromiseLike): Promise; (): Promise; } ->TObj : TObj >obj.stringProp : string >obj : TObj >stringProp : string @@ -183,12 +144,7 @@ async function fGenericIndexedTypeForExplicitPromiseOfStringProp(obj: TObj): Promise { >fGenericIndexedTypeForAnyProp : (obj: TObj) => Promise ->TObj : TObj ->Obj : Obj >obj : TObj ->TObj : TObj ->Promise : Promise ->TObj : TObj return obj.anyProp; >obj.anyProp : any @@ -198,12 +154,7 @@ async function fGenericIndexedTypeForAnyProp(obj: TObj): Promi async function fGenericIndexedTypeForPromiseOfAnyProp(obj: TObj): Promise { >fGenericIndexedTypeForPromiseOfAnyProp : (obj: TObj) => Promise ->TObj : TObj ->Obj : Obj >obj : TObj ->TObj : TObj ->Promise : Promise ->TObj : TObj return Promise.resolve(obj.anyProp); >Promise.resolve(obj.anyProp) : Promise @@ -217,19 +168,13 @@ async function fGenericIndexedTypeForPromiseOfAnyProp(obj: TOb async function fGenericIndexedTypeForExplicitPromiseOfAnyProp(obj: TObj): Promise { >fGenericIndexedTypeForExplicitPromiseOfAnyProp : (obj: TObj) => Promise ->TObj : TObj ->Obj : Obj >obj : TObj ->TObj : TObj ->Promise : Promise ->TObj : TObj return Promise.resolve(obj.anyProp); >Promise.resolve(obj.anyProp) : Promise >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor >resolve : { (value: T | PromiseLike): Promise; (): Promise; } ->TObj : TObj >obj.anyProp : any >obj : TObj >anyProp : any @@ -237,17 +182,8 @@ async function fGenericIndexedTypeForExplicitPromiseOfAnyProp( async function fGenericIndexedTypeForKProp(obj: TObj, key: K): Promise { >fGenericIndexedTypeForKProp : (obj: TObj, key: K) => Promise ->TObj : TObj ->Obj : Obj ->K : K ->TObj : TObj >obj : TObj ->TObj : TObj >key : K ->K : K ->Promise : Promise ->TObj : TObj ->K : K return obj[key]; >obj[key] : TObj[K] @@ -257,17 +193,8 @@ async function fGenericIndexedTypeForKProp(obj: TObj, key: K): Promise { >fGenericIndexedTypeForPromiseOfKProp : (obj: TObj, key: K) => Promise ->TObj : TObj ->Obj : Obj ->K : K ->TObj : TObj >obj : TObj ->TObj : TObj >key : K ->K : K ->Promise : Promise ->TObj : TObj ->K : K return Promise.resolve(obj[key]); >Promise.resolve(obj[key]) : Promise @@ -281,25 +208,14 @@ async function fGenericIndexedTypeForPromiseOfKProp(obj: TObj, key: K): Promise { >fGenericIndexedTypeForExplicitPromiseOfKProp : (obj: TObj, key: K) => Promise ->TObj : TObj ->Obj : Obj ->K : K ->TObj : TObj >obj : TObj ->TObj : TObj >key : K ->K : K ->Promise : Promise ->TObj : TObj ->K : K return Promise.resolve(obj[key]); >Promise.resolve(obj[key]) : Promise >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor >resolve : { (value: T | PromiseLike): Promise; (): Promise; } ->TObj : TObj ->K : K >obj[key] : TObj[K] >obj : TObj >key : K diff --git a/tests/baselines/reference/asyncFunctionsAndStrictNullChecks.types b/tests/baselines/reference/asyncFunctionsAndStrictNullChecks.types index bc482898216..33ccf9c331f 100644 --- a/tests/baselines/reference/asyncFunctionsAndStrictNullChecks.types +++ b/tests/baselines/reference/asyncFunctionsAndStrictNullChecks.types @@ -1,82 +1,46 @@ === tests/cases/compiler/asyncFunctionsAndStrictNullChecks.ts === declare namespace Windows.Foundation { ->Windows : any ->Foundation : any - interface IPromise { ->IPromise : IPromise ->TResult : TResult - then(success?: (value: TResult) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; >then : { (success?: ((value: TResult) => IPromise) | undefined, error?: ((error: any) => IPromise) | undefined, progress?: ((progress: any) => void) | undefined): IPromise; (success?: ((value: TResult) => IPromise) | undefined, error?: ((error: any) => U) | undefined, progress?: ((progress: any) => void) | undefined): IPromise; (success?: ((value: TResult) => U) | undefined, error?: ((error: any) => IPromise) | undefined, progress?: ((progress: any) => void) | undefined): IPromise; (success?: ((value: TResult) => U) | undefined, error?: ((error: any) => U) | undefined, progress?: ((progress: any) => void) | undefined): IPromise; } ->U : U >success : ((value: TResult) => IPromise) | undefined >value : TResult ->TResult : TResult ->IPromise : IPromise ->U : U >error : ((error: any) => IPromise) | undefined >error : any ->IPromise : IPromise ->U : U >progress : ((progress: any) => void) | undefined >progress : any ->IPromise : IPromise ->U : U then(success?: (value: TResult) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; >then : { (success?: ((value: TResult) => IPromise) | undefined, error?: ((error: any) => IPromise) | undefined, progress?: ((progress: any) => void) | undefined): IPromise; (success?: ((value: TResult) => IPromise) | undefined, error?: ((error: any) => U) | undefined, progress?: ((progress: any) => void) | undefined): IPromise; (success?: ((value: TResult) => U) | undefined, error?: ((error: any) => IPromise) | undefined, progress?: ((progress: any) => void) | undefined): IPromise; (success?: ((value: TResult) => U) | undefined, error?: ((error: any) => U) | undefined, progress?: ((progress: any) => void) | undefined): IPromise; } ->U : U >success : ((value: TResult) => IPromise) | undefined >value : TResult ->TResult : TResult ->IPromise : IPromise ->U : U >error : ((error: any) => U) | undefined >error : any ->U : U >progress : ((progress: any) => void) | undefined >progress : any ->IPromise : IPromise ->U : U then(success?: (value: TResult) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; >then : { (success?: ((value: TResult) => IPromise) | undefined, error?: ((error: any) => IPromise) | undefined, progress?: ((progress: any) => void) | undefined): IPromise; (success?: ((value: TResult) => IPromise) | undefined, error?: ((error: any) => U) | undefined, progress?: ((progress: any) => void) | undefined): IPromise; (success?: ((value: TResult) => U) | undefined, error?: ((error: any) => IPromise) | undefined, progress?: ((progress: any) => void) | undefined): IPromise; (success?: ((value: TResult) => U) | undefined, error?: ((error: any) => U) | undefined, progress?: ((progress: any) => void) | undefined): IPromise; } ->U : U >success : ((value: TResult) => U) | undefined >value : TResult ->TResult : TResult ->U : U >error : ((error: any) => IPromise) | undefined >error : any ->IPromise : IPromise ->U : U >progress : ((progress: any) => void) | undefined >progress : any ->IPromise : IPromise ->U : U then(success?: (value: TResult) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; >then : { (success?: ((value: TResult) => IPromise) | undefined, error?: ((error: any) => IPromise) | undefined, progress?: ((progress: any) => void) | undefined): IPromise; (success?: ((value: TResult) => IPromise) | undefined, error?: ((error: any) => U) | undefined, progress?: ((progress: any) => void) | undefined): IPromise; (success?: ((value: TResult) => U) | undefined, error?: ((error: any) => IPromise) | undefined, progress?: ((progress: any) => void) | undefined): IPromise; (success?: ((value: TResult) => U) | undefined, error?: ((error: any) => U) | undefined, progress?: ((progress: any) => void) | undefined): IPromise; } ->U : U >success : ((value: TResult) => U) | undefined >value : TResult ->TResult : TResult ->U : U >error : ((error: any) => U) | undefined >error : any ->U : U >progress : ((progress: any) => void) | undefined >progress : any ->IPromise : IPromise ->U : U done(success?: (value: TResult) => any, error?: (error: any) => any, progress?: (progress: any) => void): void; >done : (success?: ((value: TResult) => any) | undefined, error?: ((error: any) => any) | undefined, progress?: ((progress: any) => void) | undefined) => void ->U : U >success : ((value: TResult) => any) | undefined >value : TResult ->TResult : TResult >error : ((error: any) => any) | undefined >error : any >progress : ((progress: any) => void) | undefined @@ -92,7 +56,6 @@ async function sample(promise: Windows.Foundation.IPromise) { >promise : Windows.Foundation.IPromise >Windows : any >Foundation : any ->IPromise : Windows.Foundation.IPromise var number = await promise; >number : number @@ -103,21 +66,13 @@ async function sample(promise: Windows.Foundation.IPromise) { declare function resolve1(value: T): Promise; >resolve1 : (value: T) => Promise ->T : T >value : T ->T : T ->Promise : Promise ->T : T declare function resolve2(value: T): Windows.Foundation.IPromise; >resolve2 : (value: T) => Windows.Foundation.IPromise ->T : T >value : T ->T : T >Windows : any >Foundation : any ->IPromise : Windows.Foundation.IPromise ->T : T async function sample2(x?: number) { >sample2 : (x?: number | undefined) => Promise diff --git a/tests/baselines/reference/asyncImportedPromise_es5.types b/tests/baselines/reference/asyncImportedPromise_es5.types index 54a6e52fa17..c8ea6bdf61e 100644 --- a/tests/baselines/reference/asyncImportedPromise_es5.types +++ b/tests/baselines/reference/asyncImportedPromise_es5.types @@ -1,9 +1,7 @@ === tests/cases/conformance/async/es5/task.ts === export class Task extends Promise { } >Task : Task ->T : T >Promise : Promise ->T : T === tests/cases/conformance/async/es5/test.ts === import { Task } from "./task"; @@ -14,7 +12,4 @@ class Test { async example(): Task { return; } >example : () => Task ->T : T ->Task : Task ->T : T } diff --git a/tests/baselines/reference/asyncImportedPromise_es6.types b/tests/baselines/reference/asyncImportedPromise_es6.types index 424f14b34d3..05411f1dda5 100644 --- a/tests/baselines/reference/asyncImportedPromise_es6.types +++ b/tests/baselines/reference/asyncImportedPromise_es6.types @@ -1,9 +1,7 @@ === tests/cases/conformance/async/es6/task.ts === export class Task extends Promise { } >Task : Task ->T : T >Promise : Promise ->T : T === tests/cases/conformance/async/es6/test.ts === import { Task } from "./task"; @@ -14,7 +12,4 @@ class Test { async example(): Task { return; } >example : () => Task ->T : T ->Task : Task ->T : T } diff --git a/tests/baselines/reference/asyncInterface_es5.types b/tests/baselines/reference/asyncInterface_es5.types index 37b780a19ad..804a7103d18 100644 --- a/tests/baselines/reference/asyncInterface_es5.types +++ b/tests/baselines/reference/asyncInterface_es5.types @@ -1,4 +1,4 @@ === tests/cases/conformance/async/es5/asyncInterface_es5.ts === async interface I { ->I : I -} +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/asyncInterface_es6.types b/tests/baselines/reference/asyncInterface_es6.types index b770cafdb96..3990cb71883 100644 --- a/tests/baselines/reference/asyncInterface_es6.types +++ b/tests/baselines/reference/asyncInterface_es6.types @@ -1,4 +1,4 @@ === tests/cases/conformance/async/es6/asyncInterface_es6.ts === async interface I { ->I : I -} +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/asyncModule_es5.types b/tests/baselines/reference/asyncModule_es5.types index ee956e48eb3..6d9544051c0 100644 --- a/tests/baselines/reference/asyncModule_es5.types +++ b/tests/baselines/reference/asyncModule_es5.types @@ -1,4 +1,4 @@ === tests/cases/conformance/async/es5/asyncModule_es5.ts === async module M { ->M : any -} +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/asyncModule_es6.types b/tests/baselines/reference/asyncModule_es6.types index b502433758a..7772b353b8e 100644 --- a/tests/baselines/reference/asyncModule_es6.types +++ b/tests/baselines/reference/asyncModule_es6.types @@ -1,4 +1,4 @@ === tests/cases/conformance/async/es6/asyncModule_es6.ts === async module M { ->M : any -} +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/asyncQualifiedReturnType_es5.types b/tests/baselines/reference/asyncQualifiedReturnType_es5.types index 2fccf45f2a4..8df2ac42c50 100644 --- a/tests/baselines/reference/asyncQualifiedReturnType_es5.types +++ b/tests/baselines/reference/asyncQualifiedReturnType_es5.types @@ -4,14 +4,11 @@ namespace X { export class MyPromise extends Promise { >MyPromise : MyPromise ->T : T >Promise : Promise ->T : T } } async function f(): X.MyPromise { >f : () => X.MyPromise >X : any ->MyPromise : X.MyPromise } diff --git a/tests/baselines/reference/asyncQualifiedReturnType_es6.types b/tests/baselines/reference/asyncQualifiedReturnType_es6.types index 3b438eb93b6..f1878fed5d8 100644 --- a/tests/baselines/reference/asyncQualifiedReturnType_es6.types +++ b/tests/baselines/reference/asyncQualifiedReturnType_es6.types @@ -4,14 +4,11 @@ namespace X { export class MyPromise extends Promise { >MyPromise : MyPromise ->T : T >Promise : Promise ->T : T } } async function f(): X.MyPromise { >f : () => X.MyPromise >X : any ->MyPromise : X.MyPromise } diff --git a/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es2017.types b/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es2017.types index 04c137f81b9..255b86287eb 100644 --- a/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es2017.types +++ b/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es2017.types @@ -2,7 +2,6 @@ declare function someOtherFunction(i: any): Promise; >someOtherFunction : (i: any) => Promise >i : any ->Promise : Promise const x = async i => await someOtherFunction(i) >x : (i: any) => Promise diff --git a/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es5.types b/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es5.types index 34ef19e6bd2..a1dff9ee0e7 100644 --- a/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es5.types +++ b/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es5.types @@ -2,7 +2,6 @@ declare function someOtherFunction(i: any): Promise; >someOtherFunction : (i: any) => Promise >i : any ->Promise : Promise const x = async i => await someOtherFunction(i) >x : (i: any) => Promise diff --git a/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es6.types b/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es6.types index 5a0f516c0ea..69191189251 100644 --- a/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es6.types +++ b/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es6.types @@ -2,7 +2,6 @@ declare function someOtherFunction(i: any): Promise; >someOtherFunction : (i: any) => Promise >i : any ->Promise : Promise const x = async i => await someOtherFunction(i) >x : (i: any) => Promise diff --git a/tests/baselines/reference/asyncUseStrict_es2017.types b/tests/baselines/reference/asyncUseStrict_es2017.types index 267eda83525..9b0aa4e5df4 100644 --- a/tests/baselines/reference/asyncUseStrict_es2017.types +++ b/tests/baselines/reference/asyncUseStrict_es2017.types @@ -4,11 +4,9 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise async function func(): Promise { >func : () => Promise ->Promise : Promise "use strict"; >"use strict" : "use strict" diff --git a/tests/baselines/reference/asyncUseStrict_es5.types b/tests/baselines/reference/asyncUseStrict_es5.types index a8744a60559..daea07dfb95 100644 --- a/tests/baselines/reference/asyncUseStrict_es5.types +++ b/tests/baselines/reference/asyncUseStrict_es5.types @@ -4,11 +4,9 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise async function func(): Promise { >func : () => Promise ->Promise : Promise "use strict"; >"use strict" : "use strict" diff --git a/tests/baselines/reference/asyncUseStrict_es6.types b/tests/baselines/reference/asyncUseStrict_es6.types index e92da865316..73a8641ef47 100644 --- a/tests/baselines/reference/asyncUseStrict_es6.types +++ b/tests/baselines/reference/asyncUseStrict_es6.types @@ -4,11 +4,9 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise async function func(): Promise { >func : () => Promise ->Promise : Promise "use strict"; >"use strict" : "use strict" diff --git a/tests/baselines/reference/augmentArray.types b/tests/baselines/reference/augmentArray.types index 31f7e11edca..fe7d9fe2e2d 100644 --- a/tests/baselines/reference/augmentArray.types +++ b/tests/baselines/reference/augmentArray.types @@ -1,7 +1,5 @@ === tests/cases/compiler/augmentArray.ts === interface Array { ->Array : T[] ->T : T - - (): any[]; -} +No type information for this code. (): any[]; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/augmentExportEquals1.types b/tests/baselines/reference/augmentExportEquals1.types index 3c9872c8afe..e2c86b9ae5f 100644 --- a/tests/baselines/reference/augmentExportEquals1.types +++ b/tests/baselines/reference/augmentExportEquals1.types @@ -6,7 +6,6 @@ import "./file2"; let a: x.A; // should not work >a : any >x : any ->A : No type information available! === tests/cases/compiler/file1.ts === var x = 1; @@ -26,7 +25,6 @@ declare module "./file1" { >"./file1" : any interface A { a } ->A : A >a : any } diff --git a/tests/baselines/reference/augmentExportEquals1_1.types b/tests/baselines/reference/augmentExportEquals1_1.types index 7c0a355d08c..b348eba27c0 100644 --- a/tests/baselines/reference/augmentExportEquals1_1.types +++ b/tests/baselines/reference/augmentExportEquals1_1.types @@ -6,7 +6,6 @@ import "file2"; let a: x.A; // should not work >a : any >x : any ->A : No type information available! === tests/cases/compiler/file1.d.ts === declare module "file1" { @@ -30,7 +29,6 @@ declare module "file1" { >"file1" : any interface A { a } ->A : A >a : any } diff --git a/tests/baselines/reference/augmentExportEquals2.types b/tests/baselines/reference/augmentExportEquals2.types index 03424f0b6a5..aeee216a9a3 100644 --- a/tests/baselines/reference/augmentExportEquals2.types +++ b/tests/baselines/reference/augmentExportEquals2.types @@ -6,7 +6,6 @@ import "./file2"; let a: x.A; // should not work >a : any >x : any ->A : No type information available! === tests/cases/compiler/file1.ts === function foo() {} @@ -24,7 +23,6 @@ declare module "./file1" { >"./file1" : any interface A { a } ->A : A >a : any } diff --git a/tests/baselines/reference/augmentExportEquals2_1.types b/tests/baselines/reference/augmentExportEquals2_1.types index a684b76dd51..bca0320dcf1 100644 --- a/tests/baselines/reference/augmentExportEquals2_1.types +++ b/tests/baselines/reference/augmentExportEquals2_1.types @@ -6,7 +6,6 @@ import "file2"; let a: x.A; // should not work >a : any >x : any ->A : No type information available! === tests/cases/compiler/file1.d.ts === declare module "file1" { @@ -29,7 +28,6 @@ declare module "file1" { >"file1" : any interface A { a } ->A : A >a : any } diff --git a/tests/baselines/reference/augmentExportEquals3.types b/tests/baselines/reference/augmentExportEquals3.types index d66b166c5ab..5e1b832ec07 100644 --- a/tests/baselines/reference/augmentExportEquals3.types +++ b/tests/baselines/reference/augmentExportEquals3.types @@ -28,7 +28,6 @@ declare module "./file1" { >"./file1" : typeof x interface A { a } ->A : A >a : any let b: number; @@ -43,7 +42,6 @@ import "./file2"; let a: x.A; >a : x.A >x : any ->A : x.A let b = x.b; >b : number diff --git a/tests/baselines/reference/augmentExportEquals3_1.types b/tests/baselines/reference/augmentExportEquals3_1.types index 08e21c6172c..94f79d50429 100644 --- a/tests/baselines/reference/augmentExportEquals3_1.types +++ b/tests/baselines/reference/augmentExportEquals3_1.types @@ -33,7 +33,6 @@ declare module "file1" { >"file1" : typeof x interface A { a } ->A : A >a : any let b: number; @@ -48,7 +47,6 @@ import "file2"; let a: x.A; >a : x.A >x : any ->A : x.A let b = x.b; >b : number diff --git a/tests/baselines/reference/augmentExportEquals4.types b/tests/baselines/reference/augmentExportEquals4.types index ebdacceae2b..a18268d9e8a 100644 --- a/tests/baselines/reference/augmentExportEquals4.types +++ b/tests/baselines/reference/augmentExportEquals4.types @@ -28,7 +28,6 @@ declare module "./file1" { >"./file1" : typeof x interface A { a } ->A : A >a : any let b: number; @@ -43,7 +42,6 @@ import "./file2"; let a: x.A; >a : x.A >x : any ->A : x.A let b = x.b; >b : number diff --git a/tests/baselines/reference/augmentExportEquals4_1.types b/tests/baselines/reference/augmentExportEquals4_1.types index 7f28d24d64e..a86bb2e89ec 100644 --- a/tests/baselines/reference/augmentExportEquals4_1.types +++ b/tests/baselines/reference/augmentExportEquals4_1.types @@ -33,7 +33,6 @@ declare module "file1" { >"file1" : typeof x interface A { a } ->A : A >a : any let b: number; @@ -48,7 +47,6 @@ import "file2"; let a: x.A; >a : x.A >x : any ->A : x.A let b = x.b; >b : number diff --git a/tests/baselines/reference/augmentExportEquals5.types b/tests/baselines/reference/augmentExportEquals5.types index fd5bb168f80..8c5dcb14173 100644 --- a/tests/baselines/reference/augmentExportEquals5.types +++ b/tests/baselines/reference/augmentExportEquals5.types @@ -1,15 +1,8 @@ === tests/cases/compiler/express.d.ts === declare module Express { ->Express : any - export interface Request { } ->Request : Request - export interface Response { } ->Response : Response - export interface Application { } ->Application : Application } declare module "express" { @@ -18,64 +11,39 @@ declare module "express" { function e(): e.Express; >e : typeof import("e") >e : any ->Express : import("e").Express namespace e { >e : typeof import("e") interface IRoute { ->IRoute : IRoute - all(...handler: RequestHandler[]): IRoute; >all : (...handler: RequestHandler[]) => IRoute >handler : RequestHandler[] ->RequestHandler : RequestHandler ->IRoute : IRoute } interface IRouterMatcher { ->IRouterMatcher : IRouterMatcher ->T : T - (name: string|RegExp, ...handlers: RequestHandler[]): T; >name : string | RegExp ->RegExp : RegExp >handlers : RequestHandler[] ->RequestHandler : RequestHandler ->T : T } interface IRouter extends RequestHandler { ->IRouter : IRouter ->T : T ->RequestHandler : RequestHandler - route(path: string): IRoute; >route : (path: string) => IRoute >path : string ->IRoute : IRoute } export function Router(options?: any): Router; >Router : (options?: any) => Router >options : any ->Router : Router export interface Router extends IRouter {} ->Router : Router ->IRouter : IRouter ->Router : Router interface Errback { (err: Error): void; } ->Errback : Errback >err : Error ->Error : Error interface Request extends Express.Request { ->Request : Request ->Express.Request : any >Express : any ->Request : Express.Request get (name: string): string; >get : (name: string) => string @@ -83,76 +51,47 @@ declare module "express" { } interface Response extends Express.Response { ->Response : Response ->Express.Response : any >Express : any ->Response : Express.Response charset: string; >charset : string } interface ErrorRequestHandler { ->ErrorRequestHandler : ErrorRequestHandler - (err: any, req: Request, res: Response, next: Function): any; >err : any >req : Request ->Request : Request >res : Response ->Response : Response >next : Function ->Function : Function } interface RequestHandler { ->RequestHandler : RequestHandler - (req: Request, res: Response, next: Function): any; >req : Request ->Request : Request >res : Response ->Response : Response >next : Function ->Function : Function } interface Handler extends RequestHandler {} ->Handler : Handler ->RequestHandler : RequestHandler interface RequestParamHandler { ->RequestParamHandler : RequestParamHandler - (req: Request, res: Response, next: Function, param: any): any; >req : Request ->Request : Request >res : Response ->Response : Response >next : Function ->Function : Function >param : any } interface Application extends IRouter, Express.Application { ->Application : Application ->IRouter : IRouter ->Application : Application ->Express.Application : any >Express : any ->Application : Express.Application routes: any; >routes : any } interface Express extends Application { ->Express : Express ->Application : Application - createApplication(): Application; >createApplication : () => Application ->Application : Application } var static: any; @@ -172,8 +111,6 @@ declare module "express" { >"express" : typeof e interface Request { ->Request : Request - id: number; >id : number } @@ -186,7 +123,6 @@ import { Request } from "express"; import "./augmentation"; let x: Request; >x : Request ->Request : Request const y = x.id; >y : number diff --git a/tests/baselines/reference/augmentExportEquals6.types b/tests/baselines/reference/augmentExportEquals6.types index a8e9c36a4ee..272a4fd5875 100644 --- a/tests/baselines/reference/augmentExportEquals6.types +++ b/tests/baselines/reference/augmentExportEquals6.types @@ -33,7 +33,6 @@ declare module "./file1" { >"./file1" : typeof x interface A { a: number } ->A : A >a : number namespace B { @@ -52,7 +51,6 @@ import "./file2"; let a: x.A; >a : x.A >x : any ->A : x.A let b = a.a; >b : number diff --git a/tests/baselines/reference/augmentExportEquals6_1.types b/tests/baselines/reference/augmentExportEquals6_1.types index 3bde1ec600c..d8aed819ba5 100644 --- a/tests/baselines/reference/augmentExportEquals6_1.types +++ b/tests/baselines/reference/augmentExportEquals6_1.types @@ -26,7 +26,6 @@ declare module "file1" { >"file1" : typeof x interface A { a: number } ->A : A >a : number } @@ -38,7 +37,6 @@ import "file2"; let a: x.A; >a : x.A >x : any ->A : x.A let b = a.a; >b : number diff --git a/tests/baselines/reference/augmentExportEquals7.types b/tests/baselines/reference/augmentExportEquals7.types index b1626ff8925..4558b5281f6 100644 --- a/tests/baselines/reference/augmentExportEquals7.types +++ b/tests/baselines/reference/augmentExportEquals7.types @@ -3,8 +3,6 @@ declare var lib: () => void; >lib : () => void declare namespace lib {} ->lib : () => void - export = lib; >lib : () => void diff --git a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.types b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.types index fc19672442a..32fc880870d 100644 --- a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.types +++ b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.types @@ -1,26 +1,18 @@ === tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts === interface Foo { a } ->Foo : Foo >a : any interface Bar { b } ->Bar : Bar >b : any interface Object { ->Object : Object - [n: number]: Foo; >n : number ->Foo : Foo } interface Function { ->Function : Function - [n: number]: Bar; >n : number ->Bar : Bar } var o = {}; @@ -36,7 +28,6 @@ var v1: { [n: number]: Foo >n : number ->Foo : Foo } = o; // Should be allowed >o : {} @@ -46,7 +37,6 @@ var v2: { [n: number]: Bar >n : number ->Bar : Bar } = f; // Should be allowed >f : () => void diff --git a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types index a0951c324f2..eb23cfaa9e6 100644 --- a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types +++ b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.types @@ -1,26 +1,18 @@ === tests/cases/conformance/types/members/augmentedTypeBracketAccessIndexSignature.ts === interface Foo { a } ->Foo : Foo >a : any interface Bar { b } ->Bar : Bar >b : any interface Object { ->Object : Object - [n: number]: Foo; >n : number ->Foo : Foo } interface Function { ->Function : Function - [n: number]: Bar; >n : number ->Bar : Bar } var a = {}[0]; // Should be Foo diff --git a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types index d8388fc81a8..eb90adefde2 100644 --- a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types +++ b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.types @@ -1,13 +1,9 @@ === tests/cases/compiler/augmentedTypeBracketNamedPropertyAccess.ts === interface Object { ->Object : Object - data: number; >data : number } interface Function { ->Function : Function - functionData: string; >functionData : string } diff --git a/tests/baselines/reference/augmentedTypesClass2.types b/tests/baselines/reference/augmentedTypesClass2.types index dd3263cc0a2..df4379508b8 100644 --- a/tests/baselines/reference/augmentedTypesClass2.types +++ b/tests/baselines/reference/augmentedTypesClass2.types @@ -14,8 +14,6 @@ class c11 { } interface c11 { ->c11 : c11 - bar(): void; >bar : () => void } diff --git a/tests/baselines/reference/augmentedTypesClass3.types b/tests/baselines/reference/augmentedTypesClass3.types index 64e403d2661..d59d519cb43 100644 --- a/tests/baselines/reference/augmentedTypesClass3.types +++ b/tests/baselines/reference/augmentedTypesClass3.types @@ -5,7 +5,6 @@ class c5 { public foo() { } } >foo : () => void module c5 { } // should be ok ->c5 : typeof c5 class c5a { public foo() { } } >c5a : c5a diff --git a/tests/baselines/reference/augmentedTypesEnum.types b/tests/baselines/reference/augmentedTypesEnum.types index 36ac647e4a1..d6fcf87f138 100644 --- a/tests/baselines/reference/augmentedTypesEnum.types +++ b/tests/baselines/reference/augmentedTypesEnum.types @@ -56,7 +56,6 @@ enum e6 { One } >One : e6 module e6 { } // ok ->e6 : typeof e6 enum e6a { One } >e6a : e6a diff --git a/tests/baselines/reference/augmentedTypesEnum2.types b/tests/baselines/reference/augmentedTypesEnum2.types index 9949862b147..4b77d0eb90b 100644 --- a/tests/baselines/reference/augmentedTypesEnum2.types +++ b/tests/baselines/reference/augmentedTypesEnum2.types @@ -5,8 +5,6 @@ enum e1 { One } // error >One : e1 interface e1 { // error ->e1 : e1 - foo(): void; >foo : () => void } diff --git a/tests/baselines/reference/augmentedTypesExternalModule1.types b/tests/baselines/reference/augmentedTypesExternalModule1.types index 2d3f8394d82..aeb8011dde3 100644 --- a/tests/baselines/reference/augmentedTypesExternalModule1.types +++ b/tests/baselines/reference/augmentedTypesExternalModule1.types @@ -8,5 +8,3 @@ class c5 { public foo() { } } >foo : () => void module c5 { } // should be ok everywhere ->c5 : typeof c5 - diff --git a/tests/baselines/reference/augmentedTypesFunction.types b/tests/baselines/reference/augmentedTypesFunction.types index a977761c83f..b019c02d90c 100644 --- a/tests/baselines/reference/augmentedTypesFunction.types +++ b/tests/baselines/reference/augmentedTypesFunction.types @@ -48,7 +48,6 @@ function y5() { } >y5 : () => void module y5 { } // ok since module is not instantiated ->y5 : () => void function y5a() { } >y5a : typeof y5a @@ -70,8 +69,6 @@ function y5c() { } >y5c : () => void module y5c { export interface I { foo(): void } } // should be an error ->y5c : () => void ->I : I >foo : () => void // function then import, messes with other errors diff --git a/tests/baselines/reference/augmentedTypesInterface.types b/tests/baselines/reference/augmentedTypesInterface.types index 412d4795131..6b6ef88015f 100644 --- a/tests/baselines/reference/augmentedTypesInterface.types +++ b/tests/baselines/reference/augmentedTypesInterface.types @@ -2,23 +2,17 @@ // interface then interface interface i { ->i : i - foo(): void; >foo : () => void } interface i { ->i : i - bar(): number; >bar : () => number } // interface then class interface i2 { ->i2 : i2 - foo(): void; >foo : () => void } @@ -36,8 +30,6 @@ class i2 { // interface then enum interface i3 { // error ->i3 : i3 - foo(): void; >foo : () => void } @@ -47,8 +39,6 @@ enum i3 { One }; // error // interface then import interface i4 { ->i4 : i4 - foo(): void; >foo : () => void } diff --git a/tests/baselines/reference/augmentedTypesModules.types b/tests/baselines/reference/augmentedTypesModules.types index 4dc23acd66f..1a03b9991ed 100644 --- a/tests/baselines/reference/augmentedTypesModules.types +++ b/tests/baselines/reference/augmentedTypesModules.types @@ -1,8 +1,6 @@ === tests/cases/compiler/augmentedTypesModules.ts === // module then var module m1 { } ->m1 : number - var m1 = 1; // Should be allowed >m1 : number >1 : 1 @@ -26,10 +24,7 @@ var m1b = 1; // error >1 : 1 module m1c { ->m1c : number - export interface I { foo(): void; } ->I : I >foo : () => void } var m1c = 1; // Should be allowed @@ -49,8 +44,6 @@ var m1d = 1; // error // module then function module m2 { } ->m2 : () => void - function m2() { }; // ok since the module is not instantiated >m2 : () => void @@ -80,8 +73,6 @@ module m2c { export var y = 2; } >2 : 2 module m2d { } ->m2d : () => void - declare function m2d(): void; >m2d : () => void @@ -89,14 +80,11 @@ declare function m2e(): void; >m2e : () => void module m2e { } ->m2e : () => void function m2f() { }; >m2f : () => void module m2f { export interface I { foo(): void } } ->m2f : () => void ->I : I >foo : () => void function m2g() { }; @@ -109,8 +97,6 @@ module m2g { export class C { foo() { } } } // module then class module m3 { } ->m3 : typeof m3 - class m3 { } // ok since the module is not instantiated >m3 : m3 @@ -164,8 +150,6 @@ declare class m3f { foo(): void } >foo : () => void module m3f { export interface I { foo(): void } } ->m3f : typeof m3f ->I : I >foo : () => void declare class m3g { foo(): void } @@ -180,8 +164,6 @@ module m3g { export class C { foo() { } } } // module then enum // should be errors module m4 { } ->m4 : typeof m4 - enum m4 { } >m4 : m4 @@ -204,8 +186,6 @@ enum m4b { One } >One : m4b module m4c { interface I { foo(): void } } ->m4c : typeof m4c ->I : I >foo : () => void enum m4c { One } @@ -229,8 +209,6 @@ module m5 { export var y = 2; } >2 : 2 module m5 { export interface I { foo(): void } } // should already be reasonably well covered ->m5 : typeof m5 ->I : I >foo : () => void // module then import diff --git a/tests/baselines/reference/augmentedTypesModules2.types b/tests/baselines/reference/augmentedTypesModules2.types index e2c9f7a3cb5..30b14793453 100644 --- a/tests/baselines/reference/augmentedTypesModules2.types +++ b/tests/baselines/reference/augmentedTypesModules2.types @@ -1,8 +1,6 @@ === tests/cases/compiler/augmentedTypesModules2.ts === // module then function module m2 { } ->m2 : () => void - function m2() { }; // ok since the module is not instantiated >m2 : () => void @@ -39,8 +37,6 @@ function m2cc() { }; // error to have module first >m2cc : typeof m2cc module m2d { } ->m2d : () => void - declare function m2d(): void; >m2d : () => void @@ -48,14 +44,11 @@ declare function m2e(): void; >m2e : () => void module m2e { } ->m2e : () => void function m2f() { }; >m2f : () => void module m2f { export interface I { foo(): void } } ->m2f : () => void ->I : I >foo : () => void function m2g() { }; diff --git a/tests/baselines/reference/augmentedTypesModules3.types b/tests/baselines/reference/augmentedTypesModules3.types index bf8f275a777..2f95368414b 100644 --- a/tests/baselines/reference/augmentedTypesModules3.types +++ b/tests/baselines/reference/augmentedTypesModules3.types @@ -1,8 +1,6 @@ === tests/cases/compiler/augmentedTypesModules3.ts === //// module then class module m3 { } ->m3 : typeof m3 - class m3 { } // ok since the module is not instantiated >m3 : m3 diff --git a/tests/baselines/reference/augmentedTypesModules3b.types b/tests/baselines/reference/augmentedTypesModules3b.types index 0d1ebe2bb42..c165ae3cd32 100644 --- a/tests/baselines/reference/augmentedTypesModules3b.types +++ b/tests/baselines/reference/augmentedTypesModules3b.types @@ -40,8 +40,6 @@ declare class m3f { foo(): void } >foo : () => void module m3f { export interface I { foo(): void } } ->m3f : typeof m3f ->I : I >foo : () => void declare class m3g { foo(): void } diff --git a/tests/baselines/reference/augmentedTypesModules4.types b/tests/baselines/reference/augmentedTypesModules4.types index 7e47abc41e8..d1dd8fe19ec 100644 --- a/tests/baselines/reference/augmentedTypesModules4.types +++ b/tests/baselines/reference/augmentedTypesModules4.types @@ -2,8 +2,6 @@ // module then enum // should be errors module m4 { } ->m4 : typeof m4 - enum m4 { } >m4 : m4 @@ -26,8 +24,6 @@ enum m4b { One } >One : m4b module m4c { interface I { foo(): void } } ->m4c : typeof m4c ->I : I >foo : () => void enum m4c { One } @@ -51,7 +47,5 @@ module m5 { export var y = 2; } >2 : 2 module m5 { export interface I { foo(): void } } // should already be reasonably well covered ->m5 : typeof m5 ->I : I >foo : () => void diff --git a/tests/baselines/reference/augmentedTypesVar.types b/tests/baselines/reference/augmentedTypesVar.types index f666a3ca5a4..f2ced2b5426 100644 --- a/tests/baselines/reference/augmentedTypesVar.types +++ b/tests/baselines/reference/augmentedTypesVar.types @@ -55,7 +55,6 @@ var x6 = 1; >1 : 1 module x6 { } // ok since non-instantiated ->x6 : number var x6a = 1; // error >x6a : number diff --git a/tests/baselines/reference/awaitBinaryExpression1_es2017.types b/tests/baselines/reference/awaitBinaryExpression1_es2017.types index c86631804c5..18debcdf06e 100644 --- a/tests/baselines/reference/awaitBinaryExpression1_es2017.types +++ b/tests/baselines/reference/awaitBinaryExpression1_es2017.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function before(): void; >before : () => void @@ -14,7 +13,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitBinaryExpression1_es5.types b/tests/baselines/reference/awaitBinaryExpression1_es5.types index f704eb632b4..a5c096c71d1 100644 --- a/tests/baselines/reference/awaitBinaryExpression1_es5.types +++ b/tests/baselines/reference/awaitBinaryExpression1_es5.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function before(): void; >before : () => void @@ -14,7 +13,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitBinaryExpression1_es6.types b/tests/baselines/reference/awaitBinaryExpression1_es6.types index 6078e2b6dff..f967dacd4fc 100644 --- a/tests/baselines/reference/awaitBinaryExpression1_es6.types +++ b/tests/baselines/reference/awaitBinaryExpression1_es6.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function before(): void; >before : () => void @@ -14,7 +13,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitBinaryExpression2_es2017.types b/tests/baselines/reference/awaitBinaryExpression2_es2017.types index f803b1ac840..1836a016282 100644 --- a/tests/baselines/reference/awaitBinaryExpression2_es2017.types +++ b/tests/baselines/reference/awaitBinaryExpression2_es2017.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function before(): void; >before : () => void @@ -14,7 +13,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitBinaryExpression2_es5.types b/tests/baselines/reference/awaitBinaryExpression2_es5.types index d3f1f861a45..dc7ea12e9fb 100644 --- a/tests/baselines/reference/awaitBinaryExpression2_es5.types +++ b/tests/baselines/reference/awaitBinaryExpression2_es5.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function before(): void; >before : () => void @@ -14,7 +13,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitBinaryExpression2_es6.types b/tests/baselines/reference/awaitBinaryExpression2_es6.types index 5f092675e85..92fe14fa848 100644 --- a/tests/baselines/reference/awaitBinaryExpression2_es6.types +++ b/tests/baselines/reference/awaitBinaryExpression2_es6.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function before(): void; >before : () => void @@ -14,7 +13,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitBinaryExpression3_es2017.types b/tests/baselines/reference/awaitBinaryExpression3_es2017.types index 623d0695237..7e9c41f2057 100644 --- a/tests/baselines/reference/awaitBinaryExpression3_es2017.types +++ b/tests/baselines/reference/awaitBinaryExpression3_es2017.types @@ -4,7 +4,6 @@ declare var a: number; declare var p: Promise; >p : Promise ->Promise : Promise declare function before(): void; >before : () => void @@ -14,7 +13,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitBinaryExpression3_es5.types b/tests/baselines/reference/awaitBinaryExpression3_es5.types index debc71a6475..63952297d96 100644 --- a/tests/baselines/reference/awaitBinaryExpression3_es5.types +++ b/tests/baselines/reference/awaitBinaryExpression3_es5.types @@ -4,7 +4,6 @@ declare var a: number; declare var p: Promise; >p : Promise ->Promise : Promise declare function before(): void; >before : () => void @@ -14,7 +13,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitBinaryExpression3_es6.types b/tests/baselines/reference/awaitBinaryExpression3_es6.types index 98bff3b9439..4dcf987d908 100644 --- a/tests/baselines/reference/awaitBinaryExpression3_es6.types +++ b/tests/baselines/reference/awaitBinaryExpression3_es6.types @@ -4,7 +4,6 @@ declare var a: number; declare var p: Promise; >p : Promise ->Promise : Promise declare function before(): void; >before : () => void @@ -14,7 +13,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitBinaryExpression4_es2017.types b/tests/baselines/reference/awaitBinaryExpression4_es2017.types index 714b6b1ea3a..dbc114471f2 100644 --- a/tests/baselines/reference/awaitBinaryExpression4_es2017.types +++ b/tests/baselines/reference/awaitBinaryExpression4_es2017.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function before(): void; >before : () => void @@ -14,7 +13,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitBinaryExpression4_es5.types b/tests/baselines/reference/awaitBinaryExpression4_es5.types index f535741fa45..0df132ed5d5 100644 --- a/tests/baselines/reference/awaitBinaryExpression4_es5.types +++ b/tests/baselines/reference/awaitBinaryExpression4_es5.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function before(): void; >before : () => void @@ -14,7 +13,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitBinaryExpression4_es6.types b/tests/baselines/reference/awaitBinaryExpression4_es6.types index ea1d968346d..01eb1f10b1e 100644 --- a/tests/baselines/reference/awaitBinaryExpression4_es6.types +++ b/tests/baselines/reference/awaitBinaryExpression4_es6.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function before(): void; >before : () => void @@ -14,7 +13,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitBinaryExpression5_es2017.types b/tests/baselines/reference/awaitBinaryExpression5_es2017.types index 763f9e50862..0fbaa72e6e0 100644 --- a/tests/baselines/reference/awaitBinaryExpression5_es2017.types +++ b/tests/baselines/reference/awaitBinaryExpression5_es2017.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function before(): void; >before : () => void @@ -14,7 +13,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitBinaryExpression5_es5.types b/tests/baselines/reference/awaitBinaryExpression5_es5.types index 6d1ebb42c84..70a93686478 100644 --- a/tests/baselines/reference/awaitBinaryExpression5_es5.types +++ b/tests/baselines/reference/awaitBinaryExpression5_es5.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function before(): void; >before : () => void @@ -14,7 +13,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitBinaryExpression5_es6.types b/tests/baselines/reference/awaitBinaryExpression5_es6.types index 649d160a847..bfaa09b2a50 100644 --- a/tests/baselines/reference/awaitBinaryExpression5_es6.types +++ b/tests/baselines/reference/awaitBinaryExpression5_es6.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function before(): void; >before : () => void @@ -14,7 +13,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression1_es2017.types b/tests/baselines/reference/awaitCallExpression1_es2017.types index c5cea091878..beec53fbff7 100644 --- a/tests/baselines/reference/awaitCallExpression1_es2017.types +++ b/tests/baselines/reference/awaitCallExpression1_es2017.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression1_es5.types b/tests/baselines/reference/awaitCallExpression1_es5.types index 8e712443cab..51036264464 100644 --- a/tests/baselines/reference/awaitCallExpression1_es5.types +++ b/tests/baselines/reference/awaitCallExpression1_es5.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression1_es6.types b/tests/baselines/reference/awaitCallExpression1_es6.types index 3807379a2f2..46717889ede 100644 --- a/tests/baselines/reference/awaitCallExpression1_es6.types +++ b/tests/baselines/reference/awaitCallExpression1_es6.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression2_es2017.types b/tests/baselines/reference/awaitCallExpression2_es2017.types index a15609a4078..311a79bedcb 100644 --- a/tests/baselines/reference/awaitCallExpression2_es2017.types +++ b/tests/baselines/reference/awaitCallExpression2_es2017.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression2_es5.types b/tests/baselines/reference/awaitCallExpression2_es5.types index 5fd85ce3921..51ffd1d4ba7 100644 --- a/tests/baselines/reference/awaitCallExpression2_es5.types +++ b/tests/baselines/reference/awaitCallExpression2_es5.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression2_es6.types b/tests/baselines/reference/awaitCallExpression2_es6.types index 8758fea7f95..fed499e5987 100644 --- a/tests/baselines/reference/awaitCallExpression2_es6.types +++ b/tests/baselines/reference/awaitCallExpression2_es6.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression3_es2017.types b/tests/baselines/reference/awaitCallExpression3_es2017.types index a491836fa06..5f3c7e3825d 100644 --- a/tests/baselines/reference/awaitCallExpression3_es2017.types +++ b/tests/baselines/reference/awaitCallExpression3_es2017.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression3_es5.types b/tests/baselines/reference/awaitCallExpression3_es5.types index d2d851c1dae..7999f82f6ce 100644 --- a/tests/baselines/reference/awaitCallExpression3_es5.types +++ b/tests/baselines/reference/awaitCallExpression3_es5.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression3_es6.types b/tests/baselines/reference/awaitCallExpression3_es6.types index 490fd861a61..56596ad7f5f 100644 --- a/tests/baselines/reference/awaitCallExpression3_es6.types +++ b/tests/baselines/reference/awaitCallExpression3_es6.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression4_es2017.types b/tests/baselines/reference/awaitCallExpression4_es2017.types index 3f1b478e669..d394487c1d0 100644 --- a/tests/baselines/reference/awaitCallExpression4_es2017.types +++ b/tests/baselines/reference/awaitCallExpression4_es2017.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression4_es5.types b/tests/baselines/reference/awaitCallExpression4_es5.types index 0b510c46998..204590a2d38 100644 --- a/tests/baselines/reference/awaitCallExpression4_es5.types +++ b/tests/baselines/reference/awaitCallExpression4_es5.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression4_es6.types b/tests/baselines/reference/awaitCallExpression4_es6.types index d8a514a67e6..203e4c36455 100644 --- a/tests/baselines/reference/awaitCallExpression4_es6.types +++ b/tests/baselines/reference/awaitCallExpression4_es6.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression5_es2017.types b/tests/baselines/reference/awaitCallExpression5_es2017.types index f31320e44f7..4c404d55472 100644 --- a/tests/baselines/reference/awaitCallExpression5_es2017.types +++ b/tests/baselines/reference/awaitCallExpression5_es2017.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression5_es5.types b/tests/baselines/reference/awaitCallExpression5_es5.types index b4b6d947275..2b619bafe9d 100644 --- a/tests/baselines/reference/awaitCallExpression5_es5.types +++ b/tests/baselines/reference/awaitCallExpression5_es5.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression5_es6.types b/tests/baselines/reference/awaitCallExpression5_es6.types index 3e9f1c6387e..115310d5913 100644 --- a/tests/baselines/reference/awaitCallExpression5_es6.types +++ b/tests/baselines/reference/awaitCallExpression5_es6.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression6_es2017.types b/tests/baselines/reference/awaitCallExpression6_es2017.types index ccce4cad366..22be57f670c 100644 --- a/tests/baselines/reference/awaitCallExpression6_es2017.types +++ b/tests/baselines/reference/awaitCallExpression6_es2017.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression6_es5.types b/tests/baselines/reference/awaitCallExpression6_es5.types index e34839f3c15..a09d92fee05 100644 --- a/tests/baselines/reference/awaitCallExpression6_es5.types +++ b/tests/baselines/reference/awaitCallExpression6_es5.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression6_es6.types b/tests/baselines/reference/awaitCallExpression6_es6.types index 6c5f0f9063e..d7353a88196 100644 --- a/tests/baselines/reference/awaitCallExpression6_es6.types +++ b/tests/baselines/reference/awaitCallExpression6_es6.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression7_es2017.types b/tests/baselines/reference/awaitCallExpression7_es2017.types index aefe7916852..574fde5a8f6 100644 --- a/tests/baselines/reference/awaitCallExpression7_es2017.types +++ b/tests/baselines/reference/awaitCallExpression7_es2017.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression7_es5.types b/tests/baselines/reference/awaitCallExpression7_es5.types index 9d220c6c8b8..6cdb961aedd 100644 --- a/tests/baselines/reference/awaitCallExpression7_es5.types +++ b/tests/baselines/reference/awaitCallExpression7_es5.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression7_es6.types b/tests/baselines/reference/awaitCallExpression7_es6.types index e36b3773091..9acc195ad0c 100644 --- a/tests/baselines/reference/awaitCallExpression7_es6.types +++ b/tests/baselines/reference/awaitCallExpression7_es6.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression8_es2017.types b/tests/baselines/reference/awaitCallExpression8_es2017.types index a9a115d39f2..6fcbed0fd0d 100644 --- a/tests/baselines/reference/awaitCallExpression8_es2017.types +++ b/tests/baselines/reference/awaitCallExpression8_es2017.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression8_es5.types b/tests/baselines/reference/awaitCallExpression8_es5.types index 1b2fa16d1fc..46e4088898d 100644 --- a/tests/baselines/reference/awaitCallExpression8_es5.types +++ b/tests/baselines/reference/awaitCallExpression8_es5.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitCallExpression8_es6.types b/tests/baselines/reference/awaitCallExpression8_es6.types index 8258ba830b2..ed0dbb8abd6 100644 --- a/tests/baselines/reference/awaitCallExpression8_es6.types +++ b/tests/baselines/reference/awaitCallExpression8_es6.types @@ -4,7 +4,6 @@ declare var a: boolean; declare var p: Promise; >p : Promise ->Promise : Promise declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void @@ -21,14 +20,12 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Promise<(arg0: boolean, arg1: boolean, arg2: boolean) => void> ->Promise : Promise >arg0 : boolean >arg1 : boolean >arg2 : boolean declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }> ->Promise : Promise >fn : (arg0: boolean, arg1: boolean, arg2: boolean) => void >arg0 : boolean >arg1 : boolean @@ -42,7 +39,6 @@ declare function after(): void; async function func(): Promise { >func : () => Promise ->Promise : Promise before(); >before() : void diff --git a/tests/baselines/reference/awaitClassExpression_es2017.types b/tests/baselines/reference/awaitClassExpression_es2017.types index 39d17b1cc50..83927633d99 100644 --- a/tests/baselines/reference/awaitClassExpression_es2017.types +++ b/tests/baselines/reference/awaitClassExpression_es2017.types @@ -4,12 +4,10 @@ declare class C { } declare var p: Promise; >p : Promise ->Promise : Promise >C : typeof C async function func(): Promise { >func : () => Promise ->Promise : Promise class D extends (await p) { >D : D diff --git a/tests/baselines/reference/awaitClassExpression_es5.types b/tests/baselines/reference/awaitClassExpression_es5.types index e1f4bf8f82e..d413b622624 100644 --- a/tests/baselines/reference/awaitClassExpression_es5.types +++ b/tests/baselines/reference/awaitClassExpression_es5.types @@ -4,12 +4,10 @@ declare class C { } declare var p: Promise; >p : Promise ->Promise : Promise >C : typeof C async function func(): Promise { >func : () => Promise ->Promise : Promise class D extends (await p) { >D : D diff --git a/tests/baselines/reference/awaitClassExpression_es6.types b/tests/baselines/reference/awaitClassExpression_es6.types index 4a778021720..5dccdb045ee 100644 --- a/tests/baselines/reference/awaitClassExpression_es6.types +++ b/tests/baselines/reference/awaitClassExpression_es6.types @@ -4,12 +4,10 @@ declare class C { } declare var p: Promise; >p : Promise ->Promise : Promise >C : typeof C async function func(): Promise { >func : () => Promise ->Promise : Promise class D extends (await p) { >D : D diff --git a/tests/baselines/reference/awaitInheritedPromise_es2017.types b/tests/baselines/reference/awaitInheritedPromise_es2017.types index bed681181b0..c41160297eb 100644 --- a/tests/baselines/reference/awaitInheritedPromise_es2017.types +++ b/tests/baselines/reference/awaitInheritedPromise_es2017.types @@ -1,11 +1,7 @@ === tests/cases/conformance/async/es2017/awaitInheritedPromise_es2017.ts === interface A extends Promise {} ->A : A ->Promise : Promise - declare var a: A; >a : A ->A : A async function f() { >f : () => Promise diff --git a/tests/baselines/reference/awaitUnionPromise.types b/tests/baselines/reference/awaitUnionPromise.types index f1d91c038de..792be1d7e4e 100644 --- a/tests/baselines/reference/awaitUnionPromise.types +++ b/tests/baselines/reference/awaitUnionPromise.types @@ -6,31 +6,17 @@ class AsyncEnumeratorDone { }; >AsyncEnumeratorDone : AsyncEnumeratorDone interface IAsyncEnumerator { ->IAsyncEnumerator : IAsyncEnumerator ->T : T - next1(): Promise; >next1 : () => Promise ->Promise : Promise ->T : T ->AsyncEnumeratorDone : AsyncEnumeratorDone next2(): Promise | Promise; >next2 : () => Promise | Promise ->Promise : Promise ->T : T ->Promise : Promise ->AsyncEnumeratorDone : AsyncEnumeratorDone next3(): Promise; >next3 : () => Promise<{} | T> ->Promise : Promise ->T : T next4(): Promise; >next4 : () => Promise ->Promise : Promise ->T : T >x : string } @@ -39,7 +25,6 @@ async function main() { const x: IAsyncEnumerator = null; >x : IAsyncEnumerator ->IAsyncEnumerator : IAsyncEnumerator >null : null let a = await x.next1(); diff --git a/tests/baselines/reference/awaitUnion_es5.types b/tests/baselines/reference/awaitUnion_es5.types index 25c54d37ae8..443b9ba6469 100644 --- a/tests/baselines/reference/awaitUnion_es5.types +++ b/tests/baselines/reference/awaitUnion_es5.types @@ -4,20 +4,15 @@ declare let a: number | string; declare let b: PromiseLike | PromiseLike; >b : PromiseLike | PromiseLike ->PromiseLike : PromiseLike ->PromiseLike : PromiseLike declare let c: PromiseLike; >c : PromiseLike ->PromiseLike : PromiseLike declare let d: number | PromiseLike; >d : number | PromiseLike ->PromiseLike : PromiseLike declare let e: number | PromiseLike; >e : number | PromiseLike ->PromiseLike : PromiseLike async function f() { >f : () => Promise diff --git a/tests/baselines/reference/awaitUnion_es6.types b/tests/baselines/reference/awaitUnion_es6.types index e15bf60fce2..2f1f31a0082 100644 --- a/tests/baselines/reference/awaitUnion_es6.types +++ b/tests/baselines/reference/awaitUnion_es6.types @@ -4,20 +4,15 @@ declare let a: number | string; declare let b: PromiseLike | PromiseLike; >b : PromiseLike | PromiseLike ->PromiseLike : PromiseLike ->PromiseLike : PromiseLike declare let c: PromiseLike; >c : PromiseLike ->PromiseLike : PromiseLike declare let d: number | PromiseLike; >d : number | PromiseLike ->PromiseLike : PromiseLike declare let e: number | PromiseLike; >e : number | PromiseLike ->PromiseLike : PromiseLike async function f() { >f : () => Promise diff --git a/tests/baselines/reference/badArraySyntax.types b/tests/baselines/reference/badArraySyntax.types index 579dc76301f..053b4af9448 100644 --- a/tests/baselines/reference/badArraySyntax.types +++ b/tests/baselines/reference/badArraySyntax.types @@ -9,7 +9,6 @@ class Z { var a1: Z[] = []; >a1 : Z[] ->Z : Z >[] : undefined[] var a2 = new Z[]; @@ -28,7 +27,6 @@ var a3 = new Z[](); var a4: Z[] = new Z[]; >a4 : Z[] ->Z : Z >new Z[] : any >Z[] : any >Z : typeof Z @@ -36,7 +34,6 @@ var a4: Z[] = new Z[]; var a5: Z[] = new Z[](); >a5 : Z[] ->Z : Z >new Z[]() : any >Z[] : any >Z : typeof Z @@ -44,7 +41,6 @@ var a5: Z[] = new Z[](); var a6: Z[][] = new Z [ ] [ ]; >a6 : Z[][] ->Z : Z >new Z [ ] [ ] : any >Z [ ] [ ] : any >Z [ ] : any diff --git a/tests/baselines/reference/badExternalModuleReference.types b/tests/baselines/reference/badExternalModuleReference.types index 61314d8abb8..82fdfd62f79 100644 --- a/tests/baselines/reference/badExternalModuleReference.types +++ b/tests/baselines/reference/badExternalModuleReference.types @@ -8,11 +8,9 @@ export declare var a: { test1: a1.connectModule; >test1 : any >a1 : any ->connectModule : any (): a1.connectExport; >a1 : any ->connectExport : any }; diff --git a/tests/baselines/reference/baseClassImprovedMismatchErrors.types b/tests/baselines/reference/baseClassImprovedMismatchErrors.types index 0ca00a02248..d1e79659d3e 100644 --- a/tests/baselines/reference/baseClassImprovedMismatchErrors.types +++ b/tests/baselines/reference/baseClassImprovedMismatchErrors.types @@ -4,7 +4,6 @@ class Base { n: Base | string; >n : string | Base ->Base : Base fn() { >fn : () => number @@ -19,7 +18,6 @@ class Derived extends Base { n: Derived | string; >n : string | Derived ->Derived : Derived fn() { >fn : () => string | number @@ -31,11 +29,9 @@ class Derived extends Base { } class DerivedInterface implements Base { >DerivedInterface : DerivedInterface ->Base : Base n: DerivedInterface | string; >n : string | DerivedInterface ->DerivedInterface : DerivedInterface fn() { >fn : () => string | number diff --git a/tests/baselines/reference/baseConstraintOfDecorator.types b/tests/baselines/reference/baseConstraintOfDecorator.types index f1af8a8d503..edf9641a4ba 100644 --- a/tests/baselines/reference/baseConstraintOfDecorator.types +++ b/tests/baselines/reference/baseConstraintOfDecorator.types @@ -1,13 +1,10 @@ === tests/cases/compiler/baseConstraintOfDecorator.ts === export function classExtender(superClass: TFunction, _instanceModifier: (instance: any, args: any[]) => void): TFunction { >classExtender : (superClass: TFunction, _instanceModifier: (instance: any, args: any[]) => void) => TFunction ->TFunction : TFunction >superClass : TFunction ->TFunction : TFunction >_instanceModifier : (instance: any, args: any[]) => void >instance : any >args : any[] ->TFunction : TFunction return class decoratorFunc extends superClass { >class decoratorFunc extends superClass { constructor(...args: any[]) { super(...args); _instanceModifier(this, args); } } : typeof decoratorFunc diff --git a/tests/baselines/reference/baseExpressionTypeParameters.types b/tests/baselines/reference/baseExpressionTypeParameters.types index 252d39e5e36..0b317935ec6 100644 --- a/tests/baselines/reference/baseExpressionTypeParameters.types +++ b/tests/baselines/reference/baseExpressionTypeParameters.types @@ -3,14 +3,12 @@ function base() { >base : () => typeof Base ->T : T class Base { >Base : Base static prop: T; >prop : T ->T : T } return Base; >Base : typeof Base @@ -18,10 +16,8 @@ function base() { class Gen extends base() {} // Error, T not in scope >Gen : Gen ->T : T >base() : base.Base >base : () => typeof Base ->T : No type information available! class Spec extends Gen {} >Spec : Spec diff --git a/tests/baselines/reference/baseIndexSignatureResolution.types b/tests/baselines/reference/baseIndexSignatureResolution.types index 17fb5cf85de..49ecc21f02e 100644 --- a/tests/baselines/reference/baseIndexSignatureResolution.types +++ b/tests/baselines/reference/baseIndexSignatureResolution.types @@ -10,31 +10,19 @@ class Derived extends Base { private b: string; } // Note - commmenting "extends Foo" prevents the error interface Foo { ->Foo : Foo - [i: number]: Base; >i : number ->Base : Base } interface FooOf extends Foo { ->FooOf : FooOf ->TBase : TBase ->Base : Base ->Foo : Foo - [i: number]: TBase; >i : number ->TBase : TBase } var x: FooOf = null; >x : FooOf ->FooOf : FooOf ->Derived : Derived >null : null var y: Derived = x[0]; >y : Derived ->Derived : Derived >x[0] : Derived >x : FooOf >0 : 0 diff --git a/tests/baselines/reference/baseTypeAfterDerivedType.types b/tests/baselines/reference/baseTypeAfterDerivedType.types index 2ac50aa019a..b4b182ad24c 100644 --- a/tests/baselines/reference/baseTypeAfterDerivedType.types +++ b/tests/baselines/reference/baseTypeAfterDerivedType.types @@ -1,16 +1,11 @@ === tests/cases/compiler/baseTypeAfterDerivedType.ts === interface Derived extends Base { ->Derived : Derived ->Base : Base - method(...args: any[]): void; >method : (...args: any[]) => void >args : any[] } interface Base { ->Base : Base - method(...args: any[]): void; >method : (...args: any[]) => void >args : any[] @@ -18,7 +13,6 @@ interface Base { class Derived2 implements Base2 { >Derived2 : Derived2 ->Base2 : Base2 method(...args: any[]): void { } >method : (...args: any[]) => void @@ -26,8 +20,6 @@ class Derived2 implements Base2 { } interface Base2 { ->Base2 : Base2 - method(...args: any[]): void; >method : (...args: any[]) => void >args : any[] diff --git a/tests/baselines/reference/baseTypeOrderChecking.types b/tests/baselines/reference/baseTypeOrderChecking.types index 4193f255f36..2664465d4de 100644 --- a/tests/baselines/reference/baseTypeOrderChecking.types +++ b/tests/baselines/reference/baseTypeOrderChecking.types @@ -1,8 +1,6 @@ === tests/cases/compiler/baseTypeOrderChecking.ts === var someVariable: Class4; >someVariable : Class4 ->Class4 : Class4 ->Class2 : Class2 @@ -27,13 +25,11 @@ class Class2 extends Class1 class Class3 >Class3 : Class3 ->T : T { public memberVariable: Class2; >memberVariable : Class2 ->Class2 : Class2 } @@ -41,9 +37,7 @@ class Class3 class Class4 extends Class3 >Class4 : Class4 ->T : T >Class3 : Class3 ->T : T { diff --git a/tests/baselines/reference/baseTypePrivateMemberClash.types b/tests/baselines/reference/baseTypePrivateMemberClash.types index 6cd8b89628a..e3c80e6717b 100644 --- a/tests/baselines/reference/baseTypePrivateMemberClash.types +++ b/tests/baselines/reference/baseTypePrivateMemberClash.types @@ -13,7 +13,3 @@ class Y { } interface Z extends X, Y { } ->Z : Z ->X : X ->Y : Y - diff --git a/tests/baselines/reference/baseTypeWrappingInstantiationChain.types b/tests/baselines/reference/baseTypeWrappingInstantiationChain.types index ede580c6c7d..127241a26c7 100644 --- a/tests/baselines/reference/baseTypeWrappingInstantiationChain.types +++ b/tests/baselines/reference/baseTypeWrappingInstantiationChain.types @@ -1,47 +1,35 @@ === tests/cases/compiler/baseTypeWrappingInstantiationChain.ts === class CBaseBase { >CBaseBase : CBaseBase ->T3 : T3 constructor(x: Parameter) { } >x : Parameter ->Parameter : Parameter ->T3 : T3 } class CBase extends CBaseBase> { >CBase : CBase ->T2 : T2 >CBaseBase : CBaseBase> ->Wrapper : Wrapper ->T2 : T2 } class Parameter { >Parameter : Parameter ->T4 : T4 method(t: T4) { } >method : (t: T4) => void >t : T4 ->T4 : T4 } class Wrapper { >Wrapper : Wrapper ->T5 : T5 property: T5; >property : T5 ->T5 : T5 } class C extends CBase { >C : C ->T1 : T1 >CBase : CBase ->T1 : T1 public works() { >works : () => void @@ -49,8 +37,6 @@ class C extends CBase { new CBaseBase>(this); >new CBaseBase>(this) : CBaseBase> >CBaseBase : typeof CBaseBase ->Wrapper : Wrapper ->T1 : T1 >this : this } public alsoWorks() { @@ -59,14 +45,11 @@ class C extends CBase { new CBase(this); // Should not error, parameter is of type Parameter> >new CBase(this) : CBase >CBase : typeof CBase ->T1 : T1 >this : this } public method(t: Wrapper) { } >method : (t: Wrapper) => void >t : Wrapper ->Wrapper : Wrapper ->T1 : T1 } diff --git a/tests/baselines/reference/bases.types b/tests/baselines/reference/bases.types index 46a641a1881..60bc5b786fb 100644 --- a/tests/baselines/reference/bases.types +++ b/tests/baselines/reference/bases.types @@ -1,7 +1,5 @@ === tests/cases/compiler/bases.ts === interface I { ->I : I - x; >x : any } @@ -21,7 +19,6 @@ class B { class C extends B implements I { >C : C >B : B ->I : I constructor() { this.x: any; diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types index 9a10984a522..60483f27213 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types @@ -28,15 +28,12 @@ class Derived2 extends Base { baz: string; } var base: Base; >base : Base ->Base : Base var derived: Derived; >derived : Derived ->Derived : Derived var derived2: Derived2; >derived2 : Derived2 ->Derived2 : Derived2 var r = true ? 1 : 2; >r : number @@ -74,19 +71,16 @@ var r6 = true ? (x: number) => { } : (x: Object) => { }; // returns number => vo >x : number >(x: Object) => { } : (x: Object) => void >x : Object ->Object : Object var r7: (x: Object) => void = true ? (x: number) => { } : (x: Object) => { }; >r7 : (x: Object) => void >x : Object ->Object : Object >true ? (x: number) => { } : (x: Object) => { } : (x: number) => void >true : true >(x: number) => { } : (x: number) => void >x : number >(x: Object) => { } : (x: Object) => void >x : Object ->Object : Object var r8 = true ? (x: Object) => { } : (x: number) => { }; // returns Object => void >r8 : (x: Object) => void @@ -94,13 +88,11 @@ var r8 = true ? (x: Object) => { } : (x: number) => { }; // returns Object => vo >true : true >(x: Object) => { } : (x: Object) => void >x : Object ->Object : Object >(x: number) => { } : (x: number) => void >x : number var r10: Base = true ? derived : derived2; // no error since we use the contextual type in BCT >r10 : Base ->Base : Base >true ? derived : derived2 : Derived | Derived2 >true : true >derived : Derived @@ -115,13 +107,8 @@ var r11 = true ? base : derived2; function foo5(t: T, u: U): Object { >foo5 : (t: T, u: U) => Object ->T : T ->U : U >t : T ->T : T >u : U ->U : U ->Object : Object return true ? t : u; // BCT is Object >true ? t : u : T | U diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.types b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.types index ad09c274c9b..f9488bedd36 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.types +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.types @@ -18,15 +18,12 @@ class Derived2 extends Base { baz: string; } var base: Base; >base : Base ->Base : Base var derived: Derived; >derived : Derived ->Derived : Derived var derived2: Derived2; >derived2 : Derived2 ->Derived2 : Derived2 var r2 = true ? 1 : ''; >r2 : string | number @@ -44,12 +41,8 @@ var r9 = true ? derived : derived2; function foo(t: T, u: U) { >foo : (t: T, u: U) => T | U ->T : T ->U : U >t : T ->T : T >u : U ->U : U return true ? t : u; >true ? t : u : T | U @@ -60,13 +53,8 @@ function foo(t: T, u: U) { function foo2(t: T, u: U) { // Error for referencing own type parameter >foo2 : (t: T, u: U) => U ->T : T ->U : U ->U : U >t : T ->T : T >u : U ->U : U return true ? t : u; // Ok because BCT(T, U) = U >true ? t : u : U @@ -77,15 +65,8 @@ function foo2(t: T, u: U) { // Error for referencing own type pa function foo3(t: T, u: U) { >foo3 : (t: T, u: U) => U ->T : T ->U : U ->U : U ->V : V ->V : V >t : T ->T : T >u : U ->U : U return true ? t : u; >true ? t : u : U diff --git a/tests/baselines/reference/bestCommonTypeOfTuple.types b/tests/baselines/reference/bestCommonTypeOfTuple.types index d62503b57d6..67c6c08654b 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple.types +++ b/tests/baselines/reference/bestCommonTypeOfTuple.types @@ -30,16 +30,12 @@ var t1: [(x: number) => string, (x: number) => number]; var t2: [E1, E2]; >t2 : [E1, E2] ->E1 : E1 ->E2 : E2 var t3: [number, any]; >t3 : [number, any] var t4: [E1, E2, number]; >t4 : [E1, E2, number] ->E1 : E1 ->E2 : E2 // no error t1 = [f1, f2]; diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.types b/tests/baselines/reference/bestCommonTypeOfTuple2.types index b64da59d5b0..33691bc65a9 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.types +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.types @@ -1,24 +1,18 @@ === tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple2.ts === interface base { } ->base : base - interface base1 { i } ->base1 : base1 >i : any class C implements base { c } >C : C ->base : base >c : any class D implements base { d } >D : D ->base : base >d : any class E implements base { e } >E : E ->base : base >e : any class F extends C { f } @@ -28,7 +22,6 @@ class F extends C { f } class C1 implements base1 { i = "foo"; c } >C1 : C1 ->base1 : base1 >i : string >"foo" : "foo" >c : any @@ -42,28 +35,18 @@ class D1 extends C1 { i = "bar"; d } var t1: [C, base]; >t1 : [C, base] ->C : C ->base : base var t2: [C, D]; >t2 : [C, D] ->C : C ->D : D var t3: [C1, D1]; >t3 : [C1, D1] ->C1 : C1 ->D1 : D1 var t4: [base1, C1]; >t4 : [base1, C1] ->base1 : base1 ->C1 : C1 var t5: [C1, F] >t5 : [C1, F] ->C1 : C1 ->F : F var e11 = t1[4]; // base >e11 : base | C diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.types b/tests/baselines/reference/bestCommonTypeReturnStatement.types index 3cc3a221212..c8545f57866 100644 --- a/tests/baselines/reference/bestCommonTypeReturnStatement.types +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.types @@ -1,16 +1,11 @@ === tests/cases/compiler/bestCommonTypeReturnStatement.ts === interface IPromise { ->IPromise : IPromise ->T : T - then(successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any): IPromise; >then : (successCallback: (promiseValue: T) => any, errorCallback?: (reason: any) => any) => IPromise >successCallback : (promiseValue: T) => any >promiseValue : T ->T : T >errorCallback : (reason: any) => any >reason : any ->IPromise : IPromise } function f() { @@ -29,11 +24,9 @@ function f() { function b(): IPromise { return null; } >b : () => IPromise ->IPromise : IPromise >null : null function d(): IPromise { return null; } >d : () => IPromise ->IPromise : IPromise >null : null diff --git a/tests/baselines/reference/bestCommonTypeWithContextualTyping.types b/tests/baselines/reference/bestCommonTypeWithContextualTyping.types index 5baca43b752..889b344a070 100644 --- a/tests/baselines/reference/bestCommonTypeWithContextualTyping.types +++ b/tests/baselines/reference/bestCommonTypeWithContextualTyping.types @@ -1,7 +1,5 @@ === tests/cases/compiler/bestCommonTypeWithContextualTyping.ts === interface Contextual { ->Contextual : Contextual - dummy; >dummy : any @@ -10,8 +8,6 @@ interface Contextual { } interface Ellement { ->Ellement : Ellement - dummy; >dummy : any @@ -21,28 +17,24 @@ interface Ellement { var e: Ellement; >e : Ellement ->Ellement : Ellement // All of these should pass. Neither type is a supertype of the other, but the RHS should // always use Ellement in these examples (not Contextual). Because Ellement is assignable // to Contextual, no errors. var arr: Contextual[] = [e]; // Ellement[] >arr : Contextual[] ->Contextual : Contextual >[e] : Ellement[] >e : Ellement var obj: { [s: string]: Contextual } = { s: e }; // { s: Ellement; [s: string]: Ellement } >obj : { [s: string]: Contextual; } >s : string ->Contextual : Contextual >{ s: e } : { s: Ellement; } >s : Ellement >e : Ellement var conditional: Contextual = null ? e : e; // Ellement >conditional : Contextual ->Contextual : Contextual >null ? e : e : Ellement >null : null >e : Ellement @@ -50,7 +42,6 @@ var conditional: Contextual = null ? e : e; // Ellement var contextualOr: Contextual = e || e; // Ellement >contextualOr : Contextual ->Contextual : Contextual >e || e : Ellement >e : Ellement >e : Ellement diff --git a/tests/baselines/reference/bestCommonTypeWithOptionalProperties.types b/tests/baselines/reference/bestCommonTypeWithOptionalProperties.types index df40291b0e5..6d5d6cb8726 100644 --- a/tests/baselines/reference/bestCommonTypeWithOptionalProperties.types +++ b/tests/baselines/reference/bestCommonTypeWithOptionalProperties.types @@ -1,29 +1,21 @@ === tests/cases/compiler/bestCommonTypeWithOptionalProperties.ts === interface X { foo: string } ->X : X >foo : string interface Y extends X { bar?: number } ->Y : Y ->X : X >bar : number interface Z extends X { bar: string } ->Z : Z ->X : X >bar : string var x: X; >x : X ->X : X var y: Y; >y : Y ->Y : Y var z: Z; >z : Z ->Z : Z // All these arrays should be X[] var b1 = [x, y, z]; diff --git a/tests/baselines/reference/bind1.types b/tests/baselines/reference/bind1.types index 7502febacca..111def9c7f0 100644 --- a/tests/baselines/reference/bind1.types +++ b/tests/baselines/reference/bind1.types @@ -4,7 +4,6 @@ module M { export class C implements I {} // this should be an unresolved symbol I error >C : C ->I : No type information available! } diff --git a/tests/baselines/reference/bluebirdStaticThis.types b/tests/baselines/reference/bluebirdStaticThis.types index a3a968cd828..7708a733c59 100644 --- a/tests/baselines/reference/bluebirdStaticThis.types +++ b/tests/baselines/reference/bluebirdStaticThis.types @@ -5,164 +5,110 @@ // Tests by: Bart van der Schoor export declare class Promise implements Promise.Thenable { >Promise : Promise ->R : R ->Promise.Thenable : any >Promise : typeof Promise ->Thenable : Promise.Thenable ->R : R constructor(callback: (resolve: (thenableOrResult: R | Promise.Thenable) => void, reject: (error: any) => void) => void); >callback : (resolve: (thenableOrResult: R | Promise.Thenable) => void, reject: (error: any) => void) => void >resolve : (thenableOrResult: R | Promise.Thenable) => void >thenableOrResult : R | Promise.Thenable ->R : R >Promise : any ->Thenable : Promise.Thenable ->R : R >reject : (error: any) => void >error : any static try(dit: typeof Promise, fn: () => Promise.Thenable, args?: any[], ctx?: any): Promise; >try : { (dit: typeof Promise, fn: () => Promise.Thenable, args?: any[], ctx?: any): Promise; (dit: typeof Promise, fn: () => R, args?: any[], ctx?: any): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >fn : () => Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >args : any[] >ctx : any ->Promise : Promise ->R : R static try(dit: typeof Promise, fn: () => R, args?: any[], ctx?: any): Promise; >try : { (dit: typeof Promise, fn: () => Promise.Thenable, args?: any[], ctx?: any): Promise; (dit: typeof Promise, fn: () => R, args?: any[], ctx?: any): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >fn : () => R ->R : R >args : any[] >ctx : any ->Promise : Promise ->R : R static attempt(dit: typeof Promise, fn: () => Promise.Thenable, args?: any[], ctx?: any): Promise; >attempt : { (dit: typeof Promise, fn: () => Promise.Thenable, args?: any[], ctx?: any): Promise; (dit: typeof Promise, fn: () => R, args?: any[], ctx?: any): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >fn : () => Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >args : any[] >ctx : any ->Promise : Promise ->R : R static attempt(dit: typeof Promise, fn: () => R, args?: any[], ctx?: any): Promise; >attempt : { (dit: typeof Promise, fn: () => Promise.Thenable, args?: any[], ctx?: any): Promise; (dit: typeof Promise, fn: () => R, args?: any[], ctx?: any): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >fn : () => R ->R : R >args : any[] >ctx : any ->Promise : Promise ->R : R static method(dit: typeof Promise, fn: Function): Function; >method : (dit: typeof Promise, fn: Function) => Function >dit : typeof Promise >Promise : typeof Promise >fn : Function ->Function : Function ->Function : Function static resolve(dit: typeof Promise): Promise; >resolve : { (dit: typeof Promise): Promise; (dit: typeof Promise, value: Promise.Thenable): Promise; (dit: typeof Promise, value: R): Promise; } >dit : typeof Promise >Promise : typeof Promise ->Promise : Promise static resolve(dit: typeof Promise, value: Promise.Thenable): Promise; >resolve : { (dit: typeof Promise): Promise; (dit: typeof Promise, value: Promise.Thenable): Promise; (dit: typeof Promise, value: R): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >value : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R ->Promise : Promise ->R : R static resolve(dit: typeof Promise, value: R): Promise; >resolve : { (dit: typeof Promise): Promise; (dit: typeof Promise, value: Promise.Thenable): Promise; (dit: typeof Promise, value: R): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >value : R ->R : R ->Promise : Promise ->R : R static reject(dit: typeof Promise, reason: any): Promise; >reject : { (dit: typeof Promise, reason: any): Promise; (dit: typeof Promise, reason: any): Promise; } >dit : typeof Promise >Promise : typeof Promise >reason : any ->Promise : Promise static reject(dit: typeof Promise, reason: any): Promise; >reject : { (dit: typeof Promise, reason: any): Promise; (dit: typeof Promise, reason: any): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >reason : any ->Promise : Promise ->R : R static defer(dit: typeof Promise): Promise.Resolver; >defer : (dit: typeof Promise) => any ->R : R >dit : typeof Promise >Promise : typeof Promise >Promise : any ->Resolver : No type information available! ->R : R static cast(dit: typeof Promise, value: Promise.Thenable): Promise; >cast : { (dit: typeof Promise, value: Promise.Thenable): Promise; (dit: typeof Promise, value: R): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >value : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R ->Promise : Promise ->R : R static cast(dit: typeof Promise, value: R): Promise; >cast : { (dit: typeof Promise, value: Promise.Thenable): Promise; (dit: typeof Promise, value: R): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >value : R ->R : R ->Promise : Promise ->R : R static bind(dit: typeof Promise, thisArg: any): Promise; >bind : (dit: typeof Promise, thisArg: any) => Promise >dit : typeof Promise >Promise : typeof Promise >thisArg : any ->Promise : Promise static is(dit: typeof Promise, value: any): boolean; >is : (dit: typeof Promise, value: any) => boolean @@ -177,70 +123,49 @@ export declare class Promise implements Promise.Thenable { static delay(dit: typeof Promise, value: Promise.Thenable, ms: number): Promise; >delay : { (dit: typeof Promise, value: Promise.Thenable, ms: number): Promise; (dit: typeof Promise, value: R, ms: number): Promise; (dit: typeof Promise, ms: number): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >value : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >ms : number ->Promise : Promise ->R : R static delay(dit: typeof Promise, value: R, ms: number): Promise; >delay : { (dit: typeof Promise, value: Promise.Thenable, ms: number): Promise; (dit: typeof Promise, value: R, ms: number): Promise; (dit: typeof Promise, ms: number): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >value : R ->R : R >ms : number ->Promise : Promise ->R : R static delay(dit: typeof Promise, ms: number): Promise; >delay : { (dit: typeof Promise, value: Promise.Thenable, ms: number): Promise; (dit: typeof Promise, value: R, ms: number): Promise; (dit: typeof Promise, ms: number): Promise; } >dit : typeof Promise >Promise : typeof Promise >ms : number ->Promise : Promise static promisify(dit: typeof Promise, nodeFunction: Function, receiver?: any): Function; >promisify : (dit: typeof Promise, nodeFunction: Function, receiver?: any) => Function >dit : typeof Promise >Promise : typeof Promise >nodeFunction : Function ->Function : Function >receiver : any ->Function : Function static promisifyAll(dit: typeof Promise, target: Object): Object; >promisifyAll : (dit: typeof Promise, target: Object) => Object >dit : typeof Promise >Promise : typeof Promise >target : Object ->Object : Object ->Object : Object static coroutine(dit: typeof Promise, generatorFunction: Function): Function; >coroutine : (dit: typeof Promise, generatorFunction: Function) => Function ->R : R >dit : typeof Promise >Promise : typeof Promise >generatorFunction : Function ->Function : Function ->Function : Function static spawn(dit: typeof Promise, generatorFunction: Function): Promise; >spawn : (dit: typeof Promise, generatorFunction: Function) => Promise ->R : R >dit : typeof Promise >Promise : typeof Promise >generatorFunction : Function ->Function : Function ->Promise : Promise ->R : R static noConflict(dit: typeof Promise): typeof Promise; >noConflict : (dit: typeof Promise) => typeof Promise @@ -257,863 +182,504 @@ export declare class Promise implements Promise.Thenable { static all(dit: typeof Promise, values: Promise.Thenable[]>): Promise; >all : { (dit: typeof Promise, values: Promise.Thenable[]>): Promise; (dit: typeof Promise, values: Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]): Promise; (dit: typeof Promise, values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[]> >Promise : any ->Thenable : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R ->Promise : Promise ->R : R static all(dit: typeof Promise, values: Promise.Thenable): Promise; >all : { (dit: typeof Promise, values: Promise.Thenable[]>): Promise; (dit: typeof Promise, values: Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]): Promise; (dit: typeof Promise, values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R ->Promise : Promise ->R : R static all(dit: typeof Promise, values: Promise.Thenable[]): Promise; >all : { (dit: typeof Promise, values: Promise.Thenable[]>): Promise; (dit: typeof Promise, values: Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]): Promise; (dit: typeof Promise, values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[] >Promise : any ->Thenable : Promise.Thenable ->R : R ->Promise : Promise ->R : R static all(dit: typeof Promise, values: R[]): Promise; >all : { (dit: typeof Promise, values: Promise.Thenable[]>): Promise; (dit: typeof Promise, values: Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]): Promise; (dit: typeof Promise, values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : R[] ->R : R ->Promise : Promise ->R : R static props(dit: typeof Promise, object: Promise): Promise; >props : { (dit: typeof Promise, object: Promise): Promise; (dit: typeof Promise, object: Object): Promise; } >dit : typeof Promise >Promise : typeof Promise >object : Promise ->Promise : Promise ->Object : Object ->Promise : Promise ->Object : Object static props(dit: typeof Promise, object: Object): Promise; >props : { (dit: typeof Promise, object: Promise): Promise; (dit: typeof Promise, object: Object): Promise; } >dit : typeof Promise >Promise : typeof Promise >object : Object ->Object : Object ->Promise : Promise ->Object : Object static settle(dit: typeof Promise, values: Promise.Thenable[]>): Promise[]>; >settle : { (dit: typeof Promise, values: Promise.Thenable[]>): Promise; (dit: typeof Promise, values: Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]): Promise; (dit: typeof Promise, values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[]> >Promise : any ->Thenable : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R ->Promise : Promise >Promise : any ->Inspection : No type information available! ->R : R static settle(dit: typeof Promise, values: Promise.Thenable): Promise[]>; >settle : { (dit: typeof Promise, values: Promise.Thenable[]>): Promise; (dit: typeof Promise, values: Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]): Promise; (dit: typeof Promise, values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R ->Promise : Promise >Promise : any ->Inspection : No type information available! ->R : R static settle(dit: typeof Promise, values: Promise.Thenable[]): Promise[]>; >settle : { (dit: typeof Promise, values: Promise.Thenable[]>): Promise; (dit: typeof Promise, values: Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]): Promise; (dit: typeof Promise, values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[] >Promise : any ->Thenable : Promise.Thenable ->R : R ->Promise : Promise >Promise : any ->Inspection : No type information available! ->R : R static settle(dit: typeof Promise, values: R[]): Promise[]>; >settle : { (dit: typeof Promise, values: Promise.Thenable[]>): Promise; (dit: typeof Promise, values: Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]): Promise; (dit: typeof Promise, values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : R[] ->R : R ->Promise : Promise >Promise : any ->Inspection : No type information available! ->R : R static any(dit: typeof Promise, values: Promise.Thenable[]>): Promise; >any : { (dit: typeof Promise, values: Promise.Thenable[]>): Promise; (dit: typeof Promise, values: Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]): Promise; (dit: typeof Promise, values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[]> >Promise : any ->Thenable : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R ->Promise : Promise ->R : R static any(dit: typeof Promise, values: Promise.Thenable): Promise; >any : { (dit: typeof Promise, values: Promise.Thenable[]>): Promise; (dit: typeof Promise, values: Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]): Promise; (dit: typeof Promise, values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R ->Promise : Promise ->R : R static any(dit: typeof Promise, values: Promise.Thenable[]): Promise; >any : { (dit: typeof Promise, values: Promise.Thenable[]>): Promise; (dit: typeof Promise, values: Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]): Promise; (dit: typeof Promise, values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[] >Promise : any ->Thenable : Promise.Thenable ->R : R ->Promise : Promise ->R : R static any(dit: typeof Promise, values: R[]): Promise; >any : { (dit: typeof Promise, values: Promise.Thenable[]>): Promise; (dit: typeof Promise, values: Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]): Promise; (dit: typeof Promise, values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : R[] ->R : R ->Promise : Promise ->R : R static race(dit: typeof Promise, values: Promise.Thenable[]>): Promise; >race : { (dit: typeof Promise, values: Promise.Thenable[]>): Promise; (dit: typeof Promise, values: Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]): Promise; (dit: typeof Promise, values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[]> >Promise : any ->Thenable : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R ->Promise : Promise ->R : R static race(dit: typeof Promise, values: Promise.Thenable): Promise; >race : { (dit: typeof Promise, values: Promise.Thenable[]>): Promise; (dit: typeof Promise, values: Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]): Promise; (dit: typeof Promise, values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R ->Promise : Promise ->R : R static race(dit: typeof Promise, values: Promise.Thenable[]): Promise; >race : { (dit: typeof Promise, values: Promise.Thenable[]>): Promise; (dit: typeof Promise, values: Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]): Promise; (dit: typeof Promise, values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[] >Promise : any ->Thenable : Promise.Thenable ->R : R ->Promise : Promise ->R : R static race(dit: typeof Promise, values: R[]): Promise; >race : { (dit: typeof Promise, values: Promise.Thenable[]>): Promise; (dit: typeof Promise, values: Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]): Promise; (dit: typeof Promise, values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : R[] ->R : R ->Promise : Promise ->R : R static some(dit: typeof Promise, values: Promise.Thenable[]>, count: number): Promise; >some : { (dit: typeof Promise, values: Promise.Thenable[]>, count: number): Promise; (dit: typeof Promise, values: Promise.Thenable, count: number): Promise; (dit: typeof Promise, values: Promise.Thenable[], count: number): Promise; (dit: typeof Promise, values: R[], count: number): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[]> >Promise : any ->Thenable : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >count : number ->Promise : Promise ->R : R static some(dit: typeof Promise, values: Promise.Thenable, count: number): Promise; >some : { (dit: typeof Promise, values: Promise.Thenable[]>, count: number): Promise; (dit: typeof Promise, values: Promise.Thenable, count: number): Promise; (dit: typeof Promise, values: Promise.Thenable[], count: number): Promise; (dit: typeof Promise, values: R[], count: number): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >count : number ->Promise : Promise ->R : R static some(dit: typeof Promise, values: Promise.Thenable[], count: number): Promise; >some : { (dit: typeof Promise, values: Promise.Thenable[]>, count: number): Promise; (dit: typeof Promise, values: Promise.Thenable, count: number): Promise; (dit: typeof Promise, values: Promise.Thenable[], count: number): Promise; (dit: typeof Promise, values: R[], count: number): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[] >Promise : any ->Thenable : Promise.Thenable ->R : R >count : number ->Promise : Promise ->R : R static some(dit: typeof Promise, values: R[], count: number): Promise; >some : { (dit: typeof Promise, values: Promise.Thenable[]>, count: number): Promise; (dit: typeof Promise, values: Promise.Thenable, count: number): Promise; (dit: typeof Promise, values: Promise.Thenable[], count: number): Promise; (dit: typeof Promise, values: R[], count: number): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : R[] ->R : R >count : number ->Promise : Promise ->R : R static join(dit: typeof Promise, ...values: Promise.Thenable[]): Promise; >join : { (dit: typeof Promise, ...values: Promise.Thenable[]): Promise; (dit: typeof Promise, ...values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[] >Promise : any ->Thenable : Promise.Thenable ->R : R ->Promise : Promise ->R : R static join(dit: typeof Promise, ...values: R[]): Promise; >join : { (dit: typeof Promise, ...values: Promise.Thenable[]): Promise; (dit: typeof Promise, ...values: R[]): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : R[] ->R : R ->Promise : Promise ->R : R static map(dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; >map : { (dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; } ->R : R ->U : U >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[]> >Promise : any ->Thenable : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >mapper : (item: R, index: number, arrayLength: number) => Promise.Thenable >item : R ->R : R >index : number >arrayLength : number >Promise : any ->Thenable : Promise.Thenable ->U : U ->Promise : Promise ->U : U static map(dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise; >map : { (dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; } ->R : R ->U : U >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[]> >Promise : any ->Thenable : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >mapper : (item: R, index: number, arrayLength: number) => U >item : R ->R : R >index : number >arrayLength : number ->U : U ->Promise : Promise ->U : U static map(dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; >map : { (dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; } ->R : R ->U : U >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >mapper : (item: R, index: number, arrayLength: number) => Promise.Thenable >item : R ->R : R >index : number >arrayLength : number >Promise : any ->Thenable : Promise.Thenable ->U : U ->Promise : Promise ->U : U static map(dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => U): Promise; >map : { (dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; } ->R : R ->U : U >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >mapper : (item: R, index: number, arrayLength: number) => U >item : R ->R : R >index : number >arrayLength : number ->U : U ->Promise : Promise ->U : U static map(dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; >map : { (dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; } ->R : R ->U : U >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[] >Promise : any ->Thenable : Promise.Thenable ->R : R >mapper : (item: R, index: number, arrayLength: number) => Promise.Thenable >item : R ->R : R >index : number >arrayLength : number >Promise : any ->Thenable : Promise.Thenable ->U : U ->Promise : Promise ->U : U static map(dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; >map : { (dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; } ->R : R ->U : U >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[] >Promise : any ->Thenable : Promise.Thenable ->R : R >mapper : (item: R, index: number, arrayLength: number) => U >item : R ->R : R >index : number >arrayLength : number ->U : U ->Promise : Promise ->U : U static map(dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; >map : { (dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; } ->R : R ->U : U >dit : typeof Promise >Promise : typeof Promise >values : R[] ->R : R >mapper : (item: R, index: number, arrayLength: number) => Promise.Thenable >item : R ->R : R >index : number >arrayLength : number >Promise : any ->Thenable : Promise.Thenable ->U : U ->Promise : Promise ->U : U static map(dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; >map : { (dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; (dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; } ->R : R ->U : U >dit : typeof Promise >Promise : typeof Promise >values : R[] ->R : R >mapper : (item: R, index: number, arrayLength: number) => U >item : R ->R : R >index : number >arrayLength : number ->U : U ->Promise : Promise ->U : U static reduce(dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; >reduce : { (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; } ->R : R ->U : U >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[]> >Promise : any ->Thenable : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >reducer : (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable >total : U ->U : U >current : R ->R : R >index : number >arrayLength : number >Promise : any ->Thenable : Promise.Thenable ->U : U >initialValue : U ->U : U ->Promise : Promise ->U : U static reduce(dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; >reduce : { (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; } ->R : R ->U : U >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[]> >Promise : any ->Thenable : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >reducer : (total: U, current: R, index: number, arrayLength: number) => U >total : U ->U : U >current : R ->R : R >index : number >arrayLength : number ->U : U >initialValue : U ->U : U ->Promise : Promise ->U : U static reduce(dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; >reduce : { (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; } ->R : R ->U : U >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >reducer : (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable >total : U ->U : U >current : R ->R : R >index : number >arrayLength : number >Promise : any ->Thenable : Promise.Thenable ->U : U >initialValue : U ->U : U ->Promise : Promise ->U : U static reduce(dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; >reduce : { (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; } ->R : R ->U : U >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >reducer : (total: U, current: R, index: number, arrayLength: number) => U >total : U ->U : U >current : R ->R : R >index : number >arrayLength : number ->U : U >initialValue : U ->U : U ->Promise : Promise ->U : U static reduce(dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; >reduce : { (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; } ->R : R ->U : U >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[] >Promise : any ->Thenable : Promise.Thenable ->R : R >reducer : (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable >total : U ->U : U >current : R ->R : R >index : number >arrayLength : number >Promise : any ->Thenable : Promise.Thenable ->U : U >initialValue : U ->U : U ->Promise : Promise ->U : U static reduce(dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; >reduce : { (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; } ->R : R ->U : U >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[] >Promise : any ->Thenable : Promise.Thenable ->R : R >reducer : (total: U, current: R, index: number, arrayLength: number) => U >total : U ->U : U >current : R ->R : R >index : number >arrayLength : number ->U : U >initialValue : U ->U : U ->Promise : Promise ->U : U static reduce(dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; >reduce : { (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; } ->R : R ->U : U >dit : typeof Promise >Promise : typeof Promise >values : R[] ->R : R >reducer : (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable >total : U ->U : U >current : R ->R : R >index : number >arrayLength : number >Promise : any ->Thenable : Promise.Thenable ->U : U >initialValue : U ->U : U ->Promise : Promise ->U : U static reduce(dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; >reduce : { (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; (dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; } ->R : R ->U : U >dit : typeof Promise >Promise : typeof Promise >values : R[] ->R : R >reducer : (total: U, current: R, index: number, arrayLength: number) => U >total : U ->U : U >current : R ->R : R >index : number >arrayLength : number ->U : U >initialValue : U ->U : U ->Promise : Promise ->U : U static filter(dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; >filter : { (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[]> >Promise : any ->Thenable : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >filterer : (item: R, index: number, arrayLength: number) => Promise.Thenable >item : R ->R : R >index : number >arrayLength : number >Promise : any ->Thenable : Promise.Thenable ->Promise : Promise ->R : R static filter(dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; >filter : { (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[]> >Promise : any ->Thenable : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >filterer : (item: R, index: number, arrayLength: number) => boolean >item : R ->R : R >index : number >arrayLength : number ->Promise : Promise ->R : R static filter(dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; >filter : { (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >filterer : (item: R, index: number, arrayLength: number) => Promise.Thenable >item : R ->R : R >index : number >arrayLength : number >Promise : any ->Thenable : Promise.Thenable ->Promise : Promise ->R : R static filter(dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; >filter : { (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable >Promise : any ->Thenable : Promise.Thenable ->R : R >filterer : (item: R, index: number, arrayLength: number) => boolean >item : R ->R : R >index : number >arrayLength : number ->Promise : Promise ->R : R static filter(dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; >filter : { (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[] >Promise : any ->Thenable : Promise.Thenable ->R : R >filterer : (item: R, index: number, arrayLength: number) => Promise.Thenable >item : R ->R : R >index : number >arrayLength : number >Promise : any ->Thenable : Promise.Thenable ->Promise : Promise ->R : R static filter(dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; >filter : { (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : Promise.Thenable[] >Promise : any ->Thenable : Promise.Thenable ->R : R >filterer : (item: R, index: number, arrayLength: number) => boolean >item : R ->R : R >index : number >arrayLength : number ->Promise : Promise ->R : R static filter(dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; >filter : { (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : R[] ->R : R >filterer : (item: R, index: number, arrayLength: number) => Promise.Thenable >item : R ->R : R >index : number >arrayLength : number >Promise : any ->Thenable : Promise.Thenable ->Promise : Promise ->R : R static filter(dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; >filter : { (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; (dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; (dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; } ->R : R >dit : typeof Promise >Promise : typeof Promise >values : R[] ->R : R >filterer : (item: R, index: number, arrayLength: number) => boolean >item : R ->R : R >index : number >arrayLength : number ->Promise : Promise ->R : R } export declare module Promise { ->Promise : typeof Promise - export interface Thenable { ->Thenable : Thenable ->R : R - then(onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; >then : { (onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; (onFulfilled: (value: R) => Thenable, onRejected?: (error: any) => U): Thenable; (onFulfilled: (value: R) => U, onRejected: (error: any) => Thenable): Thenable; (onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Thenable; } ->U : U >onFulfilled : (value: R) => Thenable >value : R ->R : R ->Thenable : Thenable ->U : U >onRejected : (error: any) => Thenable >error : any ->Thenable : Thenable ->U : U ->Thenable : Thenable ->U : U then(onFulfilled: (value: R) => Thenable, onRejected?: (error: any) => U): Thenable; >then : { (onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; (onFulfilled: (value: R) => Thenable, onRejected?: (error: any) => U): Thenable; (onFulfilled: (value: R) => U, onRejected: (error: any) => Thenable): Thenable; (onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Thenable; } ->U : U >onFulfilled : (value: R) => Thenable >value : R ->R : R ->Thenable : Thenable ->U : U >onRejected : (error: any) => U >error : any ->U : U ->Thenable : Thenable ->U : U then(onFulfilled: (value: R) => U, onRejected: (error: any) => Thenable): Thenable; >then : { (onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; (onFulfilled: (value: R) => Thenable, onRejected?: (error: any) => U): Thenable; (onFulfilled: (value: R) => U, onRejected: (error: any) => Thenable): Thenable; (onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Thenable; } ->U : U >onFulfilled : (value: R) => U >value : R ->R : R ->U : U >onRejected : (error: any) => Thenable >error : any ->Thenable : Thenable ->U : U ->Thenable : Thenable ->U : U then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Thenable; >then : { (onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; (onFulfilled: (value: R) => Thenable, onRejected?: (error: any) => U): Thenable; (onFulfilled: (value: R) => U, onRejected: (error: any) => Thenable): Thenable; (onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Thenable; } ->U : U >onFulfilled : (value: R) => U >value : R ->R : R ->U : U >onRejected : (error: any) => U >error : any ->U : U ->Thenable : Thenable ->U : U } } interface Foo { ->Foo : Foo - a: number; >a : number @@ -1128,12 +694,9 @@ var arr: any[]; var foo: Foo; >foo : Foo ->Foo : Foo var fooProm: Promise; >fooProm : Promise ->Promise : Promise ->Foo : Foo fooProm = Promise.try(Promise, () => { >fooProm = Promise.try(Promise, () => { return foo;}) : Promise diff --git a/tests/baselines/reference/boolInsteadOfBoolean.types b/tests/baselines/reference/boolInsteadOfBoolean.types index b22e09393c0..81d66b1b472 100644 --- a/tests/baselines/reference/boolInsteadOfBoolean.types +++ b/tests/baselines/reference/boolInsteadOfBoolean.types @@ -1,7 +1,6 @@ === tests/cases/conformance/types/primitives/boolean/boolInsteadOfBoolean.ts === var x: bool; >x : any ->bool : No type information available! var a: boolean = x; >a : boolean diff --git a/tests/baselines/reference/booleanLiteralTypes1.types b/tests/baselines/reference/booleanLiteralTypes1.types index 3ea7000e3be..8cd0a4331a7 100644 --- a/tests/baselines/reference/booleanLiteralTypes1.types +++ b/tests/baselines/reference/booleanLiteralTypes1.types @@ -14,11 +14,9 @@ function f1() { var a: A1; >a : boolean ->A1 : boolean var a: A2; >a : boolean ->A2 : boolean var a: true | false; >a : boolean @@ -261,7 +259,6 @@ type Item = function f20(x: Item) { >f20 : (x: Item) => string >x : Item ->Item : Item switch (x.kind) { >x.kind : boolean @@ -285,7 +282,6 @@ function f20(x: Item) { function f21(x: Item) { >f21 : (x: Item) => string >x : Item ->Item : Item switch (x.kind) { >x.kind : boolean diff --git a/tests/baselines/reference/booleanLiteralTypes2.types b/tests/baselines/reference/booleanLiteralTypes2.types index 8c0116407cc..52e4d85e0bd 100644 --- a/tests/baselines/reference/booleanLiteralTypes2.types +++ b/tests/baselines/reference/booleanLiteralTypes2.types @@ -14,11 +14,9 @@ function f1() { var a: A1; >a : boolean ->A1 : boolean var a: A2; >a : boolean ->A2 : boolean var a: true | false; >a : boolean @@ -261,7 +259,6 @@ type Item = function f20(x: Item) { >f20 : (x: Item) => string >x : Item ->Item : Item switch (x.kind) { >x.kind : boolean @@ -285,7 +282,6 @@ function f20(x: Item) { function f21(x: Item) { >f21 : (x: Item) => string >x : Item ->Item : Item switch (x.kind) { >x.kind : boolean diff --git a/tests/baselines/reference/booleanLiteralsContextuallyTypedFromUnion.types b/tests/baselines/reference/booleanLiteralsContextuallyTypedFromUnion.types index 4741619c85b..d30986c3859 100644 --- a/tests/baselines/reference/booleanLiteralsContextuallyTypedFromUnion.types +++ b/tests/baselines/reference/booleanLiteralsContextuallyTypedFromUnion.types @@ -1,20 +1,16 @@ === tests/cases/compiler/booleanLiteralsContextuallyTypedFromUnion.tsx === interface A { isIt: true; text: string; } ->A : A >isIt : true >true : true >text : string interface B { isIt: false; value: number; } ->B : B >isIt : false >false : false >value : number type C = A | B; >C : C ->A : A ->B : B const isIt = Math.random() > 0.5; >isIt : boolean @@ -27,7 +23,6 @@ const isIt = Math.random() > 0.5; const c: C = isIt ? { isIt, text: 'hey' } : { isIt, value: 123 }; >c : C ->C : C >isIt ? { isIt, text: 'hey' } : { isIt, value: 123 } : { isIt: true; text: string; } | { isIt: false; value: number; } >isIt : boolean >{ isIt, text: 'hey' } : { isIt: true; text: string; } @@ -41,7 +36,6 @@ const c: C = isIt ? { isIt, text: 'hey' } : { isIt, value: 123 }; const cc: C = isIt ? { isIt: isIt, text: 'hey' } : { isIt: isIt, value: 123 }; >cc : C ->C : C >isIt ? { isIt: isIt, text: 'hey' } : { isIt: isIt, value: 123 } : { isIt: true; text: string; } | { isIt: false; value: number; } >isIt : boolean >{ isIt: isIt, text: 'hey' } : { isIt: true; text: string; } @@ -77,7 +71,6 @@ let Funk = (_props: ComponentProps) =>
Hello
; >Funk : (_props: ComponentProps) => JSX.Element >(_props: ComponentProps) =>
Hello
: (_props: ComponentProps) => JSX.Element >_props : ComponentProps ->ComponentProps : ComponentProps >
Hello
: JSX.Element >div : any >div : any diff --git a/tests/baselines/reference/callExpressionWithMissingTypeArgument1.types b/tests/baselines/reference/callExpressionWithMissingTypeArgument1.types index bd07bb31cac..2cce81d4454 100644 --- a/tests/baselines/reference/callExpressionWithMissingTypeArgument1.types +++ b/tests/baselines/reference/callExpressionWithMissingTypeArgument1.types @@ -2,7 +2,4 @@ Foo(); >Foo() : any >Foo : any ->a : No type information available! -> : No type information available! ->b : No type information available! diff --git a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types index 76b8a513702..14eb3a52ed5 100644 --- a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types +++ b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.types @@ -1,18 +1,10 @@ === tests/cases/compiler/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.ts === interface I { ->I : I ->T : T - (u: U): U; ->U : U ->T : T >u : U ->U : U ->U : U } var i: I; >i : I ->I : I var y = i(""); // y should be string >y : "" diff --git a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.types b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.types index da8a4a339b5..992b8f30ba3 100644 --- a/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.types +++ b/tests/baselines/reference/callGenericFunctionWithIncorrectNumberOfTypeArguments.types @@ -4,13 +4,8 @@ function f(x: T, y: U): T { return null; } >f : (x: T, y: U) => T ->T : T ->U : U >x : T ->T : T >y : U ->U : U ->T : T >null : null var r1 = f(1, ''); @@ -30,13 +25,8 @@ var r1b = f(1, ''); var f2 = (x: T, y: U): T => { return null; } >f2 : (x: T, y: U) => T >(x: T, y: U): T => { return null; } : (x: T, y: U) => T ->T : T ->U : U >x : T ->T : T >y : U ->U : U ->T : T >null : null var r2 = f2(1, ''); @@ -55,13 +45,8 @@ var r2b = f2(1, ''); var f3: { (x: T, y: U): T; } >f3 : (x: T, y: U) => T ->T : T ->U : U >x : T ->T : T >y : U ->U : U ->T : T var r3 = f3(1, ''); >r3 : any @@ -82,13 +67,8 @@ class C { f(x: T, y: U): T { >f : (x: T, y: U) => T ->T : T ->U : U >x : T ->T : T >y : U ->U : U ->T : T return null; >null : null @@ -117,21 +97,13 @@ var r4b = (new C()).f(1, ''); >'' : "" interface I { ->I : I - f(x: T, y: U): T; >f : (x: T, y: U) => T ->T : T ->U : U >x : T ->T : T >y : U ->U : U ->T : T } var i: I; >i : I ->I : I var r5 = i.f(1, ''); >r5 : any @@ -153,16 +125,11 @@ var r5b = i.f(1, ''); class C2 { >C2 : C2 ->T : T ->U : U f(x: T, y: U): T { >f : (x: T, y: U) => T >x : T ->T : T >y : U ->U : U ->T : T return null; >null : null @@ -191,21 +158,13 @@ var r6b = (new C2()).f(1, ''); >'' : "" interface I2 { ->I2 : I2 ->T : T ->U : U - f(x: T, y: U): T; >f : (x: T, y: U) => T >x : T ->T : T >y : U ->U : U ->T : T } var i2: I2; >i2 : I2 ->I2 : I2 var r7 = i2.f(1, ''); >r7 : number diff --git a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types index 99fc2d955d1..63798c4225d 100644 --- a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types +++ b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types @@ -3,10 +3,7 @@ function f(x: T): T { return null; } >f : (x: T) => T ->T : T >x : T ->T : T ->T : T >null : null var r = f(1); @@ -18,10 +15,7 @@ var r = f(1); var f2 = (x: T): T => { return null; } >f2 : (x: T) => T >(x: T): T => { return null; } : (x: T) => T ->T : T >x : T ->T : T ->T : T >null : null var r2 = f2(1); @@ -32,10 +26,7 @@ var r2 = f2(1); var f3: { (x: T): T; } >f3 : (x: T) => T ->T : T >x : T ->T : T ->T : T var r3 = f3(1); >r3 : number @@ -48,10 +39,7 @@ class C { f(x: T): T { >f : (x: T) => T ->T : T >x : T ->T : T ->T : T return null; >null : null @@ -68,18 +56,12 @@ var r4 = (new C()).f(1); >1 : 1 interface I { ->I : I - f(x: T): T; >f : (x: T) => T ->T : T >x : T ->T : T ->T : T } var i: I; >i : I ->I : I var r5 = i.f(1); >r5 : number @@ -91,13 +73,10 @@ var r5 = i.f(1); class C2 { >C2 : C2 ->T : T f(x: T): T { >f : (x: T) => T >x : T ->T : T ->T : T return null; >null : null @@ -114,18 +93,12 @@ var r6 = (new C2()).f(1); >1 : 1 interface I2 { ->I2 : I2 ->T : T - f(x: T): T; >f : (x: T) => T >x : T ->T : T ->T : T } var i2: I2; >i2 : I2 ->I2 : I2 var r7 = i2.f(1); >r7 : number diff --git a/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.types b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.types index b7155b564ef..c22f31e1254 100644 --- a/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.types +++ b/tests/baselines/reference/callNonGenericFunctionWithTypeArguments.types @@ -57,15 +57,12 @@ var r4 = (new C()).f(1); >1 : 1 interface I { ->I : I - f(x: number): any; >f : (x: number) => any >x : number } var i: I; >i : I ->I : I var r5 = i.f(1); >r5 : any @@ -97,15 +94,12 @@ var r6 = (new C2()).f(1); >1 : 1 interface I2 { ->I2 : I2 - f(x: number); >f : (x: number) => any >x : number } var i2: I2; >i2 : I2 ->I2 : I2 var r7 = i2.f(1); >r7 : any diff --git a/tests/baselines/reference/callOverloads2.types b/tests/baselines/reference/callOverloads2.types index 1d1b4b3370b..6718d22a191 100644 --- a/tests/baselines/reference/callOverloads2.types +++ b/tests/baselines/reference/callOverloads2.types @@ -32,7 +32,6 @@ function Goo(s:string); // error - no implementation declare function Gar(s:String); // expect no error >Gar : (s: String) => any >s : String ->String : String var f1 = new Foo("hey"); >f1 : any diff --git a/tests/baselines/reference/callOverloads3.types b/tests/baselines/reference/callOverloads3.types index f8717534cae..eeef5edc339 100644 --- a/tests/baselines/reference/callOverloads3.types +++ b/tests/baselines/reference/callOverloads3.types @@ -1,12 +1,10 @@ === tests/cases/compiler/callOverloads3.ts === function Foo():Foo; // error >Foo : { (): any; (s: string): any; } ->Foo : No type information available! function Foo(s:string):Foo; // error >Foo : { (): any; (s: string): any; } >s : string ->Foo : No type information available! class Foo { // error >Foo : Foo diff --git a/tests/baselines/reference/callOverloads4.types b/tests/baselines/reference/callOverloads4.types index 60d8ced5d1d..45a84ed10c6 100644 --- a/tests/baselines/reference/callOverloads4.types +++ b/tests/baselines/reference/callOverloads4.types @@ -1,12 +1,10 @@ === tests/cases/compiler/callOverloads4.ts === function Foo():Foo; // error >Foo : { (): any; (s: string): any; } ->Foo : No type information available! function Foo(s:string):Foo; // error >Foo : { (): any; (s: string): any; } >s : string ->Foo : No type information available! class Foo { // error >Foo : Foo diff --git a/tests/baselines/reference/callOverloads5.types b/tests/baselines/reference/callOverloads5.types index 1125fbe0ee1..45e5d77d5aa 100644 --- a/tests/baselines/reference/callOverloads5.types +++ b/tests/baselines/reference/callOverloads5.types @@ -1,12 +1,10 @@ === tests/cases/compiler/callOverloads5.ts === function Foo():Foo; // error >Foo : { (): any; (s: string): any; } ->Foo : No type information available! function Foo(s:string):Foo; // error >Foo : { (): any; (s: string): any; } >s : string ->Foo : No type information available! class Foo { // error >Foo : Foo diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance.types b/tests/baselines/reference/callSignatureAssignabilityInInheritance.types index 2463d04b91d..a48c2616d04 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance.types +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance.types @@ -1,10 +1,6 @@ === tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance.ts === module CallSignature { ->CallSignature : any - interface Base { // T ->Base : Base - // M's (x: number): void; >x : number @@ -16,9 +12,6 @@ module CallSignature { // S's interface I extends Base { ->I : I ->Base : Base - // N's (x: number): number; // ok because base returns void >x : number @@ -28,14 +21,10 @@ module CallSignature { >y : number (x: T): string; // ok because base returns void ->T : T >x : T ->T : T } interface Base2 { // T ->Base2 : Base2 - // M's (x: number): number; >x : number @@ -43,9 +32,6 @@ module CallSignature { // S's interface I2 extends Base2 { ->I2 : I2 ->Base2 : Base2 - // N's (x: number): string; // error because base returns non-void; >x : number @@ -53,23 +39,14 @@ module CallSignature { // S's interface I3 extends Base2 { ->I3 : I3 ->Base2 : Base2 - // N's (x: T): string; // ok, adds a new call signature ->T : T >x : T ->T : T } } module MemberWithCallSignature { ->MemberWithCallSignature : any - interface Base { // T ->Base : Base - // M's a: (x: number) => void; >a : (x: number) => void @@ -82,16 +59,11 @@ module MemberWithCallSignature { a3: (x: T) => void; >a3 : (x: T) => void ->T : T >x : T ->T : T } // S's interface I extends Base { ->I : I ->Base : Base - // N's a: (x: number) => number; // ok because base returns void >a : (x: number) => number @@ -104,14 +76,10 @@ module MemberWithCallSignature { a3: (x: T) => string; // ok because base returns void >a3 : (x: T) => string ->T : T >x : T ->T : T } interface Base2 { // T ->Base2 : Base2 - // M's a: (x: number) => number; >a : (x: number) => number @@ -119,17 +87,11 @@ module MemberWithCallSignature { a2: (x: T) => T; >a2 : (x: T) => T ->T : T >x : T ->T : T ->T : T } // S's interface I2 extends Base2 { ->I2 : I2 ->Base2 : Base2 - // N's a: (x: number) => string; // error because base returns non-void; >a : (x: number) => string @@ -138,14 +100,9 @@ module MemberWithCallSignature { // S's interface I3 extends Base2 { ->I3 : I3 ->Base2 : Base2 - // N's a2: (x: T) => string; // error because base returns non-void; >a2 : (x: T) => string ->T : T >x : T ->T : T } } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.types b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.types index 335413cd73e..ab6daaf8b5b 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.types +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.types @@ -21,8 +21,6 @@ class OtherDerived extends Base { bing: string; } >bing : string interface A { // T ->A : A - // M's a: (x: number) => number[]; >a : (x: number) => number[] @@ -50,53 +48,32 @@ interface A { // T >a6 : (x: (arg: Base) => Derived) => Base >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived ->Base : Base a7: (x: (arg: Base) => Derived) => (r: Base) => Derived; >a7 : (x: (arg: Base) => Derived) => (r: Base) => Derived >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived : Derived a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; >a8 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >y : (arg2: Base) => Derived >arg2 : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived : Derived a9: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; >a9 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >y : (arg2: Base) => Derived >arg2 : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived : Derived a10: (...x: Derived[]) => Derived; >a10 : (...x: Derived[]) => Derived >x : Derived[] ->Derived : Derived ->Derived : Derived a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; >a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base @@ -105,36 +82,22 @@ interface A { // T >y : { foo: string; bar: string; } >foo : string >bar : string ->Base : Base a12: (x: Array, y: Array) => Array; >a12 : (x: Base[], y: Derived2[]) => Derived[] >x : Base[] ->Array : T[] ->Base : Base >y : Derived2[] ->Array : T[] ->Derived2 : Derived2 ->Array : T[] ->Derived : Derived a13: (x: Array, y: Array) => Array; >a13 : (x: Base[], y: Derived[]) => Derived[] >x : Base[] ->Array : T[] ->Base : Base >y : Derived[] ->Array : T[] ->Derived : Derived ->Array : T[] ->Derived : Derived a14: (x: { a: string; b: number }) => Object; >a14 : (x: { a: string; b: number; }) => Object >x : { a: string; b: number; } >a : string >b : number ->Object : Object a15: { >a15 : { (x: number): number[]; (x: string): string[]; } @@ -150,16 +113,10 @@ interface A { // T >a16 : { (x: T): number[]; (x: U): number[]; } (x: T): number[]; ->T : T ->Derived : Derived >x : T ->T : T (x: U): number[]; ->U : U ->Base : Base >x : U ->U : U }; a17: { @@ -195,8 +152,6 @@ interface A { // T (a: Date): Date; >a : Date ->Date : Date ->Date : Date }): any[]; }; @@ -204,195 +159,98 @@ interface A { // T // S's interface I extends A { ->I : I ->A : A - // N's a: (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number >a : (x: T) => T[] ->T : T >x : T ->T : T ->T : T a2: (x: T) => string[]; // ok >a2 : (x: T) => string[] ->T : T >x : T ->T : T a3: (x: T) => T; // ok since Base returns void >a3 : (x: T) => T ->T : T >x : T ->T : T ->T : T a4: (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number >a4 : (x: T, y: U) => T ->T : T ->U : U >x : T ->T : T >y : U ->U : U ->T : T a5: (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made >a5 : (x: (arg: T) => U) => T ->T : T ->U : U >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T a6: (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy >a6 : (x: (arg: T) => U) => T ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T a7: (x: (arg: T) => U) => (r: T) => U; // ok >a7 : (x: (arg: T) => U) => (r: T) => U ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U >r : T ->T : T ->U : U a8: (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok >a8 : (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U >y : (arg2: T) => U >arg2 : T ->T : T ->U : U >r : T ->T : T ->U : U a9: (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal >a9 : (x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U >y : (arg2: { foo: string; bing: number; }) => U >arg2 : { foo: string; bing: number; } >foo : string >bing : number ->U : U >r : T ->T : T ->U : U a10: (...x: T[]) => T; // ok >a10 : (...x: T[]) => T ->T : T ->Derived : Derived >x : T[] ->T : T ->T : T a11: (x: T, y: T) => T; // ok >a11 : (x: T, y: T) => T ->T : T ->Base : Base >x : T ->T : T >y : T ->T : T ->T : T a12: >(x: Array, y: T) => Array; // ok, less specific parameter type >a12 : (x: Base[], y: T) => Derived[] ->T : T ->Array : T[] ->Base : Base >x : Base[] ->Array : T[] ->Base : Base >y : T ->T : T ->Array : T[] ->Derived : Derived a13: >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds >a13 : (x: Base[], y: T) => T ->T : T ->Array : T[] ->Derived : Derived >x : Base[] ->Array : T[] ->Base : Base >y : T ->T : T ->T : T a14: (x: { a: T; b: T }) => T; // ok, best common type yields T = {} but that's satisfactory for this signature >a14 : (x: { a: T; b: T; }) => T ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T a15: (x: T) => T[]; // ok >a15 : (x: T) => T[] ->T : T >x : T ->T : T ->T : T a16: (x: T) => number[]; // ok >a16 : (x: T) => number[] ->T : T ->Base : Base >x : T ->T : T a17: (x: (a: T) => T) => T[]; // ok >a17 : (x: (a: T) => T) => T[] ->T : T >x : (a: T) => T >a : T ->T : T ->T : T ->T : T a18: (x: (a: T) => T) => T[]; // ok, no inferences for T but assignable to any >a18 : (x: (a: T) => T) => T[] ->T : T >x : (a: T) => T >a : T ->T : T ->T : T ->T : T } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.types b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.types index 6eb3ddaadea..70229e8867a 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.types +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.types @@ -25,12 +25,8 @@ module Errors { >bing : string module WithNonGenericSignaturesInBaseType { ->WithNonGenericSignaturesInBaseType : any - // base type with non-generic call signatures interface A { ->A : A - a2: (x: number) => string[]; >a2 : (x: number) => string[] >x : number @@ -39,31 +35,19 @@ module Errors { >a7 : (x: (arg: Base) => Derived) => (r: Base) => Derived2 >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived2 : Derived2 a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; >a8 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >y : (arg2: Base) => Derived >arg2 : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived : Derived a10: (...x: Base[]) => Base; >a10 : (...x: Base[]) => Base >x : Base[] ->Base : Base ->Base : Base a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; >a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base @@ -72,18 +56,11 @@ module Errors { >y : { foo: string; bar: string; } >foo : string >bar : string ->Base : Base a12: (x: Array, y: Array) => Array; >a12 : (x: Base[], y: Derived2[]) => Derived[] >x : Base[] ->Array : T[] ->Base : Base >y : Derived2[] ->Array : T[] ->Derived2 : Derived2 ->Array : T[] ->Derived : Derived a14: { >a14 : { (x: number): number[]; (x: string): string[]; } @@ -133,264 +110,134 @@ module Errors { >x : { (a: T): T; (a: T): T; } (a: T): T; ->T : T ->Derived : Derived >a : T ->T : T ->T : T (a: T): T; ->T : T ->Base : Base >a : T ->T : T ->T : T }): any[]; (x: { >x : { (a: T): T; (a: T): T; } (a: T): T; ->T : T ->Derived2 : Derived2 >a : T ->T : T ->T : T (a: T): T; ->T : T ->Base : Base >a : T ->T : T ->T : T }): any[]; }; } interface I extends A { ->I : I ->A : A - a2: (x: T) => U[]; // error, contextual signature instantiation doesn't relate return types so U is {}, not a subtype of string[] >a2 : (x: T) => U[] ->T : T ->U : U >x : T ->T : T ->U : U } interface I2 extends A { ->I2 : I2 ->T : T ->U : U ->A : A - a2: (x: T) => U[]; // error, no contextual signature instantiation since I2.a2 is not generic >a2 : (x: T) => U[] >x : T ->T : T ->U : U } interface I3 extends A { ->I3 : I3 ->A : A - // valid, no inferences for V so it defaults to Derived2 a7: (x: (arg: T) => U) => (r: T) => V; >a7 : (x: (arg: T) => U) => (r: T) => V ->T : T ->Base : Base ->U : U ->Derived : Derived ->V : V ->Derived2 : Derived2 >x : (arg: T) => U >arg : T ->T : T ->U : U >r : T ->T : T ->V : V } interface I4 extends A { ->I4 : I4 ->A : A - a8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch >a8 : (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U >y : (arg2: { foo: number; }) => U >arg2 : { foo: number; } >foo : number ->U : U >r : T ->T : T ->U : U } interface I4B extends A { ->I4B : I4B ->A : A - a10: (...x: T[]) => T; // valid, parameter covariance works even after contextual signature instantiation >a10 : (...x: T[]) => T ->T : T ->Derived : Derived >x : T[] ->T : T ->T : T } interface I4C extends A { ->I4C : I4C ->A : A - a11: (x: T, y: T) => T; // valid, even though x is a Base, parameter covariance works even after contextual signature instantiation >a11 : (x: T, y: T) => T ->T : T ->Derived : Derived >x : T ->T : T >y : T ->T : T ->T : T } interface I4E extends A { ->I4E : I4E ->A : A - a12: >(x: Array, y: Array) => T; // valid, no inferences for T, defaults to Array >a12 : (x: Base[], y: Base[]) => T ->T : T ->Array : T[] ->Derived2 : Derived2 >x : Base[] ->Array : T[] ->Base : Base >y : Base[] ->Array : T[] ->Base : Base ->T : T } interface I6 extends A { ->I6 : I6 ->A : A - a15: (x: { a: T; b: T }) => T; // error, T is {} which isn't an acceptable return type >a15 : (x: { a: T; b: T; }) => T ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T } interface I7 extends A { ->I7 : I7 ->A : A - a15: (x: { a: T; b: T }) => number; // error, T defaults to Base, which is not compatible with number or string >a15 : (x: { a: T; b: T; }) => number ->T : T ->Base : Base >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T } interface I8 extends A { ->I8 : I8 ->A : A - // ok, we relate each signature of a16 to b16, and within that, we make inferences from two different signatures in the respective A.a16 signature a16: (x: (a: T) => T) => T[]; >a16 : (x: (a: T) => T) => T[] ->T : T >x : (a: T) => T >a : T ->T : T ->T : T ->T : T } interface I9 extends A { ->I9 : I9 ->A : A - a17: (x: (a: T) => T) => any[]; // valid, target is more constrained than source, so it is safe in the traditional constraint-contravariant fashion >a17 : (x: (a: T) => T) => any[] ->T : T >x : (a: T) => T >a : T ->T : T ->T : T } } module WithGenericSignaturesInBaseType { ->WithGenericSignaturesInBaseType : any - // base type has generic call signature interface B { ->B : B - a2: (x: T) => T[]; >a2 : (x: T) => T[] ->T : T >x : T ->T : T ->T : T } interface I6 extends B { ->I6 : I6 ->B : B - a2: (x: T) => string[]; // error >a2 : (x: T) => string[] ->T : T >x : T ->T : T } // base type has generic call signature interface C { ->C : C - a2: (x: T) => string[]; >a2 : (x: T) => string[] ->T : T >x : T ->T : T } interface I7 extends C { ->I7 : I7 ->C : C - a2: (x: T) => T[]; // error >a2 : (x: T) => T[] ->T : T >x : T ->T : T ->T : T } } } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.types b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.types index 0575d1332ce..1638c45d3b6 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.types +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.types @@ -21,111 +21,64 @@ class OtherDerived extends Base { bing: string; } >bing : string interface A { // T ->A : A - // M's a: (x: T) => T[]; >a : (x: T) => T[] ->T : T >x : T ->T : T ->T : T a2: (x: T) => string[]; >a2 : (x: T) => string[] ->T : T >x : T ->T : T a3: (x: T) => void; >a3 : (x: T) => void ->T : T >x : T ->T : T a4: (x: T, y: U) => string; >a4 : (x: T, y: U) => string ->T : T ->U : U >x : T ->T : T >y : U ->U : U a5: (x: (arg: T) => U) => T; >a5 : (x: (arg: T) => U) => T ->T : T ->U : U >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T a6: (x: (arg: T) => Derived) => T; >a6 : (x: (arg: T) => Derived) => T ->T : T ->Base : Base >x : (arg: T) => Derived >arg : T ->T : T ->Derived : Derived ->T : T a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; >a11 : (x: { foo: T; }, y: { foo: T; bar: T; }) => Base ->T : T >x : { foo: T; } >foo : T ->T : T >y : { foo: T; bar: T; } >foo : T ->T : T >bar : T ->T : T ->Base : Base a15: (x: { a: T; b: T }) => T[]; >a15 : (x: { a: T; b: T; }) => T[] ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T a16: (x: { a: T; b: T }) => T[]; >a16 : (x: { a: T; b: T; }) => T[] ->T : T ->Base : Base >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T a17: { >a17 : { (x: (a: T) => T): T[]; (x: (a: T) => T): T[]; } (x: (a: T) => T): T[]; ->T : T ->Derived : Derived >x : (a: T) => T >a : T ->T : T ->T : T ->T : T (x: (a: T) => T): T[]; ->T : T ->Base : Base >x : (a: T) => T >a : T ->T : T ->T : T ->T : T }; a18: { @@ -135,36 +88,20 @@ interface A { // T >x : { (a: T): T; (a: T): T; } (a: T): T; ->T : T ->Derived : Derived >a : T ->T : T ->T : T (a: T): T; ->T : T ->Base : Base >a : T ->T : T ->T : T }): any[]; (x: { >x : { (a: T): T; (a: T): T; } (a: T): T; ->T : T ->Derived2 : Derived2 >a : T ->T : T ->T : T (a: T): T; ->T : T ->Base : Base >a : T ->T : T ->T : T }): any[]; }; @@ -172,110 +109,61 @@ interface A { // T // S's interface I extends A { ->I : I ->A : A - // N's a: (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number >a : (x: T) => T[] ->T : T >x : T ->T : T ->T : T a2: (x: T) => string[]; // ok >a2 : (x: T) => string[] ->T : T >x : T ->T : T a3: (x: T) => T; // ok since Base returns void >a3 : (x: T) => T ->T : T >x : T ->T : T ->T : T a4: (x: T, y: U) => string; // ok, instantiation of N is a subtype of M, T is string, U is number >a4 : (x: T, y: U) => string ->T : T ->U : U >x : T ->T : T >y : U ->U : U a5: (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made >a5 : (x: (arg: T) => U) => T ->T : T ->U : U >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T a6: (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy >a6 : (x: (arg: T) => U) => T ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T a11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; // ok >a11 : (x: { foo: T; }, y: { foo: U; bar: U; }) => Base ->T : T ->U : U >x : { foo: T; } >foo : T ->T : T >y : { foo: U; bar: U; } >foo : U ->U : U >bar : U ->U : U ->Base : Base a15: (x: { a: U; b: V; }) => U[]; // ok, T = U, T = V >a15 : (x: { a: U; b: V; }) => U[] ->U : U ->V : V >x : { a: U; b: V; } >a : U ->U : U >b : V ->V : V ->U : U a16: (x: { a: T; b: T }) => T[]; // ok, more general parameter type >a16 : (x: { a: T; b: T; }) => T[] ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T a17: (x: (a: T) => T) => T[]; // ok >a17 : (x: (a: T) => T) => T[] ->T : T >x : (a: T) => T >a : T ->T : T ->T : T ->T : T a18: (x: (a: T) => T) => any[]; // ok >a18 : (x: (a: T) => T) => any[] >x : (a: T) => T ->T : T >a : T ->T : T ->T : T } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.types b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.types index 0ffc8257a56..2d133bc6d65 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.types +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.types @@ -22,8 +22,6 @@ class OtherDerived extends Base { bing: string; } >bing : string interface A { // T ->A : A - // M's a: (x: number) => number[]; >a : (x: number) => number[] @@ -51,53 +49,32 @@ interface A { // T >a6 : (x: (arg: Base) => Derived) => Base >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived ->Base : Base a7: (x: (arg: Base) => Derived) => (r: Base) => Derived; >a7 : (x: (arg: Base) => Derived) => (r: Base) => Derived >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived : Derived a8: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; >a8 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >y : (arg2: Base) => Derived >arg2 : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived : Derived a9: (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived; >a9 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived >x : (arg: Base) => Derived >arg : Base ->Base : Base ->Derived : Derived >y : (arg2: Base) => Derived >arg2 : Base ->Base : Base ->Derived : Derived >r : Base ->Base : Base ->Derived : Derived a10: (...x: Derived[]) => Derived; >a10 : (...x: Derived[]) => Derived >x : Derived[] ->Derived : Derived ->Derived : Derived a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base; >a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base @@ -106,209 +83,106 @@ interface A { // T >y : { foo: string; bar: string; } >foo : string >bar : string ->Base : Base a12: (x: Array, y: Array) => Array; >a12 : (x: Base[], y: Derived2[]) => Derived[] >x : Base[] ->Array : T[] ->Base : Base >y : Derived2[] ->Array : T[] ->Derived2 : Derived2 ->Array : T[] ->Derived : Derived a13: (x: Array, y: Array) => Array; >a13 : (x: Base[], y: Derived[]) => Derived[] >x : Base[] ->Array : T[] ->Base : Base >y : Derived[] ->Array : T[] ->Derived : Derived ->Array : T[] ->Derived : Derived a14: (x: { a: string; b: number }) => Object; >a14 : (x: { a: string; b: number; }) => Object >x : { a: string; b: number; } >a : string >b : number ->Object : Object } interface B extends A { ->B : B ->A : A - a: (x: T) => T[]; >a : (x: T) => T[] ->T : T >x : T ->T : T ->T : T } // S's interface I extends B { ->I : I ->B : B - // N's a: (x: T) => T[]; // ok, instantiation of N is a subtype of M, T is number >a : (x: T) => T[] ->T : T >x : T ->T : T ->T : T a2: (x: T) => string[]; // ok >a2 : (x: T) => string[] ->T : T >x : T ->T : T a3: (x: T) => T; // ok since Base returns void >a3 : (x: T) => T ->T : T >x : T ->T : T ->T : T a4: (x: T, y: U) => T; // ok, instantiation of N is a subtype of M, T is string, U is number >a4 : (x: T, y: U) => T ->T : T ->U : U >x : T ->T : T >y : U ->U : U ->T : T a5: (x: (arg: T) => U) => T; // ok, U is in a parameter position so inferences can be made >a5 : (x: (arg: T) => U) => T ->T : T ->U : U >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T a6: (x: (arg: T) => U) => T; // ok, same as a5 but with object type hierarchy >a6 : (x: (arg: T) => U) => T ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T a7: (x: (arg: T) => U) => (r: T) => U; // ok >a7 : (x: (arg: T) => U) => (r: T) => U ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U >r : T ->T : T ->U : U a8: (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U; // ok >a8 : (x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U >y : (arg2: T) => U >arg2 : T ->T : T ->U : U >r : T ->T : T ->U : U a9: (x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal >a9 : (x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U ->T : T ->Base : Base ->U : U ->Derived : Derived >x : (arg: T) => U >arg : T ->T : T ->U : U >y : (arg2: { foo: string; bing: number; }) => U >arg2 : { foo: string; bing: number; } >foo : string >bing : number ->U : U >r : T ->T : T ->U : U a10: (...x: T[]) => T; // ok >a10 : (...x: T[]) => T ->T : T ->Derived : Derived >x : T[] ->T : T ->T : T a11: (x: T, y: T) => T; // ok >a11 : (x: T, y: T) => T ->T : T ->Base : Base >x : T ->T : T >y : T ->T : T ->T : T a12: >(x: Array, y: T) => Array; // ok, less specific parameter type >a12 : (x: Base[], y: T) => Derived[] ->T : T ->Array : T[] ->Base : Base >x : Base[] ->Array : T[] ->Base : Base >y : T ->T : T ->Array : T[] ->Derived : Derived a13: >(x: Array, y: T) => T; // ok, T = Array, satisfies constraint, contextual signature instantiation succeeds >a13 : (x: Base[], y: T) => T ->T : T ->Array : T[] ->Derived : Derived >x : Base[] ->Array : T[] ->Base : Base >y : T ->T : T ->T : T a14: (x: { a: T; b: T }) => T; // ok, best common type yields T = {} but that's satisfactory for this signature >a14 : (x: { a: T; b: T; }) => T ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.types b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.types index 721b691be70..8e893aba48a 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.types +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.types @@ -23,187 +23,102 @@ class OtherDerived extends Base { bing: string; } >bing : string interface A { // T ->A : A - // M's a: (x: T) => T[]; >a : (x: T) => T[] ->T : T >x : T ->T : T ->T : T a2: (x: T) => string[]; >a2 : (x: T) => string[] ->T : T >x : T ->T : T a3: (x: T) => void; >a3 : (x: T) => void ->T : T >x : T ->T : T a4: (x: T, y: U) => string; >a4 : (x: T, y: U) => string ->T : T ->U : U >x : T ->T : T >y : U ->U : U a5: (x: (arg: T) => U) => T; >a5 : (x: (arg: T) => U) => T ->T : T ->U : U >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T a6: (x: (arg: T) => Derived) => T; >a6 : (x: (arg: T) => Derived) => T ->T : T ->Base : Base >x : (arg: T) => Derived >arg : T ->T : T ->Derived : Derived ->T : T a11: (x: { foo: T }, y: { foo: T; bar: T }) => Base; >a11 : (x: { foo: T; }, y: { foo: T; bar: T; }) => Base ->T : T >x : { foo: T; } >foo : T ->T : T >y : { foo: T; bar: T; } >foo : T ->T : T >bar : T ->T : T ->Base : Base a15: (x: { a: T; b: T }) => T[]; >a15 : (x: { a: T; b: T; }) => T[] ->T : T >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T a16: (x: { a: T; b: T }) => T[]; >a16 : (x: { a: T; b: T; }) => T[] ->T : T ->Base : Base >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T } // S's interface I extends A { ->I : I ->T : T ->A : A - a: (x: T) => T[]; >a : (x: T) => T[] >x : T ->T : T ->T : T } interface I2 extends A { ->I2 : I2 ->T : T ->A : A - a2: (x: T) => string[]; >a2 : (x: T) => string[] >x : T ->T : T } interface I3 extends A { ->I3 : I3 ->T : T ->A : A - a3: (x: T) => T; >a3 : (x: T) => T >x : T ->T : T ->T : T } interface I4 extends A { ->I4 : I4 ->T : T ->A : A - a4: (x: T, y: U) => string; >a4 : (x: T, y: U) => string ->U : U >x : T ->T : T >y : U ->U : U } interface I5 extends A { ->I5 : I5 ->T : T ->A : A - a5: (x: (arg: T) => U) => T; >a5 : (x: (arg: T) => U) => T ->U : U >x : (arg: T) => U >arg : T ->T : T ->U : U ->T : T } interface I7 extends A { ->I7 : I7 ->T : T ->A : A - a11: (x: { foo: T }, y: { foo: U; bar: U }) => Base; >a11 : (x: { foo: T; }, y: { foo: U; bar: U; }) => Base ->U : U >x : { foo: T; } >foo : T ->T : T >y : { foo: U; bar: U; } >foo : U ->U : U >bar : U ->U : U ->Base : Base } interface I9 extends A { ->I9 : I9 ->T : T ->A : A - a16: (x: { a: T; b: T }) => T[]; >a16 : (x: { a: T; b: T; }) => T[] >x : { a: T; b: T; } >a : T ->T : T >b : T ->T : T ->T : T } diff --git a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.types b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.types index fa3ddead9e5..3b8031c436e 100644 --- a/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.types +++ b/tests/baselines/reference/callSignatureWithOptionalParameterAndInitializer.types @@ -60,7 +60,6 @@ class C { var c: C; >c : C ->C : C c.foo(); >c.foo() : void @@ -76,8 +75,6 @@ c.foo(1); >1 : 1 interface I { ->I : I - (x? = 1); >x : number >1 : 1 @@ -91,7 +88,6 @@ interface I { var i: I; >i : I ->I : I i(); >i() : any diff --git a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types index 9fe90ae83c3..927d50a1ee1 100644 --- a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types +++ b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types @@ -12,15 +12,12 @@ var r = foo(1); // void since there's a body >1 : 1 interface I { ->I : I - (); f(); >f : () => any } var i: I; >i : I ->I : I var r2 = i(); >r2 : any diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types index 3b2d8f25d38..67b20f4bcbe 100644 --- a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types @@ -44,9 +44,7 @@ var r3 = foo3(); function foo4(x: T) { >foo4 : (x: T) => T ->T : T >x : T ->T : T return x; >x : T @@ -132,8 +130,6 @@ var r8 = foo8(1); >1 : 1 interface I { ->I : I - foo: string; >foo : string } @@ -143,7 +139,6 @@ function foo9(x: number) { var i: I; >i : I ->I : I return i; >i : I @@ -166,7 +161,6 @@ function foo10(x: number) { var c: C; >c : C ->C : C return c; >c : C @@ -201,14 +195,10 @@ var r11 = foo11(); // merged declarations interface I2 { ->I2 : I2 - x: number; >x : number } interface I2 { ->I2 : I2 - y: number; >y : number } @@ -217,7 +207,6 @@ function foo12() { var i2: I2; >i2 : I2 ->I2 : I2 return i2; >i2 : I2 diff --git a/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.types b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.types index 7c20d48a235..da2b23747a5 100644 --- a/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.types +++ b/tests/baselines/reference/callSignaturesShouldBeResolvedBeforeSpecialization.types @@ -1,15 +1,10 @@ === tests/cases/compiler/callSignaturesShouldBeResolvedBeforeSpecialization.ts === interface I1 { ->I1 : I1 ->T : T - (value: T): void; >value : T ->T : T field1: I1; >field1 : I1 ->I1 : I1 } function foo() { @@ -17,7 +12,6 @@ function foo() { var test: I1; >test : I1 ->I1 : I1 test("expects boolean instead of string"); // should not error - "test" should not expect a boolean >test("expects boolean instead of string") : void diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.types b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.types index ff51a6fc60a..675c8fc6ac0 100644 --- a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.types +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType.types @@ -2,8 +2,6 @@ // Each pair of signatures in these types has a signature that should cause an error. // Overloads, generic or not, that differ only by return type are an error. interface I { ->I : I - (x): number; >x : any @@ -11,41 +9,26 @@ interface I { >x : any (x: T): number; ->T : T >x : T ->T : T (x: T): string; // error ->T : T >x : T ->T : T } interface I2 { ->I2 : I2 - (x: T): number; ->T : T >x : T ->T : T (x: T): string; // error ->T : T >x : T ->T : T } interface I3 { ->I3 : I3 ->T : T - (x: T): number; >x : T ->T : T (x: T): string; // error >x : T ->T : T } var a: { @@ -54,7 +37,6 @@ var a: { (x, y): Object; >x : any >y : any ->Object : Object (x, y): any; // error >x : any @@ -65,12 +47,8 @@ var a2: { >a2 : { (x: T): number; (x: T): string; } (x: T): number; ->T : T >x : T ->T : T (x: T): string; // error ->T : T >x : T ->T : T } diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.types b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.types index 18b23b2eb93..0ff597c7b0d 100644 --- a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.types +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.types @@ -3,23 +3,15 @@ // Here the multiple overloads come from multiple bases. interface I { ->I : I ->T : T - foo(x: number): T; >foo : (x: number) => T >x : number ->T : T } interface A extends I, I { } ->A : A ->I : I ->I : I var x: A; >x : A ->A : A // BUG 822524 var r = x.foo(1); // no error diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.types b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.types index 3b1f2c5ca1a..e7ba417d1cb 100644 --- a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.types +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType3.types @@ -3,31 +3,21 @@ // Here the multiple overloads come from multiple merged declarations. interface I { ->I : I - (x: string): string; >x : string } interface I { ->I : I - (x: string): number; >x : string } interface I2 { ->I2 : I2 ->T : T - (x: string): string; >x : string } interface I2 { ->I2 : I2 ->T : T - (x: string): number; >x : string } diff --git a/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.types b/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.types index 80f8e6445d5..78da366842b 100644 --- a/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.types +++ b/tests/baselines/reference/callSignaturesWithAccessibilityModifiersOnParameters.types @@ -28,11 +28,8 @@ var f3 = (x, private y) => { } var f4 = (public x: T, y: T) => { } >f4 : (x: T, y: T) => void >(public x: T, y: T) => { } : (x: T, y: T) => void ->T : T >x : T ->T : T >y : T ->T : T function foo2(private x: string, public y: number) { } >foo2 : (x: string, y: number) => void @@ -61,11 +58,8 @@ var f7 = (private x: string, public y: number) => { } var f8 = (private x: T, public y: T) => { } >f8 : (x: T, y: T) => void >(private x: T, public y: T) => { } : (x: T, y: T) => void ->T : T >x : T ->T : T >y : T ->T : T class C { >C : C @@ -82,16 +76,11 @@ class C { foo3(public x: T, private y: T) { } >foo3 : (x: T, y: T) => void ->T : T >x : T ->T : T >y : T ->T : T } interface I { ->I : I - (private x, public y); >x : any >y : any @@ -112,11 +101,8 @@ interface I { foo3(x: T, private y: T); >foo3 : (x: T, y: T) => any ->T : T >x : T ->T : T >y : T ->T : T } var a: { @@ -153,9 +139,6 @@ var b = { b: (public x: T, private y: T) => { } >b : (x: T, y: T) => void >(public x: T, private y: T) => { } : (x: T, y: T) => void ->T : T >x : T ->T : T >y : T ->T : T } diff --git a/tests/baselines/reference/callSignaturesWithDuplicateParameters.types b/tests/baselines/reference/callSignaturesWithDuplicateParameters.types index 926f1ca3313..d70e7a399e1 100644 --- a/tests/baselines/reference/callSignaturesWithDuplicateParameters.types +++ b/tests/baselines/reference/callSignaturesWithDuplicateParameters.types @@ -28,11 +28,8 @@ var f3 = (x, x) => { } var f4 = (x: T, x: T) => { } >f4 : (x: T, x: T) => void >(x: T, x: T) => { } : (x: T, x: T) => void ->T : T >x : T ->T : T >x : T ->T : T function foo2(x: string, x: number) { } >foo2 : (x: string, x: number) => void @@ -61,11 +58,8 @@ var f7 = (x: string, x: number) => { } var f8 = (x: T, y: T) => { } >f8 : (x: T, y: T) => void >(x: T, y: T) => { } : (x: T, y: T) => void ->T : T >x : T ->T : T >y : T ->T : T class C { >C : C @@ -82,16 +76,11 @@ class C { foo3(x: T, x: T) { } >foo3 : (x: T, x: T) => void ->T : T >x : T ->T : T >x : T ->T : T } interface I { ->I : I - (x, x); >x : any >x : any @@ -112,11 +101,8 @@ interface I { foo3(x: T, x: T); >foo3 : (x: T, x: T) => any ->T : T >x : T ->T : T >x : T ->T : T } var a: { @@ -153,9 +139,6 @@ var b = { b: (x: T, x: T) => { } >b : (x: T, x: T) => void >(x: T, x: T) => { } : (x: T, x: T) => void ->T : T >x : T ->T : T >x : T ->T : T } diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters.types b/tests/baselines/reference/callSignaturesWithOptionalParameters.types index e01eed3835a..8333172bdc5 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters.types +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters.types @@ -56,7 +56,6 @@ class C { var c: C; >c : C ->C : C c.foo(); >c.foo() : void @@ -72,8 +71,6 @@ c.foo(1); >1 : 1 interface I { ->I : I - (x?: number); >x : number @@ -85,7 +82,6 @@ interface I { var i: I; >i : I ->I : I i(); >i() : any diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters2.types b/tests/baselines/reference/callSignaturesWithOptionalParameters2.types index c800a62d096..f273147abfb 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters2.types +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters2.types @@ -71,7 +71,6 @@ class C { var c: C; >c : C ->C : C c.foo(); >c.foo() : any @@ -102,8 +101,6 @@ c.foo2(1, 2); >2 : 2 interface I { ->I : I - (x?: number); >x : number @@ -125,7 +122,6 @@ interface I { var i: I; >i : I ->I : I i(); >i() : any diff --git a/tests/baselines/reference/callSignaturesWithParameterInitializers.types b/tests/baselines/reference/callSignaturesWithParameterInitializers.types index 41e28dedaab..f105b95f47c 100644 --- a/tests/baselines/reference/callSignaturesWithParameterInitializers.types +++ b/tests/baselines/reference/callSignaturesWithParameterInitializers.types @@ -60,7 +60,6 @@ class C { var c: C; >c : C ->C : C c.foo(); >c.foo() : void @@ -77,8 +76,6 @@ c.foo(1); // these are errors interface I { ->I : I - (x = 1); >x : number >1 : 1 @@ -92,7 +89,6 @@ interface I { var i: I; >i : I ->I : I i(); >i() : any diff --git a/tests/baselines/reference/callSignaturesWithParameterInitializers2.types b/tests/baselines/reference/callSignaturesWithParameterInitializers2.types index b83c202eff6..f339e01c003 100644 --- a/tests/baselines/reference/callSignaturesWithParameterInitializers2.types +++ b/tests/baselines/reference/callSignaturesWithParameterInitializers2.types @@ -37,7 +37,6 @@ class C { var c: C; >c : C ->C : C c.foo(); >c.foo() : any diff --git a/tests/baselines/reference/callWithSpread.types b/tests/baselines/reference/callWithSpread.types index 5af9d2fef84..016b03a6682 100644 --- a/tests/baselines/reference/callWithSpread.types +++ b/tests/baselines/reference/callWithSpread.types @@ -1,13 +1,10 @@ === tests/cases/conformance/expressions/functionCalls/callWithSpread.ts === interface X { ->X : X - foo(x: number, y: number, ...z: string[]): X; >foo : (x: number, y: number, ...z: string[]) => X >x : number >y : number >z : string[] ->X : X } function foo(x: number, y: number, ...z: string[]) { @@ -25,11 +22,9 @@ var z: number[]; var obj: X; >obj : X ->X : X var xa: X[]; >xa : X[] ->X : X foo(1, 2, "abc"); >foo(1, 2, "abc") : void @@ -266,7 +261,6 @@ xa[1].foo(1, 2, ...a, "abc"); >(xa[1].foo)(...[1, 2, "abc"]) : any >(xa[1].foo) : Function >xa[1].foo : Function ->Function : Function >xa[1].foo : (x: number, y: number, ...z: string[]) => X >xa[1] : X >xa : X[] diff --git a/tests/baselines/reference/callWithSpreadES6.types b/tests/baselines/reference/callWithSpreadES6.types index 4ce4bb2a75c..93ad15809bb 100644 --- a/tests/baselines/reference/callWithSpreadES6.types +++ b/tests/baselines/reference/callWithSpreadES6.types @@ -1,7 +1,5 @@ === tests/cases/conformance/expressions/functionCalls/callWithSpreadES6.ts === interface X { ->X : X - foo(x: number, y: number, ...z: string[]); >foo : (x: number, y: number, ...z: string[]) => any >x : number @@ -24,11 +22,9 @@ var z: number[]; var obj: X; >obj : X ->X : X var xa: X[]; >xa : X[] ->X : X foo(1, 2, "abc"); >foo(1, 2, "abc") : void @@ -157,7 +153,6 @@ xa[1].foo(1, 2, ...a, "abc"); >(xa[1].foo)(...[1, 2, "abc"]) : any >(xa[1].foo) : Function >xa[1].foo : Function ->Function : Function >xa[1].foo : (x: number, y: number, ...z: string[]) => any >xa[1] : X >xa : X[] diff --git a/tests/baselines/reference/callWithWrongNumberOfTypeArguments.types b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.types index 0056a0d3e9a..29d4ea5ec4b 100644 --- a/tests/baselines/reference/callWithWrongNumberOfTypeArguments.types +++ b/tests/baselines/reference/callWithWrongNumberOfTypeArguments.types @@ -1,8 +1,6 @@ === tests/cases/compiler/callWithWrongNumberOfTypeArguments.ts === function f() { } >f : () => void ->T : T ->U : U f(); >f() : any diff --git a/tests/baselines/reference/callbacksDontShareTypes.types b/tests/baselines/reference/callbacksDontShareTypes.types index 39ff5d8e306..55422c4df7c 100644 --- a/tests/baselines/reference/callbacksDontShareTypes.types +++ b/tests/baselines/reference/callbacksDontShareTypes.types @@ -1,57 +1,35 @@ === tests/cases/compiler/callbacksDontShareTypes.ts === interface Collection { ->Collection : Collection ->T : T - length: number; >length : number add(x: T): void; >add : (x: T) => void >x : T ->T : T remove(x: T): boolean; >remove : (x: T) => boolean >x : T ->T : T } interface Combinators { ->Combinators : Combinators - map(c: Collection, f: (x: T) => U): Collection; >map : { (c: Collection, f: (x: T) => U): Collection; (c: Collection, f: (x: T) => any): Collection; } ->T : T ->U : U >c : Collection ->Collection : Collection ->T : T >f : (x: T) => U >x : T ->T : T ->U : U ->Collection : Collection ->U : U map(c: Collection, f: (x: T) => any): Collection; >map : { (c: Collection, f: (x: T) => U): Collection; (c: Collection, f: (x: T) => any): Collection; } ->T : T >c : Collection ->Collection : Collection ->T : T >f : (x: T) => any >x : T ->T : T ->Collection : Collection } var _: Combinators; >_ : Combinators ->Combinators : Combinators var c2: Collection; >c2 : Collection ->Collection : Collection var rf1 = (x: number) => { return x.toFixed() }; >rf1 : (x: number) => string diff --git a/tests/baselines/reference/caseInsensitiveFileSystemWithCapsImportTypeDeclarations.types b/tests/baselines/reference/caseInsensitiveFileSystemWithCapsImportTypeDeclarations.types index 59401c34ae7..7cfcfee8fca 100644 --- a/tests/baselines/reference/caseInsensitiveFileSystemWithCapsImportTypeDeclarations.types +++ b/tests/baselines/reference/caseInsensitiveFileSystemWithCapsImportTypeDeclarations.types @@ -11,7 +11,6 @@ export class Broken { return { } as TypeB; >{ } as TypeB : import("tests/cases/compiler/Uppercased_Dir/src/types").Merge >{ } : {} ->TypeB : import("tests/cases/compiler/Uppercased_Dir/src/types").Merge } } === tests/cases/compiler/Uppercased_Dir/src/type-b.ts === @@ -23,8 +22,6 @@ import { TypeA } from './type-a'; export type TypeB = MergeTypeB : Merge ->Merge : Merge ->TypeA : TypeA b: string; >b : string @@ -40,8 +37,4 @@ export type TypeA = { === tests/cases/compiler/Uppercased_Dir/src/types.ts === export type Merge = T & U; >Merge : Merge ->T : T ->U : U ->T : T ->U : U diff --git a/tests/baselines/reference/castExpressionParentheses.types b/tests/baselines/reference/castExpressionParentheses.types index 5971b55f103..5f6e5b2122b 100644 --- a/tests/baselines/reference/castExpressionParentheses.types +++ b/tests/baselines/reference/castExpressionParentheses.types @@ -205,7 +205,6 @@ new (A()); >(()=> {})() : void >(()=> {}) : () => void >()=> {} : () => void ->Tany : Tany (function foo() { })(); >(function foo() { })() : any diff --git a/tests/baselines/reference/castNewObjectBug.types b/tests/baselines/reference/castNewObjectBug.types index b98b1576061..bbafb8ff9c4 100644 --- a/tests/baselines/reference/castNewObjectBug.types +++ b/tests/baselines/reference/castNewObjectBug.types @@ -1,11 +1,8 @@ === tests/cases/compiler/castNewObjectBug.ts === interface Foo { } ->Foo : Foo - var xx = new Object(); >xx : Foo > new Object() : Foo ->Foo : Foo >new Object() : Object >Object : ObjectConstructor diff --git a/tests/baselines/reference/castTest.types b/tests/baselines/reference/castTest.types index 4032aa8ac24..0013605a383 100644 --- a/tests/baselines/reference/castTest.types +++ b/tests/baselines/reference/castTest.types @@ -53,13 +53,10 @@ declare class Point >add : (dx: number, dy: number) => Point >dx : number >dy : number ->Point : Point mult(p: Point): Point; >mult : (p: Point) => Point >p : Point ->Point : Point ->Point : Point constructor(x: number, y: number); >x : number @@ -69,7 +66,6 @@ declare class Point var p_cast = ({ >p_cast : Point > ({ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; }}) : Point ->Point : Point >({ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; }}) : { x: number; y: number; add: (dx: number, dy: number) => Point; mult: (p: Point) => Point; } >{ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; }} : { x: number; y: number; add: (dx: number, dy: number) => Point; mult: (p: Point) => Point; } diff --git a/tests/baselines/reference/castingTuple.types b/tests/baselines/reference/castingTuple.types index 0b9aa0a1487..5280ca4962b 100644 --- a/tests/baselines/reference/castingTuple.types +++ b/tests/baselines/reference/castingTuple.types @@ -1,7 +1,5 @@ === tests/cases/conformance/types/tuple/castingTuple.ts === interface I { } ->I : I - class A { a = 10; } >A : A >a : number @@ -9,12 +7,10 @@ class A { a = 10; } class C implements I { c }; >C : C ->I : I >c : any class D implements I { d }; >D : D ->I : I >d : any class E extends A { e }; @@ -64,8 +60,6 @@ var longer = numStrTuple as [number, string, boolean] var classCDTuple: [C, D] = [new C(), new D()]; >classCDTuple : [C, D] ->C : C ->D : D >[new C(), new D()] : [C, D] >new C() : C >C : typeof C @@ -75,16 +69,11 @@ var classCDTuple: [C, D] = [new C(), new D()]; var interfaceIITuple = <[I, I]>classCDTuple; >interfaceIITuple : [I, I] ><[I, I]>classCDTuple : [I, I] ->I : I ->I : I >classCDTuple : [C, D] var classCDATuple = <[C, D, A]>classCDTuple; >classCDATuple : [C, D, A] ><[C, D, A]>classCDTuple : [C, D, A] ->C : C ->D : D ->A : A >classCDTuple : [C, D] var eleFromCDA1 = classCDATuple[2]; // A @@ -101,8 +90,6 @@ var eleFromCDA2 = classCDATuple[5]; // C | D | A var t10: [E1, E2] = [E1.one, E2.one]; >t10 : [E1, E2] ->E1 : E1 ->E2 : E2 >[E1.one, E2.one] : [E1, E2] >E1.one : E1 >E1 : typeof E1 @@ -123,7 +110,6 @@ var array1 = <{}[]>emptyObjTuple; var unionTuple: [C, string | number] = [new C(), "foo"]; >unionTuple : [C, string | number] ->C : C >[new C(), "foo"] : [C, string] >new C() : C >C : typeof C @@ -131,8 +117,6 @@ var unionTuple: [C, string | number] = [new C(), "foo"]; var unionTuple2: [C, string | number, D] = [new C(), "foo", new D()]; >unionTuple2 : [C, string | number, D] ->C : C ->D : D >[new C(), "foo", new D()] : [C, string, D] >new C() : C >C : typeof C @@ -160,8 +144,6 @@ var t3 = <[number, number]>numStrTuple; var t9 = <[A, I]>classCDTuple; >t9 : [A, I] ><[A, I]>classCDTuple : [A, I] ->A : A ->I : I >classCDTuple : [C, D] var array1 = numStrTuple; diff --git a/tests/baselines/reference/chainedAssignment2.types b/tests/baselines/reference/chainedAssignment2.types index c53c64143d9..1675f4ddfa1 100644 --- a/tests/baselines/reference/chainedAssignment2.types +++ b/tests/baselines/reference/chainedAssignment2.types @@ -10,11 +10,9 @@ var c: boolean; var d: Date; >d : Date ->Date : Date var e: RegExp; >e : RegExp ->RegExp : RegExp a = b = c = d = e = null; >a = b = c = d = e = null : null diff --git a/tests/baselines/reference/chainedAssignment3.types b/tests/baselines/reference/chainedAssignment3.types index 1e6c858ac0c..3bb2ded98fc 100644 --- a/tests/baselines/reference/chainedAssignment3.types +++ b/tests/baselines/reference/chainedAssignment3.types @@ -16,11 +16,9 @@ class B extends A { var a: A; >a : A ->A : A var b: B; >b : B ->B : B a = b = null; >a = b = null : null diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.types b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.types index 53ebb6e2150..3716b9b56f1 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.types +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.types @@ -1,23 +1,14 @@ === tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts === class Chain { >Chain : Chain ->T : T ->A : A constructor(public value: T) { } >value : T ->T : T then(cb: (x: T) => S): Chain { >then : (cb: (x: T) => S) => Chain ->S : S ->T : T >cb : (x: T) => S >x : T ->T : T ->S : S ->Chain : Chain ->S : S return null; >null : null diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.types b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.types index 5dc0ddb54c0..59627a5f620 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.types +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.types @@ -1,30 +1,20 @@ === tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter2.ts === class Chain { >Chain : Chain ->T : T constructor(public value: T) { } >value : T ->T : T then(cb: (x: T) => S): Chain { >then : (cb: (x: T) => S) => Chain ->S : S ->T : T >cb : (x: T) => S >x : T ->T : T ->S : S ->Chain : Chain ->S : S var t: T; >t : T ->T : T var s: S; >s : S ->S : S // Ok to go down the chain, but error to climb up the chain (new Chain(t)).then(tt => s).then(ss => t); @@ -114,42 +104,28 @@ class Chain { // Similar to above, but T is now constrained. Verify that the constraint is maintained across invocations interface I { ->I : I - x: number; >x : number } class Chain2 { >Chain2 : Chain2 ->T : T ->I : I constructor(public value: T) { } >value : T ->T : T then(cb: (x: T) => S): Chain2 { >then : (cb: (x: T) => S) => Chain2 ->S : S ->T : T >cb : (x: T) => S >x : T ->T : T ->S : S ->Chain2 : Chain2 ->S : S var i: I; >i : I ->I : I var t: T; >t : T ->T : T var s: S; >s : S ->S : S // Ok to go down the chain, check the constraint at the end. // Should get an error that we are assigning a string to a number diff --git a/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.types b/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.types index b76b19a724d..d1b81857925 100644 --- a/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.types +++ b/tests/baselines/reference/chainedSpecializationToObjectTypeLiteral.types @@ -1,49 +1,30 @@ === tests/cases/compiler/chainedSpecializationToObjectTypeLiteral.ts === interface Sequence { ->Sequence : Sequence ->T : T - each(iterator: (value: T) => void): void; >each : (iterator: (value: T) => void) => void >iterator : (value: T) => void >value : T ->T : T map(iterator: (value: T) => U): Sequence; >map : (iterator: (value: T) => U) => Sequence ->U : U >iterator : (value: T) => U >value : T ->T : T ->U : U ->Sequence : Sequence ->U : U filter(iterator: (value: T) => boolean): Sequence; >filter : (iterator: (value: T) => boolean) => Sequence >iterator : (value: T) => boolean >value : T ->T : T ->Sequence : Sequence ->T : T groupBy(keySelector: (value: T) => K): Sequence<{ key: K; items: T[]; }>; >groupBy : (keySelector: (value: T) => K) => Sequence<{ key: K; items: T[]; }> ->K : K >keySelector : (value: T) => K >value : T ->T : T ->K : K ->Sequence : Sequence >key : K ->K : K >items : T[] ->T : T } var s: Sequence; >s : Sequence ->Sequence : Sequence var s2 = s.groupBy(s => s.length); >s2 : Sequence<{ key: number; items: string[]; }> diff --git a/tests/baselines/reference/checkInfiniteExpansionTermination.types b/tests/baselines/reference/checkInfiniteExpansionTermination.types index bd4858126dd..07d3cb00487 100644 --- a/tests/baselines/reference/checkInfiniteExpansionTermination.types +++ b/tests/baselines/reference/checkInfiniteExpansionTermination.types @@ -3,39 +3,24 @@ // Before fix this code would cause infinite loop interface IObservable { ->IObservable : IObservable ->T : T - n: IObservable; // Needed, must be T[] >n : IObservable ->IObservable : IObservable ->T : T } // Needed interface ISubject extends IObservable { } ->ISubject : ISubject ->T : T ->IObservable : IObservable ->T : T interface Foo { x } ->Foo : Foo >x : any interface Bar { y } ->Bar : Bar >y : any var values: IObservable; >values : IObservable ->IObservable : IObservable ->Foo : Foo var values2: ISubject; >values2 : ISubject ->ISubject : ISubject ->Bar : Bar values = values2; >values = values2 : ISubject diff --git a/tests/baselines/reference/checkInfiniteExpansionTermination2.types b/tests/baselines/reference/checkInfiniteExpansionTermination2.types index fc81e1c9304..61f34101989 100644 --- a/tests/baselines/reference/checkInfiniteExpansionTermination2.types +++ b/tests/baselines/reference/checkInfiniteExpansionTermination2.types @@ -3,44 +3,29 @@ // Before fix this code would cause infinite loop interface IObservable { ->IObservable : IObservable ->T : T - n: IObservable; >n : IObservable ->IObservable : IObservable ->T : T } interface ISubject extends IObservable { } ->ISubject : ISubject ->T : T ->IObservable : IObservable ->T : T declare function combineLatest(x: IObservable[]): void; >combineLatest : { (x: IObservable[]): void; (): void; } ->TOther : TOther >x : IObservable[] ->IObservable : IObservable ->TOther : TOther declare function combineLatest(): void; >combineLatest : { (x: IObservable[]): void; (): void; } function fn() { >fn : () => void ->T : T var values: ISubject[] = []; >values : ISubject[] ->ISubject : ISubject >[] : undefined[] // Hang when using , but not combineLatest(values); >combineLatest(values) : void >combineLatest : { (x: IObservable[]): void; (): void; } ->T : T >values : ISubject[] } diff --git a/tests/baselines/reference/checkInterfaceBases.types b/tests/baselines/reference/checkInterfaceBases.types index 3e9107bbd6e..24a7bdf06c1 100644 --- a/tests/baselines/reference/checkInterfaceBases.types +++ b/tests/baselines/reference/checkInterfaceBases.types @@ -1,20 +1,13 @@ === tests/cases/compiler/app.ts === /// interface SecondEvent { ->SecondEvent : SecondEvent - data: any; >data : any } interface Third extends JQueryEventObjectTest, SecondEvent {} ->Third : Third ->JQueryEventObjectTest : JQueryEventObjectTest ->SecondEvent : SecondEvent === tests/cases/compiler/jquery.d.ts === interface JQueryEventObjectTest { ->JQueryEventObjectTest : JQueryEventObjectTest - data: any; >data : any diff --git a/tests/baselines/reference/checkJsdocTypeTag4.types b/tests/baselines/reference/checkJsdocTypeTag4.types index 04e3707a400..75db299718e 100644 --- a/tests/baselines/reference/checkJsdocTypeTag4.types +++ b/tests/baselines/reference/checkJsdocTypeTag4.types @@ -1,9 +1,7 @@ === tests/cases/conformance/jsdoc/t.d.ts === type A = { a: T } >A : A ->T : T >a : T ->T : T === tests/cases/conformance/jsdoc/test.js === /** Also should error for jsdoc typedefs diff --git a/tests/baselines/reference/checkJsxChildrenProperty1.types b/tests/baselines/reference/checkJsxChildrenProperty1.types index 821f95d9ae7..1a436091178 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty1.types +++ b/tests/baselines/reference/checkJsxChildrenProperty1.types @@ -3,8 +3,6 @@ import React = require('react'); >React : typeof React interface Prop { ->Prop : Prop - a: number, >a : number @@ -14,13 +12,11 @@ interface Prop { children: string | JSX.Element >children : string | JSX.Element >JSX : any ->Element : JSX.Element } function Comp(p: Prop) { >Comp : (p: Prop) => JSX.Element >p : Prop ->Prop : Prop return
{p.b}
; >
{p.b}
: JSX.Element diff --git a/tests/baselines/reference/checkJsxChildrenProperty10.types b/tests/baselines/reference/checkJsxChildrenProperty10.types index cee5995b851..785e690f637 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty10.types +++ b/tests/baselines/reference/checkJsxChildrenProperty10.types @@ -1,17 +1,10 @@ === tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : any - interface Element { } ->Element : Element - interface ElementAttributesProperty { props: {} } ->ElementAttributesProperty : ElementAttributesProperty >props : {} interface IntrinsicElements { ->IntrinsicElements : IntrinsicElements - div: any; >div : any diff --git a/tests/baselines/reference/checkJsxChildrenProperty11.types b/tests/baselines/reference/checkJsxChildrenProperty11.types index cee5995b851..785e690f637 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty11.types +++ b/tests/baselines/reference/checkJsxChildrenProperty11.types @@ -1,17 +1,10 @@ === tests/cases/conformance/jsx/file.tsx === declare module JSX { ->JSX : any - interface Element { } ->Element : Element - interface ElementAttributesProperty { props: {} } ->ElementAttributesProperty : ElementAttributesProperty >props : {} interface IntrinsicElements { ->IntrinsicElements : IntrinsicElements - div: any; >div : any diff --git a/tests/baselines/reference/checkJsxChildrenProperty12.types b/tests/baselines/reference/checkJsxChildrenProperty12.types index 93a7d0f9be1..9204e4985d2 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty12.types +++ b/tests/baselines/reference/checkJsxChildrenProperty12.types @@ -3,8 +3,6 @@ import React = require('react'); >React : typeof React interface ButtonProp { ->ButtonProp : ButtonProp - a: number, >a : number @@ -13,7 +11,6 @@ interface ButtonProp { children: Button; >children : Button ->Button : Button } class Button extends React.Component { @@ -21,7 +18,6 @@ class Button extends React.Component { >React.Component : React.Component >React : typeof React >Component : typeof React.Component ->ButtonProp : ButtonProp render() { >render : () => JSX.Element @@ -60,8 +56,6 @@ class Button extends React.Component { } interface InnerButtonProp { ->InnerButtonProp : InnerButtonProp - a: number >a : number } @@ -71,7 +65,6 @@ class InnerButton extends React.Component { >React.Component : React.Component >React : typeof React >Component : typeof React.Component ->InnerButtonProp : InnerButtonProp render() { >render : () => JSX.Element diff --git a/tests/baselines/reference/checkJsxChildrenProperty13.types b/tests/baselines/reference/checkJsxChildrenProperty13.types index 10d3876ae63..da159a74aa0 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty13.types +++ b/tests/baselines/reference/checkJsxChildrenProperty13.types @@ -3,8 +3,6 @@ import React = require('react'); >React : typeof React interface ButtonProp { ->ButtonProp : ButtonProp - a: number, >a : number @@ -13,7 +11,6 @@ interface ButtonProp { children: Button; >children : Button ->Button : Button } class Button extends React.Component { @@ -21,7 +18,6 @@ class Button extends React.Component { >React.Component : React.Component >React : typeof React >Component : typeof React.Component ->ButtonProp : ButtonProp render() { >render : () => JSX.Element @@ -47,8 +43,6 @@ class Button extends React.Component { } interface InnerButtonProp { ->InnerButtonProp : InnerButtonProp - a: number >a : number } @@ -58,7 +52,6 @@ class InnerButton extends React.Component { >React.Component : React.Component >React : typeof React >Component : typeof React.Component ->InnerButtonProp : InnerButtonProp render() { >render : () => JSX.Element diff --git a/tests/baselines/reference/checkJsxChildrenProperty14.types b/tests/baselines/reference/checkJsxChildrenProperty14.types index a0d9797934c..1910d47a304 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty14.types +++ b/tests/baselines/reference/checkJsxChildrenProperty14.types @@ -3,8 +3,6 @@ import React = require('react'); >React : typeof React interface Prop { ->Prop : Prop - a: number, >a : number @@ -14,9 +12,7 @@ interface Prop { children: JSX.Element | JSX.Element[]; >children : JSX.Element | JSX.Element[] >JSX : any ->Element : JSX.Element >JSX : any ->Element : JSX.Element } class Button extends React.Component { @@ -49,7 +45,6 @@ function AnotherButton(p: any) { function Comp(p: Prop) { >Comp : (p: Prop) => JSX.Element >p : Prop ->Prop : Prop return
{p.b}
; >
{p.b}
: JSX.Element @@ -104,8 +99,6 @@ let k3 = <>