Reuse input type nodes when serializing signature parameter and return types (#37444)

* Accept change

* Accept the huge set of ever so slightly changed baselines

* Update return type logic to only reuse nodes if original nodes share scope with current node, like property types, only reuse nodes if symbols referened are acessible, reuse nodes for property signatures, too

* Only reuse nodes when a context is provided (otherwise identifier printback may fail)

* Only track symbol if symbol is found and no error is recorded

* Fix type parameter reuse lookup

* Forbid cjs module.exports references in retained nodes

* Adjust check for cjs export references to not include bad module type in output

* Add symbol to all identifiers we see in existing nodes for quickinfo

* Accept fourslash baseline updates

* Accept slightly updated baseline post-merge

* Do not copy original nodes for error types, replace empty type references with any
This commit is contained in:
Wesley Wigham authored and GitHub committed 2020-04-01 19:50:21 -07:00
1 parent 5596ed80d7
commit 78a99241d8
636 files changed
+2621 -2467

No files matched your search

+212 -162
View File
@@ -4694,7 +4694,7 @@ namespace ts {
propertyTypeNode = createElidedInformationPlaceholder(context);
}
else {
propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : createKeywordTypeNode(SyntaxKind.AnyKeyword);
propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : createKeywordTypeNode(SyntaxKind.AnyKeyword);
}
context.flags = savedFlags;
@@ -4789,7 +4789,7 @@ namespace ts {
typeNode);
}
function signatureToSignatureDeclarationHelper(signature: Signature, kind: SyntaxKind, context: NodeBuilderContext): SignatureDeclaration {
function signatureToSignatureDeclarationHelper(signature: Signature, kind: SyntaxKind, context: NodeBuilderContext, privateSymbolVisitor?: (s: Symbol) => void, bundledImports?: boolean): SignatureDeclaration {
const suppressAny = context.flags & NodeBuilderFlags.SuppressAnyReturnType;
if (suppressAny) context.flags &= ~NodeBuilderFlags.SuppressAnyReturnType; // suppress only toplevel `any`s
let typeParameters: TypeParameterDeclaration[] | undefined;
@@ -4801,7 +4801,7 @@ namespace ts {
typeParameters = signature.typeParameters && signature.typeParameters.map(parameter => typeParameterToDeclaration(parameter, context));
}
const parameters = getExpandedParameters(signature).map(parameter => symbolToParameterDeclaration(parameter, context, kind === SyntaxKind.Constructor));
const parameters = getExpandedParameters(signature).map(parameter => symbolToParameterDeclaration(parameter, context, kind === SyntaxKind.Constructor, privateSymbolVisitor, bundledImports));
if (signature.thisParameter) {
const thisParameter = symbolToParameterDeclaration(signature.thisParameter, context);
parameters.unshift(thisParameter);
@@ -4822,7 +4822,7 @@ namespace ts {
else {
const returnType = getReturnTypeOfSignature(signature);
if (returnType && !(suppressAny && isTypeAny(returnType))) {
returnTypeNode = typeToTypeNodeHelper(returnType, context);
returnTypeNode = serializeReturnTypeForSignature(context, returnType, signature, privateSymbolVisitor, bundledImports);
}
else if (!suppressAny) {
returnTypeNode = createKeywordTypeNode(SyntaxKind.AnyKeyword);
@@ -4847,7 +4847,7 @@ namespace ts {
return typeParameterToDeclarationWithConstraint(type, context, constraintNode);
}
function symbolToParameterDeclaration(parameterSymbol: Symbol, context: NodeBuilderContext, preserveModifierFlags?: boolean): ParameterDeclaration {
function symbolToParameterDeclaration(parameterSymbol: Symbol, context: NodeBuilderContext, preserveModifierFlags?: boolean, privateSymbolVisitor?: (s: Symbol) => void, bundledImports?: boolean): ParameterDeclaration {
let parameterDeclaration: ParameterDeclaration | JSDocParameterTag | undefined = getDeclarationOfKind<ParameterDeclaration>(parameterSymbol, SyntaxKind.Parameter);
if (!parameterDeclaration && !isTransientSymbol(parameterSymbol)) {
parameterDeclaration = getDeclarationOfKind<JSDocParameterTag>(parameterSymbol, SyntaxKind.JSDocParameterTag);
@@ -4857,7 +4857,7 @@ namespace ts {
if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) {
parameterType = getOptionalType(parameterType);
}
const parameterTypeNode = typeToTypeNodeHelper(parameterType, context);
const parameterTypeNode = serializeTypeForDeclaration(context, parameterType, parameterSymbol, context.enclosingDeclaration, privateSymbolVisitor, bundledImports);
const modifiers = !(context.flags & NodeBuilderFlags.OmitParameterModifiers) && preserveModifierFlags && parameterDeclaration && parameterDeclaration.modifiers ? parameterDeclaration.modifiers.map(getSynthesizedClone) : undefined;
const isRest = parameterDeclaration && isRestParameter(parameterDeclaration) || getCheckFlags(parameterSymbol) & CheckFlags.RestParameter;
@@ -5192,8 +5192,15 @@ namespace ts {
}
}
function typeParameterShadowsNameInScope(escapedName: __String, context: NodeBuilderContext) {
return !!resolveName(context.enclosingDeclaration, escapedName, SymbolFlags.Type, /*nameNotFoundArg*/ undefined, escapedName, /*isUse*/ false);
function typeParameterShadowsNameInScope(escapedName: __String, context: NodeBuilderContext, type: TypeParameter) {
const result = resolveName(context.enclosingDeclaration, escapedName, SymbolFlags.Type, /*nameNotFoundArg*/ undefined, escapedName, /*isUse*/ false);
if (result) {
if (result.flags & SymbolFlags.TypeParameter && result === type.symbol) {
return false;
}
return true;
}
return false;
}
function typeParameterToName(type: TypeParameter, context: NodeBuilderContext) {
@@ -5211,7 +5218,7 @@ namespace ts {
const rawtext = result.escapedText as string;
let i = 0;
let text = rawtext;
while ((context.typeParameterNamesByText && context.typeParameterNamesByText.get(text)) || typeParameterShadowsNameInScope(text as __String, context)) {
while ((context.typeParameterNamesByText && context.typeParameterNamesByText.get(text)) || typeParameterShadowsNameInScope(text as __String, context, type)) {
i++;
text = `${rawtext}_${i}`;
}
@@ -5381,6 +5388,195 @@ namespace ts {
return initial;
}
function getDeclarationWithTypeAnnotation(symbol: Symbol, enclosingDeclaration: Node | undefined) {
return symbol.declarations && find(symbol.declarations, s => !!getEffectiveTypeAnnotationNode(s) && (!enclosingDeclaration || !!findAncestor(s, n => n === enclosingDeclaration)));
}
/**
* Unlike `typeToTypeNodeHelper`, this handles setting up the `AllowUniqueESSymbolType` flag
* so a `unique symbol` is returned when appropriate for the input symbol, rather than `typeof sym`
*/
function serializeTypeForDeclaration(context: NodeBuilderContext, type: Type, symbol: Symbol, enclosingDeclaration: Node | undefined, includePrivateSymbol?: (s: Symbol) => void, bundled?: boolean) {
if (type !== errorType && enclosingDeclaration) {
const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation)) {
// try to reuse the existing annotation
const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation)!;
if (getTypeFromTypeNode(existing) === type) {
const result = serializeExistingTypeNode(context, existing, includePrivateSymbol, bundled);
if (result) {
return result;
}
}
}
}
const oldFlags = context.flags;
if (type.flags & TypeFlags.UniqueESSymbol &&
type.symbol === symbol) {
context.flags |= NodeBuilderFlags.AllowUniqueESSymbolType;
}
const result = typeToTypeNodeHelper(type, context);
context.flags = oldFlags;
return result;
}
function serializeReturnTypeForSignature(context: NodeBuilderContext, type: Type, signature: Signature, includePrivateSymbol?: (s: Symbol) => void, bundled?: boolean) {
if (type !== errorType && context.enclosingDeclaration) {
const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
if (!!findAncestor(annotation, n => n === context.enclosingDeclaration) && annotation && getTypeFromTypeNode(annotation) === type) {
const result = serializeExistingTypeNode(context, annotation, includePrivateSymbol, bundled);
if (result) {
return result;
}
}
}
return typeToTypeNodeHelper(type, context);
}
function serializeExistingTypeNode(context: NodeBuilderContext, existing: TypeNode, includePrivateSymbol?: (s: Symbol) => void, bundled?: boolean) {
if (cancellationToken && cancellationToken.throwIfCancellationRequested) {
cancellationToken.throwIfCancellationRequested();
}
let hadError = false;
const transformed = visitNode(existing, visitExistingNodeTreeSymbols);
if (hadError) {
return undefined;
}
return transformed === existing ? getMutableClone(existing) : transformed;
function visitExistingNodeTreeSymbols<T extends Node>(node: T): Node {
// We don't _actually_ support jsdoc namepath types, emit `any` instead
if (isJSDocAllType(node) || node.kind === SyntaxKind.JSDocNamepathType) {
return createKeywordTypeNode(SyntaxKind.AnyKeyword);
}
if (isJSDocUnknownType(node)) {
return createKeywordTypeNode(SyntaxKind.UnknownKeyword);
}
if (isJSDocNullableType(node)) {
return createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols), createKeywordTypeNode(SyntaxKind.NullKeyword)]);
}
if (isJSDocOptionalType(node)) {
return createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols), createKeywordTypeNode(SyntaxKind.UndefinedKeyword)]);
}
if (isJSDocNonNullableType(node)) {
return visitNode(node.type, visitExistingNodeTreeSymbols);
}
if (isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "") {
return setOriginalNode(createKeywordTypeNode(SyntaxKind.AnyKeyword), node);
}
if ((isExpressionWithTypeArguments(node) || isTypeReferenceNode(node)) && isJSDocIndexSignature(node)) {
return createTypeLiteralNode([createIndexSignature(
/*decorators*/ undefined,
/*modifiers*/ undefined,
[createParameter(
/*decorators*/ undefined,
/*modifiers*/ undefined,
/*dotdotdotToken*/ undefined,
"x",
/*questionToken*/ undefined,
visitNode(node.typeArguments![0], visitExistingNodeTreeSymbols)
)],
visitNode(node.typeArguments![1], visitExistingNodeTreeSymbols)
)]);
}
if (isJSDocFunctionType(node)) {
if (isJSDocConstructSignature(node)) {
let newTypeNode: TypeNode | undefined;
return createConstructorTypeNode(
visitNodes(node.typeParameters, visitExistingNodeTreeSymbols),
mapDefined(node.parameters, (p, i) => p.name && isIdentifier(p.name) && p.name.escapedText === "new" ? (newTypeNode = p.type, undefined) : createParameter(
/*decorators*/ undefined,
/*modifiers*/ undefined,
p.dotDotDotToken,
p.name || p.dotDotDotToken ? `args` : `arg${i}`,
p.questionToken,
visitNode(p.type, visitExistingNodeTreeSymbols),
/*initializer*/ undefined
)),
visitNode(newTypeNode || node.type, visitExistingNodeTreeSymbols)
);
}
else {
return createFunctionTypeNode(
visitNodes(node.typeParameters, visitExistingNodeTreeSymbols),
map(node.parameters, (p, i) => createParameter(
/*decorators*/ undefined,
/*modifiers*/ undefined,
p.dotDotDotToken,
p.name || p.dotDotDotToken ? `args` : `arg${i}`,
p.questionToken,
visitNode(p.type, visitExistingNodeTreeSymbols),
/*initializer*/ undefined
)),
visitNode(node.type, visitExistingNodeTreeSymbols)
);
}
}
if (isLiteralImportTypeNode(node)) {
return updateImportTypeNode(
node,
updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
node.qualifier,
visitNodes(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
node.isTypeOf
);
}
if (isEntityName(node) || isEntityNameExpression(node)) {
const leftmost = getFirstIdentifier(node);
if (isInJSFile(node) && (isExportsIdentifier(leftmost) || isModuleExportsAccessExpression(leftmost.parent) || (isQualifiedName(leftmost.parent) && isModuleIdentifier(leftmost.parent.left) && isExportsIdentifier(leftmost.parent.right)))) {
hadError = true;
return node;
}
const sym = resolveEntityName(leftmost, SymbolFlags.All, /*ignoreErrors*/ true, /*dontResolveALias*/ true);
if (sym) {
if (isSymbolAccessible(sym, context.enclosingDeclaration, SymbolFlags.All, /*shouldComputeAliasesToMakeVisible*/ false).accessibility !== SymbolAccessibility.Accessible) {
hadError = true;
}
else {
context.tracker?.trackSymbol?.(sym, context.enclosingDeclaration, SymbolFlags.All);
includePrivateSymbol?.(sym);
}
if (isIdentifier(node)) {
const name = sym.flags & SymbolFlags.TypeParameter ? typeParameterToName(getDeclaredTypeOfSymbol(sym), context) : getMutableClone(node);
name.symbol = sym; // for quickinfo, which uses identifier symbol information
return setEmitFlags(setOriginalNode(name, node), EmitFlags.NoAsciiEscaping);
}
}
}
return visitEachChild(node, visitExistingNodeTreeSymbols, nullTransformationContext);
function rewriteModuleSpecifier(parent: ImportTypeNode, lit: StringLiteral) {
if (bundled) {
if (context.tracker && context.tracker.moduleResolverHost) {
const targetFile = getExternalModuleFileFromDeclaration(parent);
if (targetFile) {
const getCanonicalFileName = createGetCanonicalFileName(!!host.useCaseSensitiveFileNames);
const resolverHost = {
getCanonicalFileName,
getCurrentDirectory: () => context.tracker.moduleResolverHost!.getCurrentDirectory(),
getCommonSourceDirectory: () => context.tracker.moduleResolverHost!.getCommonSourceDirectory()
};
const newName = getResolvedExternalModuleName(resolverHost, targetFile);
return createLiteral(newName);
}
}
}
else {
if (context.tracker && context.tracker.trackExternalModuleSymbolOfImportTypeNode) {
const moduleSym = resolveExternalModuleNameWorker(lit, lit, /*moduleNotFoundError*/ undefined);
if (moduleSym) {
context.tracker.trackExternalModuleSymbolOfImportTypeNode(moduleSym);
}
}
}
return lit;
}
}
}
function symbolTableToDeclarationStatements(symbolTable: SymbolTable, context: NodeBuilderContext, bundled?: boolean): Statement[] {
const serializePropertySymbolForClass = makeSerializePropertySymbol<ClassElement>(createProperty, SyntaxKind.MethodDeclaration, /*useAcessors*/ true);
const serializePropertySymbolForInterfaceWorker = makeSerializePropertySymbol<TypeElement>((_decorators, mods, name, question, type, initializer) => createPropertySignature(mods, name, question, type, initializer), SyntaxKind.MethodSignature, /*useAcessors*/ false);
@@ -5859,7 +6055,7 @@ namespace ts {
textRange = textRange.parent.parent;
}
const statement = setTextRange(createVariableStatement(/*modifiers*/ undefined, createVariableDeclarationList([
createVariableDeclaration(name, serializeTypeForDeclaration(type, symbol))
createVariableDeclaration(name, serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled))
], flags)), textRange);
addResult(statement, name !== localName ? modifierFlags & ~ModifierFlags.Export : modifierFlags);
if (name !== localName && !isPrivate) {
@@ -5901,7 +6097,7 @@ namespace ts {
const signatures = getSignaturesOfType(type, SignatureKind.Call);
for (const sig of signatures) {
// Each overload becomes a separate function declaration, in order
const decl = signatureToSignatureDeclarationHelper(sig, SyntaxKind.FunctionDeclaration, context) as FunctionDeclaration;
const decl = signatureToSignatureDeclarationHelper(sig, SyntaxKind.FunctionDeclaration, context, includePrivateSymbol, bundled) as FunctionDeclaration;
decl.name = createIdentifier(localName);
addResult(setTextRange(decl, sig.declaration), modifierFlags);
}
@@ -6216,7 +6412,7 @@ namespace ts {
}
else {
const statement = createVariableStatement(/*modifiers*/ undefined, createVariableDeclarationList([
createVariableDeclaration(varName, serializeTypeForDeclaration(typeToSerialize, symbol))
createVariableDeclaration(varName, serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled))
], NodeFlags.Const));
addResult(statement, name === varName ? ModifierFlags.Export : ModifierFlags.None);
}
@@ -6244,7 +6440,7 @@ namespace ts {
!getIndexInfoOfType(typeToSerialize, IndexKind.Number) &&
!!(length(getPropertiesOfType(typeToSerialize)) || length(getSignaturesOfType(typeToSerialize, SignatureKind.Call))) &&
!length(getSignaturesOfType(typeToSerialize, SignatureKind.Construct)) && // TODO: could probably serialize as function + ns + class, now that that's OK
!getDeclarationWithTypeAnnotation(hostSymbol) &&
!getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) &&
!(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, d => getSourceFileOfNode(d) !== ctxSrc)) &&
!some(getPropertiesOfType(typeToSerialize), p => isLateBoundName(p.escapedName)) &&
!some(getPropertiesOfType(typeToSerialize), p => some(p.declarations, d => getSourceFileOfNode(d) !== ctxSrc)) &&
@@ -6305,7 +6501,7 @@ namespace ts {
/*dotDotDotToken*/ undefined,
"arg",
/*questionToken*/ undefined,
isPrivate ? undefined : serializeTypeForDeclaration(getTypeOfSymbol(p), p)
isPrivate ? undefined : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled)
)],
/*body*/ undefined
), find(p.declarations, isSetAccessor) || firstPropertyLikeDecl));
@@ -6317,7 +6513,7 @@ namespace ts {
createModifiersFromModifierFlags(flag),
name,
[],
isPrivate ? undefined : serializeTypeForDeclaration(getTypeOfSymbol(p), p),
isPrivate ? undefined : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled),
/*body*/ undefined
), find(p.declarations, isGetAccessor) || firstPropertyLikeDecl));
}
@@ -6331,7 +6527,7 @@ namespace ts {
createModifiersFromModifierFlags((isReadonlySymbol(p) ? ModifierFlags.Readonly : 0) | flag),
name,
p.flags & SymbolFlags.Optional ? createToken(SyntaxKind.QuestionToken) : undefined,
isPrivate ? undefined : serializeTypeForDeclaration(getTypeOfSymbol(p), p),
isPrivate ? undefined : serializeTypeForDeclaration(context, getTypeOfSymbol(p), p, enclosingDeclaration, includePrivateSymbol, bundled),
// TODO: https://github.com/microsoft/TypeScript/pull/32372#discussion_r328386357
// interface members can't have initializers, however class members _can_
/*initializer*/ undefined
@@ -6375,152 +6571,6 @@ namespace ts {
return serializePropertySymbolForInterfaceWorker(p, /*isStatic*/ false, baseType);
}
function getDeclarationWithTypeAnnotation(symbol: Symbol) {
return symbol.declarations && find(symbol.declarations, s => !!getEffectiveTypeAnnotationNode(s) && !!findAncestor(s, n => n === enclosingDeclaration));
}
/**
* Unlike `typeToTypeNodeHelper`, this handles setting up the `AllowUniqueESSymbolType` flag
* so a `unique symbol` is returned when appropriate for the input symbol, rather than `typeof sym`
*/
function serializeTypeForDeclaration(type: Type, symbol: Symbol) {
const declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol);
if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation)) {
// try to reuse the existing annotation
const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation)!;
const transformed = visitNode(existing, visitExistingNodeTreeSymbols);
return transformed === existing ? getMutableClone(existing) : transformed;
}
const oldFlags = context.flags;
if (type.flags & TypeFlags.UniqueESSymbol &&
type.symbol === symbol) {
context.flags |= NodeBuilderFlags.AllowUniqueESSymbolType;
}
const result = typeToTypeNodeHelper(type, context);
context.flags = oldFlags;
return result;
function visitExistingNodeTreeSymbols<T extends Node>(node: T): Node {
// We don't _actually_ support jsdoc namepath types, emit `any` instead
if (isJSDocAllType(node) || node.kind === SyntaxKind.JSDocNamepathType) {
return createKeywordTypeNode(SyntaxKind.AnyKeyword);
}
if (isJSDocUnknownType(node)) {
return createKeywordTypeNode(SyntaxKind.UnknownKeyword);
}
if (isJSDocNullableType(node)) {
return createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols), createKeywordTypeNode(SyntaxKind.NullKeyword)]);
}
if (isJSDocOptionalType(node)) {
return createUnionTypeNode([visitNode(node.type, visitExistingNodeTreeSymbols), createKeywordTypeNode(SyntaxKind.UndefinedKeyword)]);
}
if (isJSDocNonNullableType(node)) {
return visitNode(node.type, visitExistingNodeTreeSymbols);
}
if ((isExpressionWithTypeArguments(node) || isTypeReferenceNode(node)) && isJSDocIndexSignature(node)) {
return createTypeLiteralNode([createIndexSignature(
/*decorators*/ undefined,
/*modifiers*/ undefined,
[createParameter(
/*decorators*/ undefined,
/*modifiers*/ undefined,
/*dotdotdotToken*/ undefined,
"x",
/*questionToken*/ undefined,
visitNode(node.typeArguments![0], visitExistingNodeTreeSymbols)
)],
visitNode(node.typeArguments![1], visitExistingNodeTreeSymbols)
)]);
}
if (isJSDocFunctionType(node)) {
if (isJSDocConstructSignature(node)) {
let newTypeNode: TypeNode | undefined;
return createConstructorTypeNode(
visitNodes(node.typeParameters, visitExistingNodeTreeSymbols),
mapDefined(node.parameters, (p, i) => p.name && isIdentifier(p.name) && p.name.escapedText === "new" ? (newTypeNode = p.type, undefined) : createParameter(
/*decorators*/ undefined,
/*modifiers*/ undefined,
p.dotDotDotToken,
p.name || p.dotDotDotToken ? `args` : `arg${i}`,
p.questionToken,
visitNode(p.type, visitExistingNodeTreeSymbols),
/*initializer*/ undefined
)),
visitNode(newTypeNode || node.type, visitExistingNodeTreeSymbols)
);
}
else {
return createFunctionTypeNode(
visitNodes(node.typeParameters, visitExistingNodeTreeSymbols),
map(node.parameters, (p, i) => createParameter(
/*decorators*/ undefined,
/*modifiers*/ undefined,
p.dotDotDotToken,
p.name || p.dotDotDotToken ? `args` : `arg${i}`,
p.questionToken,
visitNode(p.type, visitExistingNodeTreeSymbols),
/*initializer*/ undefined
)),
visitNode(node.type, visitExistingNodeTreeSymbols)
);
}
}
if (isLiteralImportTypeNode(node)) {
return updateImportTypeNode(
node,
updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
node.qualifier,
visitNodes(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
node.isTypeOf
);
}
if (isEntityName(node) || isEntityNameExpression(node)) {
const leftmost = getFirstIdentifier(node);
const sym = resolveEntityName(leftmost, SymbolFlags.All, /*ignoreErrors*/ true, /*dontResolveALias*/ true);
if (sym) {
includePrivateSymbol(sym);
if (isIdentifier(node) && sym.flags & SymbolFlags.TypeParameter) {
const name = typeParameterToName(getDeclaredTypeOfSymbol(sym), context);
if (idText(name) !== idText(node)) {
return name;
}
return node;
}
}
}
return visitEachChild(node, visitExistingNodeTreeSymbols, nullTransformationContext);
}
function rewriteModuleSpecifier(parent: ImportTypeNode, lit: StringLiteral) {
if (bundled) {
if (context.tracker && context.tracker.moduleResolverHost) {
const targetFile = getExternalModuleFileFromDeclaration(parent);
if (targetFile) {
const getCanonicalFileName = createGetCanonicalFileName(!!host.useCaseSensitiveFileNames);
const resolverHost = {
getCanonicalFileName,
getCurrentDirectory: () => context.tracker.moduleResolverHost!.getCurrentDirectory(),
getCommonSourceDirectory: () => context.tracker.moduleResolverHost!.getCommonSourceDirectory()
};
const newName = getResolvedExternalModuleName(resolverHost, targetFile);
return createLiteral(newName);
}
}
}
else {
if (context.tracker && context.tracker.trackExternalModuleSymbolOfImportTypeNode) {
const moduleSym = resolveExternalModuleNameWorker(lit, lit, /*moduleNotFoundError*/ undefined);
if (moduleSym) {
context.tracker.trackExternalModuleSymbolOfImportTypeNode(moduleSym);
}
}
}
return lit;
}
}
function serializeSignatures(kind: SignatureKind, input: Type, baseType: Type | undefined, outputKind: SyntaxKind) {
const signatures = getSignaturesOfType(input, kind);
if (kind === SignatureKind.Construct) {
+5 -2
View File
@@ -2114,10 +2114,13 @@ namespace ts {
return isIdentifier(node) && node.escapedText === "exports";
}
export function isModuleIdentifier(node: Node) {
return isIdentifier(node) && node.escapedText === "module";
}
export function isModuleExportsAccessExpression(node: Node): node is LiteralLikeElementAccessExpression & { expression: Identifier } {
return (isPropertyAccessExpression(node) || isLiteralLikeElementAccess(node))
&& isIdentifier(node.expression)
&& node.expression.escapedText === "module"
&& isModuleIdentifier(node.expression)
&& getElementOrPropertyAccessName(node) === "exports";
}
@@ -1884,7 +1884,7 @@ interface Array<T> {
>n : number
}
declare var Array: {
>Array : { (arrayLength?: number): any[]; <T>(arrayLength: number): T[]; <T>(...items: T[]): T[]; new (arrayLength?: number): any[]; new <T>(arrayLength: number): T[]; new <T>(...items: T[]): T[]; isArray(arg: any): boolean; prototype: any[]; }
>Array : { (arrayLength?: number): any[]; <T>(arrayLength: number): T[]; <T>(...items: T[]): T[]; new (arrayLength?: number): any[]; new <T>(arrayLength: number): T[]; new <T>(...items: T[]): T[]; isArray(arg: any): boolean; prototype: Array<any>; }
new (arrayLength?: number): any[];
>arrayLength : number
@@ -11,7 +11,7 @@ module A {
}
export var UnitSquare : {
>UnitSquare : { top: { left: Point; right: Point; }; bottom: { left: Point; right: Point; }; }
>UnitSquare : { top: { left: Point; right: Point;}; bottom: { left: Point; right: Point;}; }
top: { left: Point, right: Point },
>top : { left: Point; right: Point; }
@@ -33,7 +33,7 @@ module A {
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
var fn: () => { x: number; y: number };
>fn : () => { x: number; y: number; }
>fn : () => { x: number; y: number;}
>x : number
>y : number
@@ -33,7 +33,7 @@ module B {
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
var fn: () => { x: number; y: number };
>fn : () => { x: number; y: number; }
>fn : () => { x: number; y: number;}
>x : number
>y : number
@@ -82,7 +82,7 @@ var p = Geometry.Origin;
>Origin : A.Point
var line: { start: { x: number; y: number }; end: { x: number; y: number; } };
>line : { start: { x: number; y: number; }; end: { x: number; y: number; }; }
>line : { start: { x: number; y: number;}; end: { x: number; y: number;}; }
>start : { x: number; y: number; }
>x : number
>y : number
@@ -6,7 +6,7 @@ enum Color { R, G, B }
>B : Color.B
function f1(x: Color | string) {
>f1 : (x: string | Color) => void
>f1 : (x: Color | string) => void
>x : string | Color
if (typeof x === "number") {
@@ -33,7 +33,7 @@ function f1(x: Color | string) {
}
function f2(x: Color | string | string[]) {
>f2 : (x: string | Color | string[]) => void
>f2 : (x: Color | string | string[]) => void
>x : string | Color | string[]
if (typeof x === "object") {
@@ -28,7 +28,7 @@ var b: { x: IHasVisualizationModel } = { x: moduleA };
>moduleA : typeof moduleA
var c: { y: { z: IHasVisualizationModel } } = { y: { z: moduleA } };
>c : { y: { z: IHasVisualizationModel; }; }
>c : { y: { z: IHasVisualizationModel;}; }
>y : { z: IHasVisualizationModel; }
>z : IHasVisualizationModel
>{ y: { z: moduleA } } : { y: { z: typeof moduleA; }; }
@@ -10,7 +10,7 @@ declare function fn(x: number): string;
>x : number
declare function fn(x: 'foo'): number;
>fn : { (x: number): string; (x: "foo"): number; }
>fn : { (x: number): string; (x: 'foo'): number; }
>x : "foo"
// Ambient functions with duplicate signatures
@@ -83,7 +83,7 @@ var r3 = foo3(a); // any
>a : any
declare function foo7(x: { bar: number }): { bar: number };
>foo7 : { (x: { bar: number; }): { bar: number; }; (x: any): any; }
>foo7 : { (x: { bar: number;}): { bar: number;}; (x: any): any; }
>x : { bar: number; }
>bar : number
>bar : number
@@ -45,7 +45,7 @@ var o = { x: ["string", 1], y: { c: true, d: "world", e: 3 } };
>3 : 3
var o1: { x: [string, number], y: { c: boolean, d: string, e: number } } = { x: ["string", 1], y: { c: true, d: "world", e: 3 } };
>o1 : { x: [string, number]; y: { c: boolean; d: string; e: number; }; }
>o1 : { x: [string, number]; y: { c: boolean; d: string; e: number;}; }
>x : [string, number]
>y : { c: boolean; d: string; e: number; }
>c : boolean
+1 -1
View File
@@ -5,7 +5,7 @@ type Fn<T extends object> = <U extends T>(subj: U) => U
>subj : U
function doStuff<T extends object, T1 extends T>(a: Array<Fn<T>>, b: Array<Fn<T1>>) {
>doStuff : <T extends object, T1 extends T>(a: Fn<T>[], b: Fn<T1>[]) => void
>doStuff : <T extends object, T1 extends T>(a: Array<Fn<T>>, b: Array<Fn<T1>>) => void
>a : Fn<T>[]
>b : Fn<T1>[]
+2 -2
View File
@@ -12,7 +12,7 @@ array.flatMap((): ReadonlyArray<number> => []); // ok
>array.flatMap : <U, This = undefined>(callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]
>array : number[]
>flatMap : <U, This = undefined>(callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]
>(): ReadonlyArray<number> => [] : () => readonly number[]
>(): ReadonlyArray<number> => [] : () => ReadonlyArray<number>
>[] : undefined[]
readonlyArray.flatMap((): ReadonlyArray<number> => []); // ok
@@ -20,6 +20,6 @@ readonlyArray.flatMap((): ReadonlyArray<number> => []); // ok
>readonlyArray.flatMap : <U, This = undefined>(callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]
>readonlyArray : readonly number[]
>flatMap : <U, This = undefined>(callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]
>(): ReadonlyArray<number> => [] : () => readonly number[]
>(): ReadonlyArray<number> => [] : () => ReadonlyArray<number>
>[] : undefined[]
@@ -56,28 +56,28 @@ var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[]
>1 : 1
var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2]; // (a: { x: number; y?: number }) => number[]
>fs : (((a: { x: number; y?: number; }) => number) | ((b: { x: number; z?: number; }) => number))[]
>[(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2] : (((a: { x: number; y?: number; }) => number) | ((b: { x: number; z?: number; }) => number))[]
>(a: { x: number; y?: number }) => 1 : (a: { x: number; y?: number; }) => number
>fs : (((a: { x: number; y?: number;}) => number) | ((b: { x: number; z?: number;}) => number))[]
>[(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2] : (((a: { x: number; y?: number;}) => number) | ((b: { x: number; z?: number;}) => number))[]
>(a: { x: number; y?: number }) => 1 : (a: { x: number; y?: number;}) => number
>a : { x: number; y?: number; }
>x : number
>y : number
>1 : 1
>(b: { x: number; z?: number }) => 2 : (b: { x: number; z?: number; }) => number
>(b: { x: number; z?: number }) => 2 : (b: { x: number; z?: number;}) => number
>b : { x: number; z?: number; }
>x : number
>z : number
>2 : 2
var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1]; // (b: { x: number; z?: number }) => number[]
>gs : (((b: { x: number; z?: number; }) => number) | ((a: { x: number; y?: number; }) => number))[]
>[(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1] : (((b: { x: number; z?: number; }) => number) | ((a: { x: number; y?: number; }) => number))[]
>(b: { x: number; z?: number }) => 2 : (b: { x: number; z?: number; }) => number
>gs : (((b: { x: number; z?: number;}) => number) | ((a: { x: number; y?: number;}) => number))[]
>[(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1] : (((b: { x: number; z?: number;}) => number) | ((a: { x: number; y?: number;}) => number))[]
>(b: { x: number; z?: number }) => 2 : (b: { x: number; z?: number;}) => number
>b : { x: number; z?: number; }
>x : number
>z : number
>2 : 2
>(a: { x: number; y?: number }) => 1 : (a: { x: number; y?: number; }) => number
>(a: { x: number; y?: number }) => 1 : (a: { x: number; y?: number;}) => number
>a : { x: number; y?: number; }
>x : number
>y : number
@@ -50,7 +50,7 @@ myArray = [[1, 2]];
>2 : 2
function isEmpty(l: { length: number }) {
>isEmpty : (l: { length: number; }) => boolean
>isEmpty : (l: { length: number;}) => boolean
>l : { length: number; }
>length : number
@@ -1,6 +1,6 @@
=== tests/cases/compiler/assignmentCompatBug5.ts ===
function foo1(x: { a: number; }) { }
>foo1 : (x: { a: number; }) => void
>foo1 : (x: { a: number;}) => void
>x : { a: number; }
>a : number
@@ -1,6 +1,6 @@
=== tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts ===
function foo(x: { id: number; name?: string; }): void;
>foo : (x: { id: number; name?: string; }) => void
>foo : (x: { id: number; name?: string;}) => void
>x : { id: number; name?: string; }
>id : number
>name : string
@@ -3,7 +3,7 @@ class Foo{};
>Foo : Foo
function bar(x: {new(): Foo;}){}
>bar : (x: new () => Foo) => void
>bar : (x: { new (): Foo;}) => void
>x : new () => Foo
bar(Foo); // Error, but should be allowed
@@ -74,7 +74,7 @@ var a10: (...x: Derived[]) => Derived;
>x : Derived[]
var a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>a11 : (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -82,17 +82,17 @@ var a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>bar : string
var a12: (x: Array<Base>, y: Array<Derived2>) => Array<Derived>;
>a12 : (x: Base[], y: Derived2[]) => Derived[]
>a12 : (x: Array<Base>, y: Array<Derived2>) => Array<Derived>
>x : Base[]
>y : Derived2[]
var a13: (x: Array<Base>, y: Array<Derived>) => Array<Derived>;
>a13 : (x: Base[], y: Derived[]) => Derived[]
>a13 : (x: Array<Base>, y: Array<Derived>) => Array<Derived>
>x : Base[]
>y : Derived[]
var a14: (x: { a: string; b: number }) => Object;
>a14 : (x: { a: string; b: number; }) => Object
>a14 : (x: { a: string; b: number;}) => Object
>x : { a: string; b: number; }
>a : string
>b : number
@@ -274,10 +274,10 @@ b8 = a8; // ok
>a8 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
var b9: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U;
>b9 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
>b9 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number;}) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: string; bing: number; }) => U
>y : (arg2: { foo: string; bing: number;}) => U
>arg2 : { foo: string; bing: number; }
>foo : string
>bing : number
@@ -323,7 +323,7 @@ b11 = a11; // ok
>a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
var b12: <T extends Array<Base>>(x: Array<Base>, y: T) => Array<Derived>;
>b12 : <T extends Base[]>(x: Base[], y: T) => Derived[]
>b12 : <T extends Base[]>(x: Array<Base>, y: T) => Array<Derived>
>x : Base[]
>y : T
@@ -338,7 +338,7 @@ b12 = a12; // ok
>a12 : (x: Base[], y: Derived2[]) => Derived[]
var b13: <T extends Array<Derived>>(x: Array<Base>, y: T) => T;
>b13 : <T extends Derived[]>(x: Base[], y: T) => T
>b13 : <T extends Derived[]>(x: Array<Base>, y: T) => T
>x : Base[]
>y : T
@@ -50,7 +50,7 @@ module Errors {
>x : Base[]
var a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>a11 : (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -58,7 +58,7 @@ module Errors {
>bar : string
var a12: (x: Array<Base>, y: Array<Derived2>) => Array<Derived>;
>a12 : (x: Base[], y: Derived2[]) => Derived[]
>a12 : (x: Array<Base>, y: Array<Derived2>) => Array<Derived>
>x : Base[]
>y : Derived2[]
@@ -73,7 +73,7 @@ module Errors {
};
var a15: (x: { a: string; b: number }) => number;
>a15 : (x: { a: string; b: number; }) => number
>a15 : (x: { a: string; b: number;}) => number
>x : { a: string; b: number; }
>a : string
>b : number
@@ -158,10 +158,10 @@ module Errors {
>a7 : (x: (arg: Base) => Derived) => (r: Base) => Derived2
var b8: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U;
>b8 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U
>b8 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number;}) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: number; }) => U
>y : (arg2: { foo: number;}) => U
>arg2 : { foo: number; }
>foo : number
>r : T
@@ -207,7 +207,7 @@ module Errors {
>a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
var b12: <T extends Array<Derived2>>(x: Array<Base>, y: Array<Base>) => T;
>b12 : <T extends Derived2[]>(x: Base[], y: Base[]) => T
>b12 : <T extends Derived2[]>(x: Array<Base>, y: Array<Base>) => T
>x : Base[]
>y : Base[]
@@ -74,7 +74,7 @@ var a10: new (...x: Derived[]) => Derived;
>x : Derived[]
var a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>a11 : new (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -82,17 +82,17 @@ var a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>bar : string
var a12: new (x: Array<Base>, y: Array<Derived2>) => Array<Derived>;
>a12 : new (x: Base[], y: Derived2[]) => Derived[]
>a12 : new (x: Array<Base>, y: Array<Derived2>) => Array<Derived>
>x : Base[]
>y : Derived2[]
var a13: new (x: Array<Base>, y: Array<Derived>) => Array<Derived>;
>a13 : new (x: Base[], y: Derived[]) => Derived[]
>a13 : new (x: Array<Base>, y: Array<Derived>) => Array<Derived>
>x : Base[]
>y : Derived[]
var a14: new (x: { a: string; b: number }) => Object;
>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
@@ -274,10 +274,10 @@ b8 = a8; // ok
>a8 : new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
var b9: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U;
>b9 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
>b9 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number;}) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: string; bing: number; }) => U
>y : (arg2: { foo: string; bing: number;}) => U
>arg2 : { foo: string; bing: number; }
>foo : string
>bing : number
@@ -323,7 +323,7 @@ b11 = a11; // ok
>a11 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
var b12: new <T extends Array<Base>>(x: Array<Base>, y: T) => Array<Derived>;
>b12 : new <T extends Base[]>(x: Base[], y: T) => Derived[]
>b12 : new <T extends Base[]>(x: Array<Base>, y: T) => Array<Derived>
>x : Base[]
>y : T
@@ -338,7 +338,7 @@ b12 = a12; // ok
>a12 : new (x: Base[], y: Derived2[]) => Derived[]
var b13: new <T extends Array<Derived>>(x: Array<Base>, y: T) => T;
>b13 : new <T extends Derived[]>(x: Base[], y: T) => T
>b13 : new <T extends Derived[]>(x: Array<Base>, y: T) => T
>x : Base[]
>y : T
@@ -50,7 +50,7 @@ module Errors {
>x : Base[]
var a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>a11 : new (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -58,7 +58,7 @@ module Errors {
>bar : string
var a12: new (x: Array<Base>, y: Array<Derived2>) => Array<Derived>;
>a12 : new (x: Base[], y: Derived2[]) => Derived[]
>a12 : new (x: Array<Base>, y: Array<Derived2>) => Array<Derived>
>x : Base[]
>y : Derived2[]
@@ -73,7 +73,7 @@ module Errors {
};
var a15: new (x: { a: string; b: number }) => number;
>a15 : new (x: { a: string; b: number; }) => number
>a15 : new (x: { a: string; b: number;}) => number
>x : { a: string; b: number; }
>a : string
>b : number
@@ -158,10 +158,10 @@ module Errors {
>a7 : new (x: (arg: Base) => Derived) => (r: Base) => Derived2
var b8: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U;
>b8 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U
>b8 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number;}) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: number; }) => U
>y : (arg2: { foo: number;}) => U
>arg2 : { foo: number; }
>foo : number
>r : T
@@ -207,7 +207,7 @@ module Errors {
>a11 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
var b12: new <T extends Array<Derived2>>(x: Array<Base>, y: Array<Base>) => T;
>b12 : new <T extends Derived2[]>(x: Base[], y: Base[]) => T
>b12 : new <T extends Derived2[]>(x: Array<Base>, y: Array<Base>) => T
>x : Base[]
>y : Base[]
@@ -299,7 +299,7 @@ namespace GH30170 {
>val : Blue | Yellow
function drawWithColor(currentColor: 'blue' | 'yellow' | undefined) {
>drawWithColor : (currentColor: "blue" | "yellow") => void
>drawWithColor : (currentColor: 'blue' | 'yellow' | undefined) => void
>currentColor : "blue" | "yellow"
return draw({ color: currentColor });
@@ -177,13 +177,13 @@ module ObjectTypes {
>t2 : T2
var a: { foo: typeof a; }
>a : { foo: any; }
>foo : { foo: any; }
>a : { foo: typeof a; }
>foo : { foo: typeof a; }
>a : { foo: any; }
var b: { foo: typeof b; }
>b : { foo: any; }
>foo : { foo: any; }
>b : { foo: typeof b; }
>foo : { foo: typeof b; }
>b : { foo: any; }
var a2 = { foo: a2 };
@@ -12,7 +12,7 @@ let mappedObject: {[K in "foo"]: null | {x: string}} = {foo: {x: "hello"}};
>"hello" : "hello"
declare function foo<T>(x: T): null | T;
>foo : <T>(x: T) => T
>foo : <T>(x: T) => null | T
>x : T
>null : null
@@ -184,7 +184,7 @@ fn = () => 3; // Bug 823548: Should be error (fn is not a reference)
>3 : 3
function fn2(x: number, y: { t: number }) {
>fn2 : (x: number, y: { t: number; }) => void
>fn2 : (x: number, y: { t: number;}) => void
>x : number
>y : { t: number; }
>t : number
@@ -1,10 +1,10 @@
=== tests/cases/compiler/asyncFunctionReturnExpressionErrorSpans.ts ===
interface Foo {
bar: {
>bar : { baz: { inner: { thing: string; }; }; }
>bar : { baz: { inner: { thing: string; };}; }
baz: {
>baz : { inner: { thing: string; }; }
>baz : { inner: { thing: string;}; }
inner: {
>inner : { thing: string; }
@@ -29,7 +29,7 @@ interface Obj {
}
async function fIndexedTypeForStringProp(obj: Obj): Promise<Obj["stringProp"]> {
>fIndexedTypeForStringProp : (obj: Obj) => Promise<string>
>fIndexedTypeForStringProp : (obj: Obj) => Promise<Obj["stringProp"]>
>obj : Obj
return obj.stringProp;
@@ -39,7 +39,7 @@ async function fIndexedTypeForStringProp(obj: Obj): Promise<Obj["stringProp"]> {
}
async function fIndexedTypeForPromiseOfStringProp(obj: Obj): Promise<Obj["stringProp"]> {
>fIndexedTypeForPromiseOfStringProp : (obj: Obj) => Promise<string>
>fIndexedTypeForPromiseOfStringProp : (obj: Obj) => Promise<Obj["stringProp"]>
>obj : Obj
return Promise.resolve(obj.stringProp);
@@ -53,7 +53,7 @@ async function fIndexedTypeForPromiseOfStringProp(obj: Obj): Promise<Obj["string
}
async function fIndexedTypeForExplicitPromiseOfStringProp(obj: Obj): Promise<Obj["stringProp"]> {
>fIndexedTypeForExplicitPromiseOfStringProp : (obj: Obj) => Promise<string>
>fIndexedTypeForExplicitPromiseOfStringProp : (obj: Obj) => Promise<Obj["stringProp"]>
>obj : Obj
return Promise.resolve<Obj["stringProp"]>(obj.stringProp);
@@ -67,7 +67,7 @@ async function fIndexedTypeForExplicitPromiseOfStringProp(obj: Obj): Promise<Obj
}
async function fIndexedTypeForAnyProp(obj: Obj): Promise<Obj["anyProp"]> {
>fIndexedTypeForAnyProp : (obj: Obj) => Promise<any>
>fIndexedTypeForAnyProp : (obj: Obj) => Promise<Obj["anyProp"]>
>obj : Obj
return obj.anyProp;
@@ -77,7 +77,7 @@ async function fIndexedTypeForAnyProp(obj: Obj): Promise<Obj["anyProp"]> {
}
async function fIndexedTypeForPromiseOfAnyProp(obj: Obj): Promise<Obj["anyProp"]> {
>fIndexedTypeForPromiseOfAnyProp : (obj: Obj) => Promise<any>
>fIndexedTypeForPromiseOfAnyProp : (obj: Obj) => Promise<Obj["anyProp"]>
>obj : Obj
return Promise.resolve(obj.anyProp);
@@ -91,7 +91,7 @@ async function fIndexedTypeForPromiseOfAnyProp(obj: Obj): Promise<Obj["anyProp"]
}
async function fIndexedTypeForExplicitPromiseOfAnyProp(obj: Obj): Promise<Obj["anyProp"]> {
>fIndexedTypeForExplicitPromiseOfAnyProp : (obj: Obj) => Promise<any>
>fIndexedTypeForExplicitPromiseOfAnyProp : (obj: Obj) => Promise<Obj["anyProp"]>
>obj : Obj
return Promise.resolve<Obj["anyProp"]>(obj.anyProp);
@@ -7,16 +7,16 @@ class AsyncEnumeratorDone { };
interface IAsyncEnumerator<T> {
next1(): Promise<T | AsyncEnumeratorDone>;
>next1 : () => Promise<AsyncEnumeratorDone | T>
>next1 : () => Promise<T | AsyncEnumeratorDone>
next2(): Promise<T> | Promise<AsyncEnumeratorDone>;
>next2 : () => Promise<T> | Promise<AsyncEnumeratorDone>
next3(): Promise<T | {}>;
>next3 : () => Promise<{} | T>
>next3 : () => Promise<T | {}>
next4(): Promise<T | { x: string }>;
>next4 : () => Promise<T | { x: string; }>
>next4 : () => Promise<T | { x: string;}>
>x : string
}
@@ -3,7 +3,7 @@
interface Array<T> {
equalsShallow<T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>): boolean;
>equalsShallow : <T>(this: readonly T[], other: readonly T[]) => boolean
>equalsShallow : <T>(this: ReadonlyArray<T>, other: ReadonlyArray<T>) => boolean
>this : readonly T[]
>other : readonly T[]
}
@@ -221,7 +221,7 @@ export declare class Promise<R> implements Promise.Thenable<R> {
>object : Object
static settle<R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<Promise.Inspection<R>[]>;
>settle : { <R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<any[]>; <R>(dit: typeof Promise, values: R[]): Promise<any[]>; }
>settle : { <R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<any[]>; <R>(dit: typeof Promise, values: R[]): Promise<any[]>; }
>dit : typeof Promise
>Promise : typeof Promise
>values : Promise.Thenable<Promise.Thenable<R>[]>
@@ -230,7 +230,7 @@ export declare class Promise<R> implements Promise.Thenable<R> {
>Promise : any
static settle<R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<Promise.Inspection<R>[]>;
>settle : { <R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<any[]>; <R>(dit: typeof Promise, values: R[]): Promise<any[]>; }
>settle : { <R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<any[]>; <R>(dit: typeof Promise, values: R[]): Promise<any[]>; }
>dit : typeof Promise
>Promise : typeof Promise
>values : Promise.Thenable<R[]>
@@ -238,7 +238,7 @@ export declare class Promise<R> implements Promise.Thenable<R> {
>Promise : any
static settle<R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<Promise.Inspection<R>[]>;
>settle : { <R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<any[]>; <R>(dit: typeof Promise, values: R[]): Promise<any[]>; }
>settle : { <R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<Promise.Inspection<R>[]>; <R>(dit: typeof Promise, values: R[]): Promise<any[]>; }
>dit : typeof Promise
>Promise : typeof Promise
>values : Promise.Thenable<R>[]
@@ -246,7 +246,7 @@ export declare class Promise<R> implements Promise.Thenable<R> {
>Promise : any
static settle<R>(dit: typeof Promise, values: R[]): Promise<Promise.Inspection<R>[]>;
>settle : { <R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<any[]>; <R>(dit: typeof Promise, values: R[]): Promise<any[]>; }
>settle : { <R>(dit: typeof Promise, values: Promise.Thenable<Promise.Thenable<R>[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R[]>): Promise<any[]>; <R>(dit: typeof Promise, values: Promise.Thenable<R>[]): Promise<any[]>; <R>(dit: typeof Promise, values: R[]): Promise<Promise.Inspection<R>[]>; }
>dit : typeof Promise
>Promise : typeof Promise
>values : R[]
@@ -30,7 +30,7 @@ function f1() {
}
function f2(a: true | false, b: boolean) {
>f2 : (a: boolean, b: boolean) => void
>f2 : (a: true | false, b: boolean) => void
>a : boolean
>true : true
>false : false
@@ -48,7 +48,7 @@ function f2(a: true | false, b: boolean) {
}
function f3(a: true | false, b: true | false) {
>f3 : (a: boolean, b: boolean) => void
>f3 : (a: true | false, b: true | false) => void
>a : boolean
>true : true
>false : false
@@ -164,7 +164,7 @@ function assertNever(x: never): never {
}
function f10(x: true | false) {
>f10 : (x: boolean) => "true" | "false"
>f10 : (x: true | false) => "true" | "false"
>x : boolean
>true : true
>false : false
@@ -183,7 +183,7 @@ function f10(x: true | false) {
}
function f11(x: true | false) {
>f11 : (x: boolean) => "true" | "false"
>f11 : (x: true | false) => "true" | "false"
>x : boolean
>true : true
>false : false
@@ -206,7 +206,7 @@ function f11(x: true | false) {
}
function f12(x: true | false) {
>f12 : (x: boolean) => void
>f12 : (x: true | false) => void
>x : boolean
>true : true
>false : false
@@ -224,7 +224,7 @@ function f12(x: true | false) {
}
function f13(x: true | false) {
>f13 : (x: boolean) => void
>f13 : (x: true | false) => void
>x : boolean
>true : true
>false : false
@@ -30,7 +30,7 @@ function f1() {
}
function f2(a: true | false, b: boolean) {
>f2 : (a: boolean, b: boolean) => void
>f2 : (a: true | false, b: boolean) => void
>a : boolean
>true : true
>false : false
@@ -48,7 +48,7 @@ function f2(a: true | false, b: boolean) {
}
function f3(a: true | false, b: true | false) {
>f3 : (a: boolean, b: boolean) => void
>f3 : (a: true | false, b: true | false) => void
>a : boolean
>true : true
>false : false
@@ -164,7 +164,7 @@ function assertNever(x: never): never {
}
function f10(x: true | false) {
>f10 : (x: boolean) => "true" | "false"
>f10 : (x: true | false) => "true" | "false"
>x : boolean
>true : true
>false : false
@@ -183,7 +183,7 @@ function f10(x: true | false) {
}
function f11(x: true | false) {
>f11 : (x: boolean) => "true" | "false"
>f11 : (x: true | false) => "true" | "false"
>x : boolean
>true : true
>false : false
@@ -206,7 +206,7 @@ function f11(x: true | false) {
}
function f12(x: true | false) {
>f12 : (x: boolean) => void
>f12 : (x: true | false) => void
>x : boolean
>true : true
>false : false
@@ -224,7 +224,7 @@ function f12(x: true | false) {
}
function f13(x: true | false) {
>f13 : (x: boolean) => void
>f13 : (x: true | false) => void
>x : boolean
>true : true
>false : false
+2 -2
View File
@@ -17,8 +17,8 @@ o2?.b();
>b : () => number
declare const o3: { b: (() => { c: string }) | undefined };
>o3 : { b: () => { c: string; }; }
>b : () => { c: string; }
>o3 : { b: (() => { c: string;}) | undefined; }
>b : () => { c: string;}
>c : string
o3.b?.().c;
+1 -1
View File
@@ -4,7 +4,7 @@ declare function absorb<T>(): T;
declare const a: { m?<T>(obj: {x: T}): T } | undefined;
>a : { m?<T>(obj: { x: T; }): T; } | undefined
>m : (<T>(obj: { x: T; }) => T) | undefined
>m : (<T>(obj: { x: T;}) => T) | undefined
>obj : { x: T; }
>x : T
+3 -3
View File
@@ -106,8 +106,8 @@ o2?.["b"](1, ...[2, 3], 4);
>4 : 4
declare const o3: { b: ((...args: any[]) => { c: string }) | undefined };
>o3 : { b: ((...args: any[]) => { c: string; }) | undefined; }
>b : ((...args: any[]) => { c: string; }) | undefined
>o3 : { b: ((...args: any[]) => { c: string;}) | undefined; }
>b : ((...args: any[]) => { c: string;}) | undefined
>args : any[]
>c : string
@@ -257,7 +257,7 @@ const v: number | undefined = o4?.(incr);
// GH#33744
declare const o5: <T>() => undefined | (() => void);
>o5 : <T>() => (() => void) | undefined
>o5 : <T>() => undefined | (() => void)
o5<number>()?.();
>o5<number>()?.() : void | undefined
+1 -1
View File
@@ -9,7 +9,7 @@ declare function takeTwo(x: any, y: any): void;
>y : any
declare function withRest(a: any, ...args: Array<any>): void;
>withRest : (a: any, ...args: any[]) => void
>withRest : (a: any, ...args: Array<any>) => void
>a : any
>args : any[]
@@ -76,7 +76,7 @@ interface A { // T
>x : Derived[]
a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>a11 : (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -84,17 +84,17 @@ interface A { // T
>bar : string
a12: (x: Array<Base>, y: Array<Derived2>) => Array<Derived>;
>a12 : (x: Base[], y: Derived2[]) => Derived[]
>a12 : (x: Array<Base>, y: Array<Derived2>) => Array<Derived>
>x : Base[]
>y : Derived2[]
a13: (x: Array<Base>, y: Array<Derived>) => Array<Derived>;
>a13 : (x: Base[], y: Derived[]) => Derived[]
>a13 : (x: Array<Base>, y: Array<Derived>) => Array<Derived>
>x : Base[]
>y : Derived[]
a14: (x: { a: string; b: number }) => Object;
>a14 : (x: { a: string; b: number; }) => Object
>a14 : (x: { a: string; b: number;}) => Object
>x : { a: string; b: number; }
>a : string
>b : number
@@ -202,10 +202,10 @@ interface I extends A {
>r : T
a9: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal
>a9 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
>a9 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number;}) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: string; bing: number; }) => U
>y : (arg2: { foo: string; bing: number;}) => U
>arg2 : { foo: string; bing: number; }
>foo : string
>bing : number
@@ -221,12 +221,12 @@ interface I extends A {
>y : T
a12: <T extends Array<Base>>(x: Array<Base>, y: T) => Array<Derived>; // ok, less specific parameter type
>a12 : <T extends Base[]>(x: Base[], y: T) => Derived[]
>a12 : <T extends Base[]>(x: Array<Base>, y: T) => Array<Derived>
>x : Base[]
>y : T
a13: <T extends Array<Derived>>(x: Array<Base>, y: T) => T; // ok, T = Array<Derived>, satisfies constraint, contextual signature instantiation succeeds
>a13 : <T extends Derived[]>(x: Base[], y: T) => T
>a13 : <T extends Derived[]>(x: Array<Base>, y: T) => T
>x : Base[]
>y : T
@@ -50,7 +50,7 @@ module Errors {
>x : Base[]
a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>a11 : (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -58,7 +58,7 @@ module Errors {
>bar : string
a12: (x: Array<Base>, y: Array<Derived2>) => Array<Derived>;
>a12 : (x: Base[], y: Derived2[]) => Derived[]
>a12 : (x: Array<Base>, y: Array<Derived2>) => Array<Derived>
>x : Base[]
>y : Derived2[]
@@ -73,7 +73,7 @@ module Errors {
};
a15: (x: { a: string; b: number }) => number;
>a15 : (x: { a: string; b: number; }) => number
>a15 : (x: { a: string; b: number;}) => number
>x : { a: string; b: number; }
>a : string
>b : number
@@ -152,10 +152,10 @@ module Errors {
interface I4 extends A {
a8: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch
>a8 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U
>a8 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number;}) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: number; }) => U
>y : (arg2: { foo: number;}) => U
>arg2 : { foo: number; }
>foo : number
>r : T
@@ -176,7 +176,7 @@ module Errors {
interface I4E extends A {
a12: <T extends Array<Derived2>>(x: Array<Base>, y: Array<Base>) => T; // valid, no inferences for T, defaults to Array<Derived2>
>a12 : <T extends Derived2[]>(x: Base[], y: Base[]) => T
>a12 : <T extends Derived2[]>(x: Array<Base>, y: Array<Base>) => T
>x : Base[]
>y : Base[]
}
@@ -77,7 +77,7 @@ interface A { // T
>x : Derived[]
a11: (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>a11 : (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -85,17 +85,17 @@ interface A { // T
>bar : string
a12: (x: Array<Base>, y: Array<Derived2>) => Array<Derived>;
>a12 : (x: Base[], y: Derived2[]) => Derived[]
>a12 : (x: Array<Base>, y: Array<Derived2>) => Array<Derived>
>x : Base[]
>y : Derived2[]
a13: (x: Array<Base>, y: Array<Derived>) => Array<Derived>;
>a13 : (x: Base[], y: Derived[]) => Derived[]
>a13 : (x: Array<Base>, y: Array<Derived>) => Array<Derived>
>x : Base[]
>y : Derived[]
a14: (x: { a: string; b: number }) => Object;
>a14 : (x: { a: string; b: number; }) => Object
>a14 : (x: { a: string; b: number;}) => Object
>x : { a: string; b: number; }
>a : string
>b : number
@@ -152,10 +152,10 @@ interface I extends B {
>r : T
a9: <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal
>a9 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
>a9 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number;}) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: string; bing: number; }) => U
>y : (arg2: { foo: string; bing: number;}) => U
>arg2 : { foo: string; bing: number; }
>foo : string
>bing : number
@@ -171,12 +171,12 @@ interface I extends B {
>y : T
a12: <T extends Array<Base>>(x: Array<Base>, y: T) => Array<Derived>; // ok, less specific parameter type
>a12 : <T extends Base[]>(x: Base[], y: T) => Derived[]
>a12 : <T extends Base[]>(x: Array<Base>, y: T) => Array<Derived>
>x : Base[]
>y : T
a13: <T extends Array<Derived>>(x: Array<Base>, y: T) => T; // ok, T = Array<Derived>, satisfies constraint, contextual signature instantiation succeeds
>a13 : <T extends Derived[]>(x: Base[], y: T) => T
>a13 : <T extends Derived[]>(x: Array<Base>, y: T) => T
>x : Base[]
>y : T
@@ -107,7 +107,7 @@ interface I5<T> extends A {
interface I7<T> extends A {
a11: <U>(x: { foo: T }, y: { foo: U; bar: U }) => Base;
>a11 : <U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base
>a11 : <U>(x: { foo: T;}, y: { foo: U; bar: U; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: U; bar: U; }
@@ -117,7 +117,7 @@ interface I7<T> extends A {
interface I9<T> extends A {
a16: (x: { a: T; b: T }) => T[];
>a16 : (x: { a: T; b: T; }) => T[]
>a16 : (x: { a: T; b: T;}) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -1,6 +1,6 @@
=== tests/cases/compiler/callSignatureFunctionOverload.ts ===
var foo: {
>foo : { (name: string): string; (name: "order"): string; (name: "content"): string; (name: "done"): string; }
>foo : { (name: string): string; (name: 'order'): string; (name: 'content'): string; (name: 'done'): string; }
(name: string): string;
>name : string
@@ -16,7 +16,7 @@ var foo: {
}
var foo2: {
>foo2 : { (name: string): string; (name: "order"): string; (name: "order"): string; (name: "done"): string; }
>foo2 : { (name: string): string; (name: 'order'): string; (name: 'order'): string; (name: 'done'): string; }
(name: string): string;
>name : string
@@ -188,7 +188,7 @@ b(4); // not ok
>4 : 4
function c(x: number | void, y: void, z: void | string | number): void {
>c : (x: number | void, y: void, z: string | number | void) => void
>c : (x: number | void, y: void, z: void | string | number) => void
>x : number | void
>y : void
>z : string | number | void
@@ -5,7 +5,7 @@ declare function all(a?: number, b?: number): void;
>b : number
declare function weird(a?: number | string, b?: number | string): void;
>weird : (a?: string | number, b?: string | number) => void
>weird : (a?: number | string, b?: number | string) => void
>a : string | number
>b : string | number
@@ -1,7 +1,7 @@
=== tests/cases/compiler/callbackArgsDifferByOptionality.ts ===
function x3(callback: (x?: 'hi') => number);
>x3 : { (callback: (x?: "hi") => number): any; (callback: (x: string) => number): any; }
>callback : (x?: "hi") => number
>x3 : { (callback: (x?: 'hi') => number): any; (callback: (x: string) => number): any; }
>callback : (x?: 'hi') => number
>x : "hi"
function x3(callback: (x: string) => number);
@@ -24,7 +24,7 @@ function C() {
=== tests/cases/conformance/jsdoc/use.js ===
/** @param {import('./mod1').Con} k */
function f(k) {
>f : (k: import("tests/cases/conformance/jsdoc/mod1").Con) => any
>f : (k: import('./mod1').Con) => any
>k : import("tests/cases/conformance/jsdoc/mod1").Con
if (1 === 2 - 1) {
@@ -110,17 +110,17 @@ function test3(items: string[] | number[]) {
}
function test4(
>test4 : (arg1: ((...objs: { x: number; }[]) => number) | ((...objs: { y: number; }[]) => number), arg2: ((a: { x: number; }, b: object) => number) | ((a: object, b: { x: number; }) => number), arg3: ((a: { x: number; }, ...objs: { y: number; }[]) => number) | ((...objs: { x: number; }[]) => number), arg4: ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((a?: { y: number; } | undefined) => number), arg5: ((a?: { x: number; } | undefined, ...b: { x: number; }[]) => number) | ((a?: { y: number; } | undefined) => number), arg6: ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((...a: { y: number; }[]) => number)) => void
>test4 : (arg1: ((...objs: { x: number;}[]) => number) | ((...objs: { y: number;}[]) => number), arg2: ((a: { x: number;}, b: object) => number) | ((a: object, b: { x: number;}) => number), arg3: ((a: { x: number;}, ...objs: { y: number;}[]) => number) | ((...objs: { x: number;}[]) => number), arg4: ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((a?: { y: number; } | undefined) => number), arg5: ((a?: { x: number; } | undefined, ...b: { x: number;}[]) => number) | ((a?: { y: number; } | undefined) => number), arg6: ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((...a: { y: number;}[]) => number)) => void
arg1: ((...objs: {x: number}[]) => number) | ((...objs: {y: number}[]) => number),
>arg1 : ((...objs: { x: number; }[]) => number) | ((...objs: { y: number; }[]) => number)
>arg1 : ((...objs: { x: number;}[]) => number) | ((...objs: { y: number;}[]) => number)
>objs : { x: number; }[]
>x : number
>objs : { y: number; }[]
>y : number
arg2: ((a: {x: number}, b: object) => number) | ((a: object, b: {x: number}) => number),
>arg2 : ((a: { x: number; }, b: object) => number) | ((a: object, b: { x: number; }) => number)
>arg2 : ((a: { x: number;}, b: object) => number) | ((a: object, b: { x: number;}) => number)
>a : { x: number; }
>x : number
>b : object
@@ -129,7 +129,7 @@ function test4(
>x : number
arg3: ((a: {x: number}, ...objs: {y: number}[]) => number) | ((...objs: {x: number}[]) => number),
>arg3 : ((a: { x: number; }, ...objs: { y: number; }[]) => number) | ((...objs: { x: number; }[]) => number)
>arg3 : ((a: { x: number;}, ...objs: { y: number;}[]) => number) | ((...objs: { x: number;}[]) => number)
>a : { x: number; }
>x : number
>objs : { y: number; }[]
@@ -147,7 +147,7 @@ function test4(
>y : number
arg5: ((a?: {x: number}, ...b: {x: number}[]) => number) | ((a?: {y: number}) => number),
>arg5 : ((a?: { x: number; } | undefined, ...b: { x: number; }[]) => number) | ((a?: { y: number; } | undefined) => number)
>arg5 : ((a?: { x: number; } | undefined, ...b: { x: number;}[]) => number) | ((a?: { y: number; } | undefined) => number)
>a : { x: number; } | undefined
>x : number
>b : { x: number; }[]
@@ -156,7 +156,7 @@ function test4(
>y : number
arg6: ((a?: {x: number}, b?: {x: number}) => number) | ((...a: {y: number}[]) => number),
>arg6 : ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((...a: { y: number; }[]) => number)
>arg6 : ((a?: { x: number; } | undefined, b?: { x: number; } | undefined) => number) | ((...a: { y: number;}[]) => number)
>a : { x: number; } | undefined
>x : number
>b : { x: number; } | undefined
@@ -358,8 +358,8 @@ function test5() {
// Union of all intrinsics and components of `any`
function App(props: { component:React.ReactType }) {
>App : (props: { component: React.ReactType<any>; }) => JSX.Element
>props : { component: React.ReactType<any>; }
>App : (props: { component: React.ReactType;}) => JSX.Element
>props : { component: React.ReactType; }
>component : React.ReactType<any>
>React : any
@@ -18,9 +18,9 @@ function foo1(y = class {c = x}, x = 1) {
// ok - used in file
function foo2(y = function(x: typeof z) {}, z = 1) {
>foo2 : (y?: (x: number) => void, z?: number) => void
>y : (x: number) => void
>function(x: typeof z) {} : (x: number) => void
>foo2 : (y?: (x: typeof z) => void, z?: number) => void
>y : (x: typeof z) => void
>function(x: typeof z) {} : (x: typeof z) => void
>x : number
>z : number
>z : number
@@ -16,7 +16,7 @@ interface Sequence<T> {
>value : T
groupBy<K>(keySelector: (value: T) => K): Sequence<{ key: K; items: T[]; }>;
>groupBy : <K>(keySelector: (value: T) => K) => Sequence<{ key: K; items: T[]; }>
>groupBy : <K>(keySelector: (value: T) => K) => Sequence<{ key: K; items: T[];}>
>keySelector : (value: T) => K
>value : T
>key : K
@@ -22,7 +22,7 @@ export = Foo;
/** @typedef {(foo: Foo) => string} FooFun */
module.exports = /** @type {FooFun} */(void 0);
>module.exports = /** @type {FooFun} */(void 0) : (foo: typeof import("tests/cases/compiler/file")) => string
>module.exports = /** @type {FooFun} */(void 0) : (foo: Foo) => string
>module.exports : (foo: typeof import("tests/cases/compiler/file")) => string
>module : { "\"tests/cases/compiler/something\"": (foo: typeof import("tests/cases/compiler/file")) => string; }
>exports : (foo: typeof import("tests/cases/compiler/file")) => string
@@ -5,9 +5,9 @@
* @param {string} [s]
*/
var x = function foo(n, s) {}
>x : (n?: number, s?: string) => void
>function foo(n, s) {} : (n?: number, s?: string) => void
>foo : (n?: number, s?: string) => void
>x : (n?: number | undefined, s?: string) => void
>function foo(n, s) {} : (n?: number | undefined, s?: string) => void
>foo : (n?: number | undefined, s?: string) => void
>n : number
>s : string
@@ -5,7 +5,7 @@
* @param {string} [s]
*/
function foo(n, s) {}
>foo : (n?: number, s?: string) => void
>foo : (n?: number | undefined, s?: string) => void
>n : number
>s : string
@@ -14,7 +14,7 @@ function f() {
* @returns {string=} This comment is not currently exposed
*/
function f1() {
>f1 : () => string
>f1 : () => string | undefined
return "hello world";
>"hello world" : "hello world"
@@ -28,7 +28,7 @@ class AsyncLoader<TResult> extends React.Component<AsyncLoaderProps<TResult>> {
}
async function load(): Promise<{ success: true } | ErrorResult> {
>load : () => Promise<ErrorResult | { success: true; }>
>load : () => Promise<{ success: true;} | ErrorResult>
>success : true
>true : true
@@ -31,7 +31,7 @@ interface PM {
}
export function ComponentWithUnion(props: PM | PS) {
>ComponentWithUnion : (props: PS | PM) => JSX.Element
>ComponentWithUnion : (props: PM | PS) => JSX.Element
>props : PS | PM
return <h1></h1>;
@@ -177,7 +177,7 @@ Object.defineProperty(x, "zipStr", {
* @param {{name: string}} named
*/
function takeName(named) { return named.name; }
>takeName : (named: { name: string; }) => string
>takeName : (named: { name: string;}) => string
>named : { name: string; }
>named.name : string
>named : { name: string; }
@@ -231,7 +231,7 @@ const expected = /** @type {{name: string, readonly middleInit: string, readonly
* @param {typeof needsExemplar} b
*/
function match(a, b) {}
>match : (a: () => typeof x, b: (_?: typeof x) => undefined) => void
>match : (a: typeof returnExemplar, b: typeof needsExemplar) => void
>a : () => typeof x
>b : (_?: typeof x) => undefined
@@ -7,7 +7,7 @@ class A {
>A : A
doIt(x: Array<string>): void {
>doIt : (x: string[]) => void
>doIt : (x: Array<string>) => void
>x : string[]
x.forEach((v) => {
@@ -16,11 +16,11 @@ function Wagon(numberOxen) {
}
/** @param {Wagon[]=} wagons */
Wagon.circle = function (wagons) {
>Wagon.circle = function (wagons) { return wagons ? wagons.length : 3.14;} : (wagons?: Wagon[]) => number
>Wagon.circle : (wagons?: Wagon[]) => number
>Wagon.circle = function (wagons) { return wagons ? wagons.length : 3.14;} : (wagons?: Wagon[] | undefined) => number
>Wagon.circle : (wagons?: Wagon[] | undefined) => number
>Wagon : typeof Wagon
>circle : (wagons?: Wagon[]) => number
>function (wagons) { return wagons ? wagons.length : 3.14;} : (wagons?: Wagon[]) => number
>function (wagons) { return wagons ? wagons.length : 3.14;} : (wagons?: Wagon[] | undefined) => number
>wagons : Wagon[]
return wagons ? wagons.length : 3.14;
@@ -33,24 +33,24 @@ Wagon.circle = function (wagons) {
}
/** @param {*[]=} supplies - *[]= is my favourite type */
Wagon.prototype.load = function (supplies) {
>Wagon.prototype.load = function (supplies) {} : (supplies?: any[]) => void
>Wagon.prototype.load = function (supplies) {} : (supplies?: any[] | undefined) => void
>Wagon.prototype.load : any
>Wagon.prototype : any
>Wagon : typeof Wagon
>prototype : any
>load : any
>function (supplies) {} : (supplies?: any[]) => void
>function (supplies) {} : (supplies?: any[] | undefined) => void
>supplies : any[]
}
/** @param {*[]=} supplies - Yep, still a great type */
Wagon.prototype.weight = supplies => supplies ? supplies.length : -1
>Wagon.prototype.weight = supplies => supplies ? supplies.length : -1 : (supplies?: any[]) => number
>Wagon.prototype.weight = supplies => supplies ? supplies.length : -1 : (supplies?: any[] | undefined) => number
>Wagon.prototype.weight : any
>Wagon.prototype : any
>Wagon : typeof Wagon
>prototype : any
>weight : any
>supplies => supplies ? supplies.length : -1 : (supplies?: any[]) => number
>supplies => supplies ? supplies.length : -1 : (supplies?: any[] | undefined) => number
>supplies : any[]
>supplies ? supplies.length : -1 : number
>supplies : any[]
@@ -102,7 +102,7 @@ class Sql extends Wagon {
* This is not assignable, so should have a type error
*/
load(files, format) {
>load : (files: string[], format: "csv" | "json" | "xmlolololol") => void
>load : (files: Array<string>, format: "csv" | "json" | "xmlolololol") => void
>files : string[]
>format : "csv" | "json" | "xmlolololol"
@@ -2,7 +2,7 @@
interface A {}
function factory(a: any): {new(): Object} {
>factory : (a: any) => new () => Object
>factory : (a: any) => { new (): Object;}
>a : any
return null;
@@ -19,7 +19,7 @@ module Editor {
}
public static MakeHead(): List<T> { // should error
>MakeHead : () => List<any>
>MakeHead : () => List<T>
var entry: List<T> = new List<T>(true, null);
>entry : List<any>
@@ -1,7 +1,7 @@
=== tests/cases/compiler/b.ts ===
///<reference path="a.ts"/>
declare function foobar(a: typeof foo): typeof bar;
>foobar : (a: () => any) => () => any
>foobar : (a: typeof foo) => typeof bar
>a : () => any
>foo : () => any
>bar : () => any
@@ -1,21 +1,21 @@
=== tests/cases/conformance/types/intersection/commonTypeIntersection.ts ===
declare let x1: { __typename?: 'TypeTwo' } & { a: boolean };
>x1 : { __typename?: "TypeTwo"; } & { a: boolean; }
>x1 : { __typename?: 'TypeTwo'; } & { a: boolean; }
>__typename : "TypeTwo"
>a : boolean
let y1: { __typename?: 'TypeOne' } & { a: boolean} = x1; // should error here
>y1 : { __typename?: "TypeOne"; } & { a: boolean; }
>y1 : { __typename?: 'TypeOne'; } & { a: boolean; }
>__typename : "TypeOne"
>a : boolean
>x1 : { __typename?: "TypeTwo"; } & { a: boolean; }
declare let x2: { __typename?: 'TypeTwo' } & string;
>x2 : { __typename?: "TypeTwo"; } & string
>x2 : { __typename?: 'TypeTwo'; } & string
>__typename : "TypeTwo"
let y2: { __typename?: 'TypeOne' } & string = x2; // should error here
>y2 : { __typename?: "TypeOne"; } & string
>y2 : { __typename?: 'TypeOne'; } & string
>__typename : "TypeOne"
>x2 : { __typename?: "TypeTwo"; } & string
@@ -85,9 +85,9 @@ declare module Immutable {
>Immutable : typeof Immutable
export function fromJS(jsValue: any, reviver?: (key: string | number, sequence: Collection.Keyed<string, any> | Collection.Indexed<any>, path?: Array<string | number>) => any): any;
>fromJS : (jsValue: any, reviver?: (key: string | number, sequence: Collection.Keyed<string, any> | Collection.Indexed<any>, path?: (string | number)[]) => any) => any
>fromJS : (jsValue: any, reviver?: (key: string | number, sequence: Collection.Keyed<string, any> | Collection.Indexed<any>, path?: Array<string | number>) => any) => any
>jsValue : any
>reviver : (key: string | number, sequence: Collection.Keyed<string, any> | Collection.Indexed<any>, path?: (string | number)[]) => any
>reviver : (key: string | number, sequence: Collection.Keyed<string, any> | Collection.Indexed<any>, path?: Array<string | number>) => any
>key : string | number
>sequence : Collection.Keyed<string, any> | Collection.Indexed<any>
>Collection : any
@@ -151,7 +151,7 @@ declare module Immutable {
>maybeList : any
function of<T>(...values: Array<T>): List<T>;
>of : <T>(...values: T[]) => List<T>
>of : <T>(...values: Array<T>) => List<T>
>values : T[]
}
export function List(): List<any>;
@@ -190,14 +190,14 @@ declare module Immutable {
>clear : () => List<T>
push(...values: Array<T>): List<T>;
>push : (...values: T[]) => List<T>
>push : (...values: Array<T>) => List<T>
>values : T[]
pop(): List<T>;
>pop : () => List<T>
unshift(...values: Array<T>): List<T>;
>unshift : (...values: T[]) => List<T>
>unshift : (...values: Array<T>) => List<T>
>values : T[]
shift(): List<T>;
@@ -222,12 +222,12 @@ declare module Immutable {
>value : this
merge(...collections: Array<Collection.Indexed<T> | Array<T>>): this;
>merge : (...collections: (Collection.Indexed<T> | T[])[]) => this
>merge : (...collections: Array<Collection.Indexed<T> | Array<T>>) => this
>collections : (Collection.Indexed<T> | T[])[]
>Collection : any
mergeWith(merger: (oldVal: T, newVal: T, key: number) => T, ...collections: Array<Collection.Indexed<T> | Array<T>>): this;
>mergeWith : (merger: (oldVal: T, newVal: T, key: number) => T, ...collections: (Collection.Indexed<T> | T[])[]) => this
>mergeWith : (merger: (oldVal: T, newVal: T, key: number) => T, ...collections: Array<Collection.Indexed<T> | Array<T>>) => this
>merger : (oldVal: T, newVal: T, key: number) => T
>oldVal : T
>newVal : T
@@ -236,12 +236,12 @@ declare module Immutable {
>Collection : any
mergeDeep(...collections: Array<Collection.Indexed<T> | Array<T>>): this;
>mergeDeep : (...collections: (Collection.Indexed<T> | T[])[]) => this
>mergeDeep : (...collections: Array<Collection.Indexed<T> | Array<T>>) => this
>collections : (Collection.Indexed<T> | T[])[]
>Collection : any
mergeDeepWith(merger: (oldVal: T, newVal: T, key: number) => T, ...collections: Array<Collection.Indexed<T> | Array<T>>): this;
>mergeDeepWith : (merger: (oldVal: T, newVal: T, key: number) => T, ...collections: (Collection.Indexed<T> | T[])[]) => this
>mergeDeepWith : (merger: (oldVal: T, newVal: T, key: number) => T, ...collections: Array<Collection.Indexed<T> | Array<T>>) => this
>merger : (oldVal: T, newVal: T, key: number) => T
>oldVal : T
>newVal : T
@@ -281,12 +281,12 @@ declare module Immutable {
>value : any
mergeIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
>mergeIn : (keyPath: Iterable<any>, ...collections: any[]) => this
>mergeIn : (keyPath: Iterable<any>, ...collections: Array<any>) => this
>keyPath : Iterable<any>
>collections : any[]
mergeDeepIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
>mergeDeepIn : (keyPath: Iterable<any>, ...collections: any[]) => this
>mergeDeepIn : (keyPath: Iterable<any>, ...collections: Array<any>) => this
>keyPath : Iterable<any>
>collections : any[]
@@ -304,7 +304,7 @@ declare module Immutable {
// Sequence algorithms
concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): List<T | C>;
>concat : <C>(...valuesOrCollections: (C | Iterable<C>)[]) => List<T | C>
>concat : <C>(...valuesOrCollections: Array<Iterable<C> | C>) => List<T | C>
>valuesOrCollections : (C | Iterable<C>)[]
map<M>(mapper: (value: T, key: number, iter: this) => M, context?: any): List<M>;
@@ -347,7 +347,7 @@ declare module Immutable {
>maybeMap : any
function of(...keyValues: Array<any>): Map<any, any>;
>of : (...keyValues: any[]) => Map<any, any>
>of : (...keyValues: Array<any>) => Map<any, any>
>keyValues : any[]
}
export function Map<K, V>(collection: Iterable<[K, V]>): Map<K, V>;
@@ -471,12 +471,12 @@ declare module Immutable {
>value : any
mergeIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
>mergeIn : (keyPath: Iterable<any>, ...collections: any[]) => this
>mergeIn : (keyPath: Iterable<any>, ...collections: Array<any>) => this
>keyPath : Iterable<any>
>collections : any[]
mergeDeepIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
>mergeDeepIn : (keyPath: Iterable<any>, ...collections: any[]) => this
>mergeDeepIn : (keyPath: Iterable<any>, ...collections: Array<any>) => this
>keyPath : Iterable<any>
>collections : any[]
@@ -494,11 +494,11 @@ declare module Immutable {
// Sequence algorithms
concat<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): Map<K | KC, V | VC>;
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): Map<K | KC, V | VC>; <C>(...collections: { [key: string]: C; }[]): Map<string | K, V | C>; }
>concat : { <KC, VC>(...collections: Array<Iterable<[KC, VC]>>): Map<K | KC, V | VC>; <C>(...collections: { [key: string]: C; }[]): Map<string | K, V | C>; }
>collections : Iterable<[KC, VC]>[]
concat<C>(...collections: Array<{[key: string]: C}>): Map<K | string, V | C>;
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): Map<K | KC, V | VC>; <C>(...collections: { [key: string]: C; }[]): Map<string | K, V | C>; }
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): Map<K | KC, V | VC>; <C>(...collections: { [key: string]: C; }[]): Map<K | string, V | C>; }
>collections : { [key: string]: C; }[]
>key : string
@@ -579,11 +579,11 @@ declare module Immutable {
export interface OrderedMap<K, V> extends Map<K, V> {
// Sequence algorithms
concat<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): OrderedMap<K | KC, V | VC>;
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): OrderedMap<K | KC, V | VC>; <C>(...collections: { [key: string]: C; }[]): OrderedMap<string | K, V | C>; }
>concat : { <KC, VC>(...collections: Array<Iterable<[KC, VC]>>): OrderedMap<K | KC, V | VC>; <C>(...collections: { [key: string]: C; }[]): OrderedMap<string | K, V | C>; }
>collections : Iterable<[KC, VC]>[]
concat<C>(...collections: Array<{[key: string]: C}>): OrderedMap<K | string, V | C>;
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): OrderedMap<K | KC, V | VC>; <C>(...collections: { [key: string]: C; }[]): OrderedMap<string | K, V | C>; }
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): OrderedMap<K | KC, V | VC>; <C>(...collections: { [key: string]: C; }[]): OrderedMap<K | string, V | C>; }
>collections : { [key: string]: C; }[]
>key : string
@@ -643,7 +643,7 @@ declare module Immutable {
>maybeSet : any
function of<T>(...values: Array<T>): Set<T>;
>of : <T>(...values: T[]) => Set<T>
>of : <T>(...values: Array<T>) => Set<T>
>values : T[]
function fromKeys<T>(iter: Collection<T, any>): Set<T>;
@@ -693,19 +693,19 @@ declare module Immutable {
>clear : () => this
union(...collections: Array<Collection<any, T> | Array<T>>): this;
>union : (...collections: (Collection<any, T> | T[])[]) => this
>union : (...collections: Array<Collection<any, T> | Array<T>>) => this
>collections : (Collection<any, T> | T[])[]
merge(...collections: Array<Collection<any, T> | Array<T>>): this;
>merge : (...collections: (Collection<any, T> | T[])[]) => this
>merge : (...collections: Array<Collection<any, T> | Array<T>>) => this
>collections : (Collection<any, T> | T[])[]
intersect(...collections: Array<Collection<any, T> | Array<T>>): this;
>intersect : (...collections: (Collection<any, T> | T[])[]) => this
>intersect : (...collections: Array<Collection<any, T> | Array<T>>) => this
>collections : (Collection<any, T> | T[])[]
subtract(...collections: Array<Collection<any, T> | Array<T>>): this;
>subtract : (...collections: (Collection<any, T> | T[])[]) => this
>subtract : (...collections: Array<Collection<any, T> | Array<T>>) => this
>collections : (Collection<any, T> | T[])[]
// Transient changes
@@ -722,7 +722,7 @@ declare module Immutable {
// Sequence algorithms
concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): Set<T | C>;
>concat : <C>(...valuesOrCollections: (C | Iterable<C>)[]) => Set<T | C>
>concat : <C>(...valuesOrCollections: Array<Iterable<C> | C>) => Set<T | C>
>valuesOrCollections : (C | Iterable<C>)[]
map<M>(mapper: (value: T, key: never, iter: this) => M, context?: any): Set<M>;
@@ -765,7 +765,7 @@ declare module Immutable {
>maybeOrderedSet : any
function of<T>(...values: Array<T>): OrderedSet<T>;
>of : <T>(...values: T[]) => OrderedSet<T>
>of : <T>(...values: Array<T>) => OrderedSet<T>
>values : T[]
function fromKeys<T>(iter: Collection<T, any>): OrderedSet<T>;
@@ -790,7 +790,7 @@ declare module Immutable {
export interface OrderedSet<T> extends Set<T> {
// Sequence algorithms
concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): OrderedSet<T | C>;
>concat : <C>(...valuesOrCollections: (C | Iterable<C>)[]) => OrderedSet<T | C>
>concat : <C>(...valuesOrCollections: Array<Iterable<C> | C>) => OrderedSet<T | C>
>valuesOrCollections : (C | Iterable<C>)[]
map<M>(mapper: (value: T, key: never, iter: this) => M, context?: any): OrderedSet<M>;
@@ -826,7 +826,7 @@ declare module Immutable {
>context : any
zip(...collections: Array<Collection<any, any>>): OrderedSet<any>;
>zip : (...collections: Collection<any, any>[]) => OrderedSet<any>
>zip : (...collections: Array<Collection<any, any>>) => OrderedSet<any>
>collections : Collection<any, any>[]
zipWith<U, Z>(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection<any, U>): OrderedSet<Z>;
@@ -846,8 +846,8 @@ declare module Immutable {
>thirdCollection : Collection<any, V>
zipWith<Z>(zipper: (...any: Array<any>) => Z, ...collections: Array<Collection<any, any>>): OrderedSet<Z>;
>zipWith : { <U, Z>(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection<any, U>): OrderedSet<Z>; <U, V, Z>(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection<any, U>, thirdCollection: Collection<any, V>): OrderedSet<Z>; <Z>(zipper: (...any: any[]) => Z, ...collections: Collection<any, any>[]): OrderedSet<Z>; }
>zipper : (...any: any[]) => Z
>zipWith : { <U, Z>(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection<any, U>): OrderedSet<Z>; <U, V, Z>(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection<any, U>, thirdCollection: Collection<any, V>): OrderedSet<Z>; <Z>(zipper: (...any: Array<any>) => Z, ...collections: Array<Collection<any, any>>): OrderedSet<Z>; }
>zipper : (...any: Array<any>) => Z
>any : any[]
>collections : Collection<any, any>[]
}
@@ -859,7 +859,7 @@ declare module Immutable {
>maybeStack : any
function of<T>(...values: Array<T>): Stack<T>;
>of : <T>(...values: T[]) => Stack<T>
>of : <T>(...values: Array<T>) => Stack<T>
>values : T[]
}
export function Stack(): Stack<any>;
@@ -877,14 +877,14 @@ declare module Immutable {
// Reading values
peek(): T | undefined;
>peek : () => T
>peek : () => T | undefined
// Persistent changes
clear(): Stack<T>;
>clear : () => Stack<T>
unshift(...values: Array<T>): Stack<T>;
>unshift : (...values: T[]) => Stack<T>
>unshift : (...values: Array<T>) => Stack<T>
>values : T[]
unshiftAll(iter: Iterable<T>): Stack<T>;
@@ -895,7 +895,7 @@ declare module Immutable {
>shift : () => Stack<T>
push(...values: Array<T>): Stack<T>;
>push : (...values: T[]) => Stack<T>
>push : (...values: Array<T>) => Stack<T>
>values : T[]
pushAll(iter: Iterable<T>): Stack<T>;
@@ -919,7 +919,7 @@ declare module Immutable {
// Sequence algorithms
concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): Stack<T | C>;
>concat : <C>(...valuesOrCollections: (C | Iterable<C>)[]) => Stack<T | C>
>concat : <C>(...valuesOrCollections: Array<Iterable<C> | C>) => Stack<T | C>
>valuesOrCollections : (C | Iterable<C>)[]
map<M>(mapper: (value: T, key: number, iter: this) => M, context?: any): Stack<M>;
@@ -1029,15 +1029,15 @@ declare module Immutable {
>value : T[K]
merge(...collections: Array<Partial<T> | Iterable<[string, any]>>): this;
>merge : (...collections: (Iterable<[string, any]> | Partial<T>)[]) => this
>merge : (...collections: Array<Partial<T> | Iterable<[string, any]>>) => this
>collections : (Iterable<[string, any]> | Partial<T>)[]
mergeDeep(...collections: Array<Partial<T> | Iterable<[string, any]>>): this;
>mergeDeep : (...collections: (Iterable<[string, any]> | Partial<T>)[]) => this
>mergeDeep : (...collections: Array<Partial<T> | Iterable<[string, any]>>) => this
>collections : (Iterable<[string, any]> | Partial<T>)[]
mergeWith(merger: (oldVal: any, newVal: any, key: keyof T) => any, ...collections: Array<Partial<T> | Iterable<[string, any]>>): this;
>mergeWith : (merger: (oldVal: any, newVal: any, key: keyof T) => any, ...collections: (Iterable<[string, any]> | Partial<T>)[]) => this
>mergeWith : (merger: (oldVal: any, newVal: any, key: keyof T) => any, ...collections: Array<Partial<T> | Iterable<[string, any]>>) => this
>merger : (oldVal: any, newVal: any, key: keyof T) => any
>oldVal : any
>newVal : any
@@ -1045,7 +1045,7 @@ declare module Immutable {
>collections : (Iterable<[string, any]> | Partial<T>)[]
mergeDeepWith(merger: (oldVal: any, newVal: any, key: any) => any, ...collections: Array<Partial<T> | Iterable<[string, any]>>): this;
>mergeDeepWith : (merger: (oldVal: any, newVal: any, key: any) => any, ...collections: (Iterable<[string, any]> | Partial<T>)[]) => this
>mergeDeepWith : (merger: (oldVal: any, newVal: any, key: any) => any, ...collections: Array<Partial<T> | Iterable<[string, any]>>) => this
>merger : (oldVal: any, newVal: any, key: any) => any
>oldVal : any
>newVal : any
@@ -1076,12 +1076,12 @@ declare module Immutable {
>value : any
mergeIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
>mergeIn : (keyPath: Iterable<any>, ...collections: any[]) => this
>mergeIn : (keyPath: Iterable<any>, ...collections: Array<any>) => this
>keyPath : Iterable<any>
>collections : any[]
mergeDeepIn(keyPath: Iterable<any>, ...collections: Array<any>): this;
>mergeDeepIn : (keyPath: Iterable<any>, ...collections: any[]) => this
>mergeDeepIn : (keyPath: Iterable<any>, ...collections: Array<any>) => this
>keyPath : Iterable<any>
>collections : any[]
@@ -1143,28 +1143,28 @@ declare module Immutable {
>Seq : any
function of<T>(...values: Array<T>): Seq.Indexed<T>;
>of : <T>(...values: T[]) => Indexed<T>
>of : <T>(...values: Array<T>) => Seq.Indexed<T>
>values : T[]
>Seq : any
export module Keyed {}
export function Keyed<K, V>(collection: Iterable<[K, V]>): Seq.Keyed<K, V>;
>Keyed : { <K, V>(collection: Iterable<[K, V]>): Keyed<K, V>; <V>(obj: { [key: string]: V; }): Keyed<string, V>; <K, V>(): Keyed<K, V>; (): Keyed<any, any>; }
>Keyed : { <K, V>(collection: Iterable<[K, V]>): Seq.Keyed<K, V>; <V>(obj: { [key: string]: V; }): Keyed<string, V>; <K, V>(): Keyed<K, V>; (): Keyed<any, any>; }
>collection : Iterable<[K, V]>
>Seq : any
export function Keyed<V>(obj: {[key: string]: V}): Seq.Keyed<string, V>;
>Keyed : { <K, V>(collection: Iterable<[K, V]>): Keyed<K, V>; <V>(obj: { [key: string]: V; }): Keyed<string, V>; <K, V>(): Keyed<K, V>; (): Keyed<any, any>; }
>Keyed : { <K, V>(collection: Iterable<[K, V]>): Keyed<K, V>; <V>(obj: { [key: string]: V; }): Seq.Keyed<string, V>; <K, V>(): Keyed<K, V>; (): Keyed<any, any>; }
>obj : { [key: string]: V; }
>key : string
>Seq : any
export function Keyed<K, V>(): Seq.Keyed<K, V>;
>Keyed : { <K, V>(collection: Iterable<[K, V]>): Keyed<K, V>; <V>(obj: { [key: string]: V; }): Keyed<string, V>; <K, V>(): Keyed<K, V>; (): Keyed<any, any>; }
>Keyed : { <K, V>(collection: Iterable<[K, V]>): Keyed<K, V>; <V>(obj: { [key: string]: V; }): Keyed<string, V>; <K, V>(): Seq.Keyed<K, V>; (): Keyed<any, any>; }
>Seq : any
export function Keyed(): Seq.Keyed<any, any>;
>Keyed : { <K, V>(collection: Iterable<[K, V]>): Keyed<K, V>; <V>(obj: { [key: string]: V; }): Keyed<string, V>; <K, V>(): Keyed<K, V>; (): Keyed<any, any>; }
>Keyed : { <K, V>(collection: Iterable<[K, V]>): Keyed<K, V>; <V>(obj: { [key: string]: V; }): Keyed<string, V>; <K, V>(): Keyed<K, V>; (): Seq.Keyed<any, any>; }
>Seq : any
export interface Keyed<K, V> extends Seq<K, V>, Collection.Keyed<K, V> {
@@ -1181,18 +1181,18 @@ declare module Immutable {
>toSeq : () => this
concat<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): Seq.Keyed<K | KC, V | VC>;
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): Keyed<K | KC, V | VC>; <C>(...collections: { [key: string]: C; }[]): Keyed<string | K, V | C>; }
>concat : { <KC, VC>(...collections: Array<Iterable<[KC, VC]>>): Seq.Keyed<K | KC, V | VC>; <C>(...collections: { [key: string]: C; }[]): Keyed<string | K, V | C>; }
>collections : Iterable<[KC, VC]>[]
>Seq : any
concat<C>(...collections: Array<{[key: string]: C}>): Seq.Keyed<K | string, V | C>;
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): Keyed<K | KC, V | VC>; <C>(...collections: { [key: string]: C; }[]): Keyed<string | K, V | C>; }
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): Keyed<K | KC, V | VC>; <C>(...collections: { [key: string]: C; }[]): Seq.Keyed<K | string, V | C>; }
>collections : { [key: string]: C; }[]
>key : string
>Seq : any
map<M>(mapper: (value: V, key: K, iter: this) => M, context?: any): Seq.Keyed<K, M>;
>map : <M>(mapper: (value: V, key: K, iter: this) => M, context?: any) => Keyed<K, M>
>map : <M>(mapper: (value: V, key: K, iter: this) => M, context?: any) => Seq.Keyed<K, M>
>mapper : (value: V, key: K, iter: this) => M
>value : V
>key : K
@@ -1201,7 +1201,7 @@ declare module Immutable {
>Seq : any
mapKeys<M>(mapper: (key: K, value: V, iter: this) => M, context?: any): Seq.Keyed<M, V>;
>mapKeys : <M>(mapper: (key: K, value: V, iter: this) => M, context?: any) => Keyed<M, V>
>mapKeys : <M>(mapper: (key: K, value: V, iter: this) => M, context?: any) => Seq.Keyed<M, V>
>mapper : (key: K, value: V, iter: this) => M
>key : K
>value : V
@@ -1210,7 +1210,7 @@ declare module Immutable {
>Seq : any
mapEntries<KM, VM>(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): Seq.Keyed<KM, VM>;
>mapEntries : <KM, VM>(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any) => Keyed<KM, VM>
>mapEntries : <KM, VM>(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any) => Seq.Keyed<KM, VM>
>mapper : (entry: [K, V], index: number, iter: this) => [KM, VM]
>entry : [K, V]
>index : number
@@ -1219,7 +1219,7 @@ declare module Immutable {
>Seq : any
flatMap<M>(mapper: (value: V, key: K, iter: this) => Iterable<M>, context?: any): Seq.Keyed<any, any>;
>flatMap : <M>(mapper: (value: V, key: K, iter: this) => Iterable<M>, context?: any) => Keyed<any, any>
>flatMap : <M>(mapper: (value: V, key: K, iter: this) => Iterable<M>, context?: any) => Seq.Keyed<any, any>
>mapper : (value: V, key: K, iter: this) => Iterable<M>
>value : V
>key : K
@@ -1228,7 +1228,7 @@ declare module Immutable {
>Seq : any
filter<F extends V>(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Seq.Keyed<K, F>;
>filter : { <F extends V>(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Keyed<K, F>; (predicate: (value: V, key: K, iter: this) => any, context?: any): this; }
>filter : { <F extends V>(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Seq.Keyed<K, F>; (predicate: (value: V, key: K, iter: this) => any, context?: any): this; }
>predicate : (value: V, key: K, iter: this) => value is F
>value : V
>key : K
@@ -1248,7 +1248,7 @@ declare module Immutable {
>Indexed : typeof Indexed
function of<T>(...values: Array<T>): Seq.Indexed<T>;
>of : <T>(...values: T[]) => Indexed<T>
>of : <T>(...values: Array<T>) => Seq.Indexed<T>
>values : T[]
>Seq : any
}
@@ -1269,21 +1269,21 @@ declare module Immutable {
>Collection : typeof Collection
toJS(): Array<any>;
>toJS : () => any[]
>toJS : () => Array<any>
toJSON(): Array<T>;
>toJSON : () => T[]
>toJSON : () => Array<T>
toSeq(): this;
>toSeq : () => this
concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): Seq.Indexed<T | C>;
>concat : <C>(...valuesOrCollections: (C | Iterable<C>)[]) => Indexed<T | C>
>concat : <C>(...valuesOrCollections: Array<Iterable<C> | C>) => Seq.Indexed<T | C>
>valuesOrCollections : (C | Iterable<C>)[]
>Seq : any
map<M>(mapper: (value: T, key: number, iter: this) => M, context?: any): Seq.Indexed<M>;
>map : <M>(mapper: (value: T, key: number, iter: this) => M, context?: any) => Indexed<M>
>map : <M>(mapper: (value: T, key: number, iter: this) => M, context?: any) => Seq.Indexed<M>
>mapper : (value: T, key: number, iter: this) => M
>value : T
>key : number
@@ -1292,7 +1292,7 @@ declare module Immutable {
>Seq : any
flatMap<M>(mapper: (value: T, key: number, iter: this) => Iterable<M>, context?: any): Seq.Indexed<M>;
>flatMap : <M>(mapper: (value: T, key: number, iter: this) => Iterable<M>, context?: any) => Indexed<M>
>flatMap : <M>(mapper: (value: T, key: number, iter: this) => Iterable<M>, context?: any) => Seq.Indexed<M>
>mapper : (value: T, key: number, iter: this) => Iterable<M>
>value : T
>key : number
@@ -1301,7 +1301,7 @@ declare module Immutable {
>Seq : any
filter<F extends T>(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Seq.Indexed<F>;
>filter : { <F extends T>(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Indexed<F>; (predicate: (value: T, index: number, iter: this) => any, context?: any): this; }
>filter : { <F extends T>(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Seq.Indexed<F>; (predicate: (value: T, index: number, iter: this) => any, context?: any): this; }
>predicate : (value: T, index: number, iter: this) => value is F
>value : T
>index : number
@@ -1321,7 +1321,7 @@ declare module Immutable {
>Set : typeof Set
function of<T>(...values: Array<T>): Seq.Set<T>;
>of : <T>(...values: T[]) => Set<T>
>of : <T>(...values: Array<T>) => Seq.Set<T>
>values : T[]
>Seq : any
}
@@ -1342,21 +1342,21 @@ declare module Immutable {
>Collection : typeof Collection
toJS(): Array<any>;
>toJS : () => any[]
>toJS : () => Array<any>
toJSON(): Array<T>;
>toJSON : () => T[]
>toJSON : () => Array<T>
toSeq(): this;
>toSeq : () => this
concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): Seq.Set<T | C>;
>concat : <C>(...valuesOrCollections: (C | Iterable<C>)[]) => Set<T | C>
>concat : <C>(...valuesOrCollections: Array<Iterable<C> | C>) => Seq.Set<T | C>
>valuesOrCollections : (C | Iterable<C>)[]
>Seq : any
map<M>(mapper: (value: T, key: never, iter: this) => M, context?: any): Seq.Set<M>;
>map : <M>(mapper: (value: T, key: never, iter: this) => M, context?: any) => Set<M>
>map : <M>(mapper: (value: T, key: never, iter: this) => M, context?: any) => Seq.Set<M>
>mapper : (value: T, key: never, iter: this) => M
>value : T
>key : never
@@ -1365,7 +1365,7 @@ declare module Immutable {
>Seq : any
flatMap<M>(mapper: (value: T, key: never, iter: this) => Iterable<M>, context?: any): Seq.Set<M>;
>flatMap : <M>(mapper: (value: T, key: never, iter: this) => Iterable<M>, context?: any) => Set<M>
>flatMap : <M>(mapper: (value: T, key: never, iter: this) => Iterable<M>, context?: any) => Seq.Set<M>
>mapper : (value: T, key: never, iter: this) => Iterable<M>
>value : T
>key : never
@@ -1374,7 +1374,7 @@ declare module Immutable {
>Seq : any
filter<F extends T>(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Seq.Set<F>;
>filter : { <F extends T>(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Set<F>; (predicate: (value: T, key: never, iter: this) => any, context?: any): this; }
>filter : { <F extends T>(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Seq.Set<F>; (predicate: (value: T, key: never, iter: this) => any, context?: any): this; }
>predicate : (value: T, key: never, iter: this) => value is F
>value : T
>key : never
@@ -1493,12 +1493,12 @@ declare module Immutable {
export module Keyed {}
export function Keyed<K, V>(collection: Iterable<[K, V]>): Collection.Keyed<K, V>;
>Keyed : { <K, V>(collection: Iterable<[K, V]>): Keyed<K, V>; <V>(obj: { [key: string]: V; }): Keyed<string, V>; }
>Keyed : { <K, V>(collection: Iterable<[K, V]>): Collection.Keyed<K, V>; <V>(obj: { [key: string]: V; }): Keyed<string, V>; }
>collection : Iterable<[K, V]>
>Collection : any
export function Keyed<V>(obj: {[key: string]: V}): Collection.Keyed<string, V>;
>Keyed : { <K, V>(collection: Iterable<[K, V]>): Keyed<K, V>; <V>(obj: { [key: string]: V; }): Keyed<string, V>; }
>Keyed : { <K, V>(collection: Iterable<[K, V]>): Keyed<K, V>; <V>(obj: { [key: string]: V; }): Collection.Keyed<string, V>; }
>obj : { [key: string]: V; }
>key : string
>Collection : any
@@ -1520,18 +1520,18 @@ declare module Immutable {
>flip : () => this
concat<KC, VC>(...collections: Array<Iterable<[KC, VC]>>): Collection.Keyed<K | KC, V | VC>;
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): Keyed<K | KC, V | VC>; <C>(...collections: { [key: string]: C; }[]): Keyed<string | K, V | C>; }
>concat : { <KC, VC>(...collections: Array<Iterable<[KC, VC]>>): Collection.Keyed<K | KC, V | VC>; <C>(...collections: { [key: string]: C; }[]): Keyed<string | K, V | C>; }
>collections : Iterable<[KC, VC]>[]
>Collection : any
concat<C>(...collections: Array<{[key: string]: C}>): Collection.Keyed<K | string, V | C>;
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): Keyed<K | KC, V | VC>; <C>(...collections: { [key: string]: C; }[]): Keyed<string | K, V | C>; }
>concat : { <KC, VC>(...collections: Iterable<[KC, VC]>[]): Keyed<K | KC, V | VC>; <C>(...collections: { [key: string]: C; }[]): Collection.Keyed<K | string, V | C>; }
>collections : { [key: string]: C; }[]
>key : string
>Collection : any
map<M>(mapper: (value: V, key: K, iter: this) => M, context?: any): Collection.Keyed<K, M>;
>map : <M>(mapper: (value: V, key: K, iter: this) => M, context?: any) => Keyed<K, M>
>map : <M>(mapper: (value: V, key: K, iter: this) => M, context?: any) => Collection.Keyed<K, M>
>mapper : (value: V, key: K, iter: this) => M
>value : V
>key : K
@@ -1540,7 +1540,7 @@ declare module Immutable {
>Collection : any
mapKeys<M>(mapper: (key: K, value: V, iter: this) => M, context?: any): Collection.Keyed<M, V>;
>mapKeys : <M>(mapper: (key: K, value: V, iter: this) => M, context?: any) => Keyed<M, V>
>mapKeys : <M>(mapper: (key: K, value: V, iter: this) => M, context?: any) => Collection.Keyed<M, V>
>mapper : (key: K, value: V, iter: this) => M
>key : K
>value : V
@@ -1549,7 +1549,7 @@ declare module Immutable {
>Collection : any
mapEntries<KM, VM>(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): Collection.Keyed<KM, VM>;
>mapEntries : <KM, VM>(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any) => Keyed<KM, VM>
>mapEntries : <KM, VM>(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any) => Collection.Keyed<KM, VM>
>mapper : (entry: [K, V], index: number, iter: this) => [KM, VM]
>entry : [K, V]
>index : number
@@ -1558,7 +1558,7 @@ declare module Immutable {
>Collection : any
flatMap<M>(mapper: (value: V, key: K, iter: this) => Iterable<M>, context?: any): Collection.Keyed<any, any>;
>flatMap : <M>(mapper: (value: V, key: K, iter: this) => Iterable<M>, context?: any) => Keyed<any, any>
>flatMap : <M>(mapper: (value: V, key: K, iter: this) => Iterable<M>, context?: any) => Collection.Keyed<any, any>
>mapper : (value: V, key: K, iter: this) => Iterable<M>
>value : V
>key : K
@@ -1567,7 +1567,7 @@ declare module Immutable {
>Collection : any
filter<F extends V>(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Collection.Keyed<K, F>;
>filter : { <F extends V>(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Keyed<K, F>; (predicate: (value: V, key: K, iter: this) => any, context?: any): this; }
>filter : { <F extends V>(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Collection.Keyed<K, F>; (predicate: (value: V, key: K, iter: this) => any, context?: any): this; }
>predicate : (value: V, key: K, iter: this) => value is F
>value : V
>key : K
@@ -1591,16 +1591,16 @@ declare module Immutable {
}
export module Indexed {}
export function Indexed<T>(collection: Iterable<T>): Collection.Indexed<T>;
>Indexed : <T>(collection: Iterable<T>) => Indexed<T>
>Indexed : <T>(collection: Iterable<T>) => Collection.Indexed<T>
>collection : Iterable<T>
>Collection : any
export interface Indexed<T> extends Collection<number, T> {
toJS(): Array<any>;
>toJS : () => any[]
>toJS : () => Array<any>
toJSON(): Array<T>;
>toJSON : () => T[]
>toJSON : () => Array<T>
// Reading values
get<NSV>(index: number, notSetValue: NSV): T | NSV;
@@ -1609,7 +1609,7 @@ declare module Immutable {
>notSetValue : NSV
get(index: number): T | undefined;
>get : { <NSV>(index: number, notSetValue: NSV): T | NSV; (index: number): T; }
>get : { <NSV>(index: number, notSetValue: NSV): T | NSV; (index: number): T | undefined; }
>index : number
// Conversion to Seq
@@ -1627,22 +1627,22 @@ declare module Immutable {
>separator : T
interleave(...collections: Array<Collection<any, T>>): this;
>interleave : (...collections: Collection<any, T>[]) => this
>interleave : (...collections: Array<Collection<any, T>>) => this
>collections : Collection<any, T>[]
splice(index: number, removeNum: number, ...values: Array<T>): this;
>splice : (index: number, removeNum: number, ...values: T[]) => this
>splice : (index: number, removeNum: number, ...values: Array<T>) => this
>index : number
>removeNum : number
>values : T[]
zip(...collections: Array<Collection<any, any>>): Collection.Indexed<any>;
>zip : (...collections: Collection<any, any>[]) => Indexed<any>
>zip : (...collections: Array<Collection<any, any>>) => Collection.Indexed<any>
>collections : Collection<any, any>[]
>Collection : any
zipWith<U, Z>(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection<any, U>): Collection.Indexed<Z>;
>zipWith : { <U, Z>(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection<any, U>): Indexed<Z>; <U, V, Z>(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection<any, U>, thirdCollection: Collection<any, V>): Indexed<Z>; <Z>(zipper: (...any: any[]) => Z, ...collections: Collection<any, any>[]): Indexed<Z>; }
>zipWith : { <U, Z>(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection<any, U>): Collection.Indexed<Z>; <U, V, Z>(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection<any, U>, thirdCollection: Collection<any, V>): Indexed<Z>; <Z>(zipper: (...any: any[]) => Z, ...collections: Collection<any, any>[]): Indexed<Z>; }
>zipper : (value: T, otherValue: U) => Z
>value : T
>otherValue : U
@@ -1650,7 +1650,7 @@ declare module Immutable {
>Collection : any
zipWith<U, V, Z>(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection<any, U>, thirdCollection: Collection<any, V>): Collection.Indexed<Z>;
>zipWith : { <U, Z>(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection<any, U>): Indexed<Z>; <U, V, Z>(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection<any, U>, thirdCollection: Collection<any, V>): Indexed<Z>; <Z>(zipper: (...any: any[]) => Z, ...collections: Collection<any, any>[]): Indexed<Z>; }
>zipWith : { <U, Z>(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection<any, U>): Indexed<Z>; <U, V, Z>(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection<any, U>, thirdCollection: Collection<any, V>): Collection.Indexed<Z>; <Z>(zipper: (...any: any[]) => Z, ...collections: Collection<any, any>[]): Indexed<Z>; }
>zipper : (value: T, otherValue: U, thirdValue: V) => Z
>value : T
>otherValue : U
@@ -1660,8 +1660,8 @@ declare module Immutable {
>Collection : any
zipWith<Z>(zipper: (...any: Array<any>) => Z, ...collections: Array<Collection<any, any>>): Collection.Indexed<Z>;
>zipWith : { <U, Z>(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection<any, U>): Indexed<Z>; <U, V, Z>(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection<any, U>, thirdCollection: Collection<any, V>): Indexed<Z>; <Z>(zipper: (...any: any[]) => Z, ...collections: Collection<any, any>[]): Indexed<Z>; }
>zipper : (...any: any[]) => Z
>zipWith : { <U, Z>(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection<any, U>): Indexed<Z>; <U, V, Z>(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection<any, U>, thirdCollection: Collection<any, V>): Indexed<Z>; <Z>(zipper: (...any: Array<any>) => Z, ...collections: Array<Collection<any, any>>): Collection.Indexed<Z>; }
>zipper : (...any: Array<any>) => Z
>any : any[]
>collections : Collection<any, any>[]
>Collection : any
@@ -1693,12 +1693,12 @@ declare module Immutable {
// Sequence algorithms
concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): Collection.Indexed<T | C>;
>concat : <C>(...valuesOrCollections: (C | Iterable<C>)[]) => Indexed<T | C>
>concat : <C>(...valuesOrCollections: Array<Iterable<C> | C>) => Collection.Indexed<T | C>
>valuesOrCollections : (C | Iterable<C>)[]
>Collection : any
map<M>(mapper: (value: T, key: number, iter: this) => M, context?: any): Collection.Indexed<M>;
>map : <M>(mapper: (value: T, key: number, iter: this) => M, context?: any) => Indexed<M>
>map : <M>(mapper: (value: T, key: number, iter: this) => M, context?: any) => Collection.Indexed<M>
>mapper : (value: T, key: number, iter: this) => M
>value : T
>key : number
@@ -1707,7 +1707,7 @@ declare module Immutable {
>Collection : any
flatMap<M>(mapper: (value: T, key: number, iter: this) => Iterable<M>, context?: any): Collection.Indexed<M>;
>flatMap : <M>(mapper: (value: T, key: number, iter: this) => Iterable<M>, context?: any) => Indexed<M>
>flatMap : <M>(mapper: (value: T, key: number, iter: this) => Iterable<M>, context?: any) => Collection.Indexed<M>
>mapper : (value: T, key: number, iter: this) => Iterable<M>
>value : T
>key : number
@@ -1716,7 +1716,7 @@ declare module Immutable {
>Collection : any
filter<F extends T>(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Collection.Indexed<F>;
>filter : { <F extends T>(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Indexed<F>; (predicate: (value: T, index: number, iter: this) => any, context?: any): this; }
>filter : { <F extends T>(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Collection.Indexed<F>; (predicate: (value: T, index: number, iter: this) => any, context?: any): this; }
>predicate : (value: T, index: number, iter: this) => value is F
>value : T
>index : number
@@ -1740,16 +1740,16 @@ declare module Immutable {
}
export module Set {}
export function Set<T>(collection: Iterable<T>): Collection.Set<T>;
>Set : <T>(collection: Iterable<T>) => Set<T>
>Set : <T>(collection: Iterable<T>) => Collection.Set<T>
>collection : Iterable<T>
>Collection : any
export interface Set<T> extends Collection<never, T> {
toJS(): Array<any>;
>toJS : () => any[]
>toJS : () => Array<any>
toJSON(): Array<T>;
>toJSON : () => T[]
>toJSON : () => Array<T>
toSeq(): Seq.Set<T>;
>toSeq : () => Seq.Set<T>
@@ -1757,12 +1757,12 @@ declare module Immutable {
// Sequence algorithms
concat<C>(...valuesOrCollections: Array<Iterable<C> | C>): Collection.Set<T | C>;
>concat : <C>(...valuesOrCollections: (C | Iterable<C>)[]) => Set<T | C>
>concat : <C>(...valuesOrCollections: Array<Iterable<C> | C>) => Collection.Set<T | C>
>valuesOrCollections : (C | Iterable<C>)[]
>Collection : any
map<M>(mapper: (value: T, key: never, iter: this) => M, context?: any): Collection.Set<M>;
>map : <M>(mapper: (value: T, key: never, iter: this) => M, context?: any) => Set<M>
>map : <M>(mapper: (value: T, key: never, iter: this) => M, context?: any) => Collection.Set<M>
>mapper : (value: T, key: never, iter: this) => M
>value : T
>key : never
@@ -1771,7 +1771,7 @@ declare module Immutable {
>Collection : any
flatMap<M>(mapper: (value: T, key: never, iter: this) => Iterable<M>, context?: any): Collection.Set<M>;
>flatMap : <M>(mapper: (value: T, key: never, iter: this) => Iterable<M>, context?: any) => Set<M>
>flatMap : <M>(mapper: (value: T, key: never, iter: this) => Iterable<M>, context?: any) => Collection.Set<M>
>mapper : (value: T, key: never, iter: this) => Iterable<M>
>value : T
>key : never
@@ -1780,7 +1780,7 @@ declare module Immutable {
>Collection : any
filter<F extends T>(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Collection.Set<F>;
>filter : { <F extends T>(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Set<F>; (predicate: (value: T, key: never, iter: this) => any, context?: any): this; }
>filter : { <F extends T>(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Collection.Set<F>; (predicate: (value: T, key: never, iter: this) => any, context?: any): this; }
>predicate : (value: T, key: never, iter: this) => value is F
>value : T
>key : never
@@ -1834,7 +1834,7 @@ declare module Immutable {
>notSetValue : NSV
get(key: K): V | undefined;
>get : { <NSV>(key: K, notSetValue: NSV): V | NSV; (key: K): V; }
>get : { <NSV>(key: K, notSetValue: NSV): V | NSV; (key: K): V | undefined; }
>key : K
has(key: K): boolean;
@@ -1850,10 +1850,10 @@ declare module Immutable {
>value : V
first(): V | undefined;
>first : () => V
>first : () => V | undefined
last(): V | undefined;
>last : () => V
>last : () => V | undefined
// Reading deep values
getIn(searchKeyPath: Iterable<any>, notSetValue?: any): any;
@@ -1881,7 +1881,7 @@ declare module Immutable {
>key : string
toArray(): Array<V>;
>toArray : () => V[]
>toArray : () => Array<V>
toObject(): { [key: string]: V };
>toObject : () => { [key: string]: V; }
@@ -2077,7 +2077,7 @@ declare module Immutable {
// Combination
concat(...valuesOrCollections: Array<any>): Collection<any, any>;
>concat : (...valuesOrCollections: any[]) => Collection<any, any>
>concat : (...valuesOrCollections: Array<any>) => Collection<any, any>
>valuesOrCollections : any[]
flatten(depth?: number): Collection<any, any>;
@@ -2177,7 +2177,7 @@ declare module Immutable {
// Search for value
find(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): V | undefined;
>find : (predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V) => V
>find : (predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V) => V | undefined
>predicate : (value: V, key: K, iter: this) => boolean
>value : V
>key : K
@@ -2186,7 +2186,7 @@ declare module Immutable {
>notSetValue : V
findLast(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): V | undefined;
>findLast : (predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V) => V
>findLast : (predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V) => V | undefined
>predicate : (value: V, key: K, iter: this) => boolean
>value : V
>key : K
@@ -2195,7 +2195,7 @@ declare module Immutable {
>notSetValue : V
findEntry(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): [K, V] | undefined;
>findEntry : (predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V) => [K, V]
>findEntry : (predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V) => [K, V] | undefined
>predicate : (value: V, key: K, iter: this) => boolean
>value : V
>key : K
@@ -2204,7 +2204,7 @@ declare module Immutable {
>notSetValue : V
findLastEntry(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): [K, V] | undefined;
>findLastEntry : (predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V) => [K, V]
>findLastEntry : (predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V) => [K, V] | undefined
>predicate : (value: V, key: K, iter: this) => boolean
>value : V
>key : K
@@ -2213,7 +2213,7 @@ declare module Immutable {
>notSetValue : V
findKey(predicate: (value: V, key: K, iter: this) => boolean, context?: any): K | undefined;
>findKey : (predicate: (value: V, key: K, iter: this) => boolean, context?: any) => K
>findKey : (predicate: (value: V, key: K, iter: this) => boolean, context?: any) => K | undefined
>predicate : (value: V, key: K, iter: this) => boolean
>value : V
>key : K
@@ -2221,7 +2221,7 @@ declare module Immutable {
>context : any
findLastKey(predicate: (value: V, key: K, iter: this) => boolean, context?: any): K | undefined;
>findLastKey : (predicate: (value: V, key: K, iter: this) => boolean, context?: any) => K
>findLastKey : (predicate: (value: V, key: K, iter: this) => boolean, context?: any) => K | undefined
>predicate : (value: V, key: K, iter: this) => boolean
>value : V
>key : K
@@ -2229,21 +2229,21 @@ declare module Immutable {
>context : any
keyOf(searchValue: V): K | undefined;
>keyOf : (searchValue: V) => K
>keyOf : (searchValue: V) => K | undefined
>searchValue : V
lastKeyOf(searchValue: V): K | undefined;
>lastKeyOf : (searchValue: V) => K
>lastKeyOf : (searchValue: V) => K | undefined
>searchValue : V
max(comparator?: (valueA: V, valueB: V) => number): V | undefined;
>max : (comparator?: (valueA: V, valueB: V) => number) => V
>max : (comparator?: (valueA: V, valueB: V) => number) => V | undefined
>comparator : (valueA: V, valueB: V) => number
>valueA : V
>valueB : V
maxBy<C>(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): V | undefined;
>maxBy : <C>(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number) => V
>maxBy : <C>(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number) => V | undefined
>comparatorValueMapper : (value: V, key: K, iter: this) => C
>value : V
>key : K
@@ -2253,13 +2253,13 @@ declare module Immutable {
>valueB : C
min(comparator?: (valueA: V, valueB: V) => number): V | undefined;
>min : (comparator?: (valueA: V, valueB: V) => number) => V
>min : (comparator?: (valueA: V, valueB: V) => number) => V | undefined
>comparator : (valueA: V, valueB: V) => number
>valueA : V
>valueB : V
minBy<C>(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): V | undefined;
>minBy : <C>(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number) => V
>minBy : <C>(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number) => V | undefined
>comparatorValueMapper : (value: V, key: K, iter: this) => C
>value : V
>key : K
@@ -53,7 +53,7 @@ export type NewChannel<T extends Channel> = Pick<T, 'type'> &
export function makeNewChannel<T extends ChannelType>(type: T): NewChannel<ChannelOfType<T>> {
>makeNewChannel : <T extends "text" | "email">(type: T) => NewChannel<ChannelOfType<T, TextChannel> | ChannelOfType<T, EmailChannel>>
>makeNewChannel : <T extends "text" | "email">(type: T) => NewChannel<ChannelOfType<T>>
>type : T
const localChannelId = `blahblahblah`;
@@ -12,7 +12,7 @@ interface FormikConfig<Values> {
}
declare function Func<Values = object, ExtraProps = {}>(
>Func : <Values = object, ExtraProps = {}>(x: string extends keyof ExtraProps | "validate" | "initialValues" ? Readonly<FormikConfig<Values> & ExtraProps> : Pick<Readonly<FormikConfig<Values> & ExtraProps>, Exclude<keyof ExtraProps, "validateOnChange"> | "validate" | "initialValues"> & Partial<Pick<Readonly<FormikConfig<Values> & ExtraProps>, "validateOnChange" | Extract<keyof ExtraProps, "validateOnChange">>>) => void
>Func : <Values = object, ExtraProps = {}>(x: (string extends "validate" | "initialValues" | keyof ExtraProps ? Readonly<FormikConfig<Values> & ExtraProps> : Pick<Readonly<FormikConfig<Values> & ExtraProps>, "validate" | "initialValues" | Exclude<keyof ExtraProps, "validateOnChange">> & Partial<Pick<Readonly<FormikConfig<Values> & ExtraProps>, "validateOnChange" | Extract<keyof ExtraProps, "validateOnChange">>>)) => void
x: (string extends "validate" | "initialValues" | keyof ExtraProps
>x : string extends keyof ExtraProps | "validate" | "initialValues" ? Readonly<FormikConfig<Values> & ExtraProps> : Pick<Readonly<FormikConfig<Values> & ExtraProps>, Exclude<keyof ExtraProps, "validateOnChange"> | "validate" | "initialValues"> & Partial<Pick<Readonly<FormikConfig<Values> & ExtraProps>, "validateOnChange" | Extract<keyof ExtraProps, "validateOnChange">>>
@@ -43,7 +43,7 @@ module m1 {
}
export function f2(arg1: { x?: C1, y: number }) {
>f2 : (arg1: { x?: C1; y: number; }) => void
>f2 : (arg1: { x?: C1; y: number;}) => void
>arg1 : { x?: C1; y: number; }
>x : C1
>y : number
@@ -61,7 +61,7 @@ module m1 {
}
export function f4(arg1:
>f4 : (arg1: {}) => void
>f4 : (arg1: { [number]: C1;}) => void
>arg1 : {}
{
[number]: C1; // Used to be indexer, now it is a computed property
@@ -49,32 +49,32 @@ let [{[foo2()]: bar5}] = [{bar: "bar"}];
>"bar" : "bar"
function f1({["bar"]: x}: { bar: number }) {}
>f1 : ({ ["bar"]: x }: { bar: number; }) => void
>f1 : ({ ["bar"]: x }: { bar: number;}) => void
>"bar" : "bar"
>x : number
>bar : number
function f2({[foo]: x}: { bar: number }) {}
>f2 : ({ [foo]: x }: { bar: number; }) => void
>f2 : ({ [foo]: x }: { bar: number;}) => void
>foo : string
>x : any
>bar : number
function f3({[foo2()]: x}: { bar: number }) {}
>f3 : ({ [foo2()]: x }: { bar: number; }) => void
>f3 : ({ [foo2()]: x }: { bar: number;}) => void
>foo2() : string
>foo2 : () => string
>x : any
>bar : number
function f4([{[foo]: x}]: [{ bar: number }]) {}
>f4 : ([{ [foo]: x }]: [{ bar: number; }]) => void
>f4 : ([{ [foo]: x }]: [{ bar: number;}]) => void
>foo : string
>x : any
>bar : number
function f5([{[foo2()]: x}]: [{ bar: number }]) {}
>f5 : ([{ [foo2()]: x }]: [{ bar: number; }]) => void
>f5 : ([{ [foo2()]: x }]: [{ bar: number;}]) => void
>foo2() : string
>foo2 : () => string
>x : any
@@ -56,32 +56,32 @@ let [{[foo2()]: bar5}] = [{bar: "bar"}];
>"bar" : "bar"
function f1({["bar"]: x}: { bar: number }) {}
>f1 : ({ ["bar"]: x }: { bar: number; }) => void
>f1 : ({ ["bar"]: x }: { bar: number;}) => void
>"bar" : "bar"
>x : number
>bar : number
function f2({[foo]: x}: { bar: number }) {}
>f2 : ({ [foo]: x }: { bar: number; }) => void
>f2 : ({ [foo]: x }: { bar: number;}) => void
>foo : string
>x : any
>bar : number
function f3({[foo2()]: x}: { bar: number }) {}
>f3 : ({ [foo2()]: x }: { bar: number; }) => void
>f3 : ({ [foo2()]: x }: { bar: number;}) => void
>foo2() : string
>foo2 : () => string
>x : any
>bar : number
function f4([{[foo]: x}]: [{ bar: number }]) {}
>f4 : ([{ [foo]: x }]: [{ bar: number; }]) => void
>f4 : ([{ [foo]: x }]: [{ bar: number;}]) => void
>foo : string
>x : any
>bar : number
function f5([{[foo2()]: x}]: [{ bar: number }]) {}
>f5 : ([{ [foo2()]: x }]: [{ bar: number; }]) => void
>f5 : ([{ [foo2()]: x }]: [{ bar: number;}]) => void
>foo2() : string
>foo2 : () => string
>x : any
@@ -110,7 +110,7 @@ var result6: (t: X) => boolean = true ? (m) => m.propertyX1 : (n) => n.propertyX
>propertyX2 : string
var result61: (t: X) => number| string = true ? (m) => m.propertyX1 : (n) => n.propertyX2;
>result61 : (t: X) => string | number
>result61 : (t: X) => number | string
>t : X
>true ? (m) => m.propertyX1 : (n) => n.propertyX2 : ((m: X) => number) | ((n: X) => string)
>true : true
@@ -90,12 +90,12 @@ export enum PubSubRecordIsStoredInRedisAsA {
>storedAs : any
storedAsJsonEncodedRedisString: () => BuildPubSubRecordType<SO_FAR & {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString}>;
>storedAsJsonEncodedRedisString : () => BuildPubSubRecordType<SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString; }>
>storedAsJsonEncodedRedisString : () => BuildPubSubRecordType<SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString;}>
>storedAs : PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString
>PubSubRecordIsStoredInRedisAsA : any
storedRedisHash: () => BuildPubSubRecordType<SO_FAR & {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash}>;
>storedRedisHash : () => BuildPubSubRecordType<SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA.redisHash; }>
>storedRedisHash : () => BuildPubSubRecordType<SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA.redisHash;}>
>storedAs : PubSubRecordIsStoredInRedisAsA.redisHash
>PubSubRecordIsStoredInRedisAsA : any
}
@@ -286,12 +286,12 @@ export enum PubSubRecordIsStoredInRedisAsA {
>maxMsToWaitBeforePublishing : any
maxMsToWaitBeforePublishing: (t: number) => BuildPubSubRecordType<SO_FAR & {maxMsToWaitBeforePublishing: number}>,
>maxMsToWaitBeforePublishing : (t: number) => BuildPubSubRecordType<SO_FAR & { maxMsToWaitBeforePublishing: number; }>
>maxMsToWaitBeforePublishing : (t: number) => BuildPubSubRecordType<SO_FAR & { maxMsToWaitBeforePublishing: number;}>
>t : number
>maxMsToWaitBeforePublishing : number
neverDelayPublishing: () => BuildPubSubRecordType<SO_FAR & {maxMsToWaitBeforePublishing: 0}>,
>neverDelayPublishing : () => BuildPubSubRecordType<SO_FAR & { maxMsToWaitBeforePublishing: 0; }>
>neverDelayPublishing : () => BuildPubSubRecordType<SO_FAR & { maxMsToWaitBeforePublishing: 0;}>
>maxMsToWaitBeforePublishing : 0
}
@@ -135,7 +135,7 @@ type T15 = Extract<Options, { q: "a" }>; // never
>q : "a"
declare function f5<T extends Options, K extends string>(p: K): Extract<T, { k: K }>;
>f5 : <T extends Options, K extends string>(p: K) => Extract<T, { k: K; }>
>f5 : <T extends Options, K extends string>(p: K) => Extract<T, { k: K;}>
>p : K
>k : K
@@ -245,7 +245,7 @@ type T31 = NonFunctionProperties<Part>;
>T31 : Pick<Part, "id" | "name" | "subparts">
function f7<T>(x: T, y: FunctionProperties<T>, z: NonFunctionProperties<T>) {
>f7 : <T>(x: T, y: Pick<T, { [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]>, z: Pick<T, { [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]>) => void
>f7 : <T>(x: T, y: FunctionProperties<T>, z: NonFunctionProperties<T>) => void
>x : T
>y : Pick<T, { [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]>
>z : Pick<T, { [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]>
@@ -282,7 +282,7 @@ function f7<T>(x: T, y: FunctionProperties<T>, z: NonFunctionProperties<T>) {
}
function f8<T>(x: keyof T, y: FunctionPropertyNames<T>, z: NonFunctionPropertyNames<T>) {
>f8 : <T>(x: keyof T, y: { [K in keyof T]: T[K] extends Function ? K : never; }[keyof T], z: { [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]) => void
>f8 : <T>(x: keyof T, y: FunctionPropertyNames<T>, z: NonFunctionPropertyNames<T>) => void
>x : keyof T
>y : { [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]
>z : { [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]
@@ -334,7 +334,7 @@ type DeepReadonlyObject<T> = {
};
function f10(part: DeepReadonly<Part>) {
>f10 : (part: DeepReadonlyObject<Part>) => void
>f10 : (part: DeepReadonly<Part>) => void
>part : DeepReadonlyObject<Part>
let name: string = part.name;
@@ -149,13 +149,13 @@ type Bar = { bar: string };
>bar : string
declare function fooBar(x: { foo: string, bar: string }): void;
>fooBar : (x: { foo: string; bar: string; }) => void
>fooBar : (x: { foo: string; bar: string;}) => void
>x : { foo: string; bar: string; }
>foo : string
>bar : string
declare function fooBat(x: { foo: string, bat: string }): void;
>fooBat : (x: { foo: string; bat: string; }) => void
>fooBat : (x: { foo: string; bat: string;}) => void
>x : { foo: string; bat: string; }
>foo : string
>bat : string
@@ -449,7 +449,7 @@ const w: What = { a: 4 };
// Repro from #33568
declare function save(_response: IRootResponse<string>): void;
>save : (_response: IResponse<string>) => void
>save : (_response: IRootResponse<string>) => void
>_response : IResponse<string>
exportCommand(save);
@@ -488,7 +488,7 @@ declare type IResponse<T> = {
>IResponse : IResponse<T>
sendValue(name: keyof GetAllPropertiesOfType<T, string>): void;
>sendValue : (name: { [PropertyName in Extract<keyof T, string>]: Required<T>[PropertyName] extends string ? PropertyName : never; }[Extract<keyof T, string>]) => void
>sendValue : (name: keyof GetAllPropertiesOfType<T, string>) => void
>name : { [PropertyName in Extract<keyof T, string>]: Required<T>[PropertyName] extends string ? PropertyName : never; }[Extract<keyof T, string>]
};
@@ -509,7 +509,7 @@ declare type GetAllPropertiesOfType<T, RestrictToType> = Pick<
// Repro from #33568
declare function ff(x: Foo3<string>): void;
>ff : (x: { x: string; }) => void
>ff : (x: Foo3<string>) => void
>x : { x: string; }
declare function gg<T>(f: (x: Foo3<T>) => void): void;
@@ -67,7 +67,7 @@ const fn5 = <Params>(
>params : Pick<Params, ExcludeWithDefault<keyof Params, never, never>>
function fn6<T>(x: ExcludeWithDefault<T, never>) {
>fn6 : <T>(x: ExcludeWithDefault<T, never, never>) => void
>fn6 : <T>(x: ExcludeWithDefault<T, never>) => void
>x : ExcludeWithDefault<T, never, never>
var y: T = x;
@@ -91,7 +91,7 @@ const fn7 = <Params>(
>params : Pick<Params, ExtractWithDefault<keyof Params, keyof Params, never>>
function fn8<T>(x: ExtractWithDefault<T, T>) {
>fn8 : <T>(x: ExtractWithDefault<T, T, never>) => void
>fn8 : <T>(x: ExtractWithDefault<T, T>) => void
>x : ExtractWithDefault<T, T, never>
var y: T = x;
@@ -10,7 +10,7 @@ type Record2<K extends keyof any, T> = {
};
function defaultRecord(x: Record<'a', string>, y: Record<string, string>) {
>defaultRecord : (x: Record<"a", string>, y: Record<string, string>) => void
>defaultRecord : (x: Record<'a', string>, y: Record<string, string>) => void
>x : Record<"a", string>
>y : Record<string, string>
@@ -21,7 +21,7 @@ function defaultRecord(x: Record<'a', string>, y: Record<string, string>) {
}
function customRecord(x: Record2<'a', string>, y: Record2<string, string>) {
>customRecord : (x: Record2<"a", string>, y: Record2<string, string>) => void
>customRecord : (x: Record2<'a', string>, y: Record2<string, string>) => void
>x : Record2<"a", string>
>y : Record2<string, string>
@@ -32,7 +32,7 @@ function customRecord(x: Record2<'a', string>, y: Record2<string, string>) {
}
function mixed1(x: Record2<'a', string>, y: Record<string, string>) {
>mixed1 : (x: Record2<"a", string>, y: Record<string, string>) => void
>mixed1 : (x: Record2<'a', string>, y: Record<string, string>) => void
>x : Record2<"a", string>
>y : Record<string, string>
@@ -43,7 +43,7 @@ function mixed1(x: Record2<'a', string>, y: Record<string, string>) {
}
function mixed2(x: Record<'a', string>, y: Record2<string, string>) {
>mixed2 : (x: Record<"a", string>, y: Record2<string, string>) => void
>mixed2 : (x: Record<'a', string>, y: Record2<string, string>) => void
>x : Record<"a", string>
>y : Record2<string, string>
@@ -54,7 +54,7 @@ function mixed2(x: Record<'a', string>, y: Record2<string, string>) {
}
function defaultRecord2<T>(x: Record<'a', T>, y: Record<string, T>) {
>defaultRecord2 : <T>(x: Record<"a", T>, y: Record<string, T>) => void
>defaultRecord2 : <T>(x: Record<'a', T>, y: Record<string, T>) => void
>x : Record<"a", T>
>y : Record<string, T>
@@ -65,7 +65,7 @@ function defaultRecord2<T>(x: Record<'a', T>, y: Record<string, T>) {
}
function customRecord2<T>(x: Record2<'a', T>, y: Record2<string, T>) {
>customRecord2 : <T>(x: Record2<"a", T>, y: Record2<string, T>) => void
>customRecord2 : <T>(x: Record2<'a', T>, y: Record2<string, T>) => void
>x : Record2<"a", T>
>y : Record2<string, T>
@@ -76,7 +76,7 @@ function customRecord2<T>(x: Record2<'a', T>, y: Record2<string, T>) {
}
function mixed3<T>(x: Record2<'a', T>, y: Record<string, T>) {
>mixed3 : <T>(x: Record2<"a", T>, y: Record<string, T>) => void
>mixed3 : <T>(x: Record2<'a', T>, y: Record<string, T>) => void
>x : Record2<"a", T>
>y : Record<string, T>
@@ -87,7 +87,7 @@ function mixed3<T>(x: Record2<'a', T>, y: Record<string, T>) {
}
function mixed4<T>(x: Record<'a', T>, y: Record2<string, T>) {
>mixed4 : <T>(x: Record<"a", T>, y: Record2<string, T>) => void
>mixed4 : <T>(x: Record<'a', T>, y: Record2<string, T>) => void
>x : Record<"a", T>
>y : Record2<string, T>
+1 -1
View File
@@ -13,7 +13,7 @@ function f1(f: TestType) { }
>f : TestType
function f2(f: TestTypeStr) { }
>f2 : (f: "foo" | "bar") => void
>f2 : (f: TestTypeStr) => void
>f : "foo" | "bar"
f1(TestType.foo)
+1 -1
View File
@@ -545,7 +545,7 @@ function foo(x: Enum1) {
}
function bar(e: A.B.C.E): number {
>bar : (e: I) => number
>bar : (e: A.B.C.E) => number
>e : I
>A : any
>B : any
@@ -19,15 +19,15 @@ class Derived3 extends Base { biz() { } }
>biz : () => void
function foo(tagName: 'canvas'): Derived1;
>foo : { (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; (tagName: string): Base; }
>foo : { (tagName: 'canvas'): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; (tagName: string): Base; }
>tagName : "canvas"
function foo(tagName: 'div'): Derived2;
>foo : { (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; (tagName: string): Base; }
>foo : { (tagName: "canvas"): Derived1; (tagName: 'div'): Derived2; (tagName: "span"): Derived3; (tagName: string): Base; }
>tagName : "div"
function foo(tagName: 'span'): Derived3;
>foo : { (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: "span"): Derived3; (tagName: string): Base; }
>foo : { (tagName: "canvas"): Derived1; (tagName: "div"): Derived2; (tagName: 'span'): Derived3; (tagName: string): Base; }
>tagName : "span"
function foo(tagName: string): Base;
@@ -19,15 +19,15 @@ class Derived3 extends Base { biz() { } }
>biz : () => void
function foo(tagName: 'canvas'): Derived3;
>foo : { (tagName: "canvas"): Derived3; (tagName: "div"): Derived2; (tagName: "span"): Derived1; (tagName: number): Base; }
>foo : { (tagName: 'canvas'): Derived3; (tagName: "div"): Derived2; (tagName: "span"): Derived1; (tagName: number): Base; }
>tagName : "canvas"
function foo(tagName: 'div'): Derived2;
>foo : { (tagName: "canvas"): Derived3; (tagName: "div"): Derived2; (tagName: "span"): Derived1; (tagName: number): Base; }
>foo : { (tagName: "canvas"): Derived3; (tagName: 'div'): Derived2; (tagName: "span"): Derived1; (tagName: number): Base; }
>tagName : "div"
function foo(tagName: 'span'): Derived1;
>foo : { (tagName: "canvas"): Derived3; (tagName: "div"): Derived2; (tagName: "span"): Derived1; (tagName: number): Base; }
>foo : { (tagName: "canvas"): Derived3; (tagName: "div"): Derived2; (tagName: 'span'): Derived1; (tagName: number): Base; }
>tagName : "span"
function foo(tagName: number): Base;
@@ -76,7 +76,7 @@ interface A { // T
>x : Derived[]
a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>a11 : new (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -84,17 +84,17 @@ interface A { // T
>bar : string
a12: new (x: Array<Base>, y: Array<Derived2>) => Array<Derived>;
>a12 : new (x: Base[], y: Derived2[]) => Derived[]
>a12 : new (x: Array<Base>, y: Array<Derived2>) => Array<Derived>
>x : Base[]
>y : Derived2[]
a13: new (x: Array<Base>, y: Array<Derived>) => Array<Derived>;
>a13 : new (x: Base[], y: Derived[]) => Derived[]
>a13 : new (x: Array<Base>, y: Array<Derived>) => Array<Derived>
>x : Base[]
>y : Derived[]
a14: new (x: { a: string; b: number }) => Object;
>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
@@ -202,10 +202,10 @@ interface I extends A {
>r : T
a9: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal
>a9 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
>a9 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number;}) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: string; bing: number; }) => U
>y : (arg2: { foo: string; bing: number;}) => U
>arg2 : { foo: string; bing: number; }
>foo : string
>bing : number
@@ -221,12 +221,12 @@ interface I extends A {
>y : T
a12: new <T extends Array<Base>>(x: Array<Base>, y: T) => Array<Derived>; // ok, less specific parameter type
>a12 : new <T extends Base[]>(x: Base[], y: T) => Derived[]
>a12 : new <T extends Base[]>(x: Array<Base>, y: T) => Array<Derived>
>x : Base[]
>y : T
a13: new <T extends Array<Derived>>(x: Array<Base>, y: T) => T; // ok, T = Array<Derived>, satisfies constraint, contextual signature instantiation succeeds
>a13 : new <T extends Derived[]>(x: Base[], y: T) => T
>a13 : new <T extends Derived[]>(x: Array<Base>, y: T) => T
>x : Base[]
>y : T
@@ -50,7 +50,7 @@ module Errors {
>x : Base[]
a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>a11 : new (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -58,7 +58,7 @@ module Errors {
>bar : string
a12: new (x: Array<Base>, y: Array<Derived2>) => Array<Derived>;
>a12 : new (x: Base[], y: Derived2[]) => Derived[]
>a12 : new (x: Array<Base>, y: Array<Derived2>) => Array<Derived>
>x : Base[]
>y : Derived2[]
@@ -73,7 +73,7 @@ module Errors {
};
a15: new (x: { a: string; b: number }) => number;
>a15 : new (x: { a: string; b: number; }) => number
>a15 : new (x: { a: string; b: number;}) => number
>x : { a: string; b: number; }
>a : string
>b : number
@@ -128,10 +128,10 @@ module Errors {
interface I4 extends A {
a8: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch
>a8 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U
>a8 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number;}) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: number; }) => U
>y : (arg2: { foo: number;}) => U
>arg2 : { foo: number; }
>foo : number
>r : T
@@ -152,7 +152,7 @@ module Errors {
interface I4E extends A {
a12: new <T extends Array<Derived2>>(x: Array<Base>, y: Array<Base>) => T; // valid, no inferences for T, defaults to Array<Derived2>
>a12 : new <T extends Derived2[]>(x: Base[], y: Base[]) => T
>a12 : new <T extends Derived2[]>(x: Array<Base>, y: Array<Base>) => T
>x : Base[]
>y : Base[]
}
@@ -77,7 +77,7 @@ interface A { // T
>x : Derived[]
a11: new (x: { foo: string }, y: { foo: string; bar: string }) => Base;
>a11 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>a11 : new (x: { foo: string;}, y: { foo: string; bar: string;}) => Base
>x : { foo: string; }
>foo : string
>y : { foo: string; bar: string; }
@@ -85,17 +85,17 @@ interface A { // T
>bar : string
a12: new (x: Array<Base>, y: Array<Derived2>) => Array<Derived>;
>a12 : new (x: Base[], y: Derived2[]) => Derived[]
>a12 : new (x: Array<Base>, y: Array<Derived2>) => Array<Derived>
>x : Base[]
>y : Derived2[]
a13: new (x: Array<Base>, y: Array<Derived>) => Array<Derived>;
>a13 : new (x: Base[], y: Derived[]) => Derived[]
>a13 : new (x: Array<Base>, y: Array<Derived>) => Array<Derived>
>x : Base[]
>y : Derived[]
a14: new (x: { a: string; b: number }) => Object;
>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
@@ -152,10 +152,10 @@ interface I extends B {
>r : T
a9: new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number }) => U) => (r: T) => U; // ok, same as a8 with compatible object literal
>a9 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
>a9 : new <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number;}) => U) => (r: T) => U
>x : (arg: T) => U
>arg : T
>y : (arg2: { foo: string; bing: number; }) => U
>y : (arg2: { foo: string; bing: number;}) => U
>arg2 : { foo: string; bing: number; }
>foo : string
>bing : number
@@ -171,12 +171,12 @@ interface I extends B {
>y : T
a12: new <T extends Array<Base>>(x: Array<Base>, y: T) => Array<Derived>; // ok, less specific parameter type
>a12 : new <T extends Base[]>(x: Base[], y: T) => Derived[]
>a12 : new <T extends Base[]>(x: Array<Base>, y: T) => Array<Derived>
>x : Base[]
>y : T
a13: new <T extends Array<Derived>>(x: Array<Base>, y: T) => T; // ok, T = Array<Derived>, satisfies constraint, contextual signature instantiation succeeds
>a13 : new <T extends Derived[]>(x: Base[], y: T) => T
>a13 : new <T extends Derived[]>(x: Array<Base>, y: T) => T
>x : Base[]
>y : T
@@ -107,7 +107,7 @@ interface I5<T> extends A {
interface I7<T> extends A {
a11: new <U>(x: { foo: T }, y: { foo: U; bar: U }) => Base;
>a11 : new <U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base
>a11 : new <U>(x: { foo: T;}, y: { foo: U; bar: U; }) => Base
>x : { foo: T; }
>foo : T
>y : { foo: U; bar: U; }
@@ -117,7 +117,7 @@ interface I7<T> extends A {
interface I9<T> extends A {
a16: new (x: { a: T; b: T }) => T[];
>a16 : new (x: { a: T; b: T; }) => T[]
>a16 : new (x: { a: T; b: T;}) => T[]
>x : { a: T; b: T; }
>a : T
>b : T
@@ -1,6 +1,6 @@
=== tests/cases/compiler/constructorAsType.ts ===
var Person:new () => {name: string;} = function () {return {name:"joe"};};
>Person : new () => { name: string; }
>Person : new () => { name: string;}
>name : string
>function () {return {name:"joe"};} : () => { name: string; }
>{name:"joe"} : { name: string; }
@@ -8,7 +8,7 @@ var Person:new () => {name: string;} = function () {return {name:"joe"};};
>"joe" : "joe"
var Person2:{new() : {name:string;};};
>Person2 : new () => { name: string; }
>Person2 : new () => { name: string;}
>name : string
Person = Person2;
@@ -63,7 +63,7 @@ test(
>test : <TDependencies>(getter: (deps: TDependencies, data: IData) => any, deps: TDependencies) => any
(deps: typeof DEPS, data) => ({
>(deps: typeof DEPS, data) => ({ fn1: function() { return deps.foo }, fn2: data.bar }) : (deps: { foo: number; }, data: IData) => { fn1: () => number; fn2: boolean; }
>(deps: typeof DEPS, data) => ({ fn1: function() { return deps.foo }, fn2: data.bar }) : (deps: typeof DEPS, data: IData) => { fn1: () => number; fn2: boolean; }
>deps : { foo: number; }
>DEPS : { foo: number; }
>data : IData
@@ -22,7 +22,7 @@ const arr = [
/** @return {Array<[string, {x?:number, y?:number}]>} */
function f() {
>f : () => [string, { x?: number; y?: number; }][]
>f : () => Array<[string, { x?: number; y?: number;}]>
return [
>[ ['a', { x: 1 }], ['b', { y: 2 }] ] : ([string, { x: number; }] | [string, { y: number; }])[]
@@ -29,7 +29,7 @@ f("a", {
});
function g<
>g : <K extends Keys>(x: ({ a: string; } & { b: string; })[K], y: string) => void
>g : <K extends Keys>(x: ({ a: string;} & { b: string;})[K], y: string) => void
K extends "a" | "b">(x: ({ a: string } & { b: string })[K], y: string) {
>x : ({ a: string; } & { b: string; })[K]
@@ -190,7 +190,7 @@ F.prototype = {
// module.exports assignment
/** @type {{ status: 'done', m(n: number): void }} */
module.exports = {
>module.exports = { status: "done", m(n) { }} : { status: "done"; m(n: number): void; }
>module.exports = { status: "done", m(n) { }} : { status: 'done'; m(n: number): void; }
>module.exports : { status: "done"; m(n: number): void; }
>module : { "\"tests/cases/conformance/salsa/mod\"": { status: "done"; m(n: number): void; }; }
>exports : { status: "done"; m(n: number): void; }
@@ -1,6 +1,6 @@
=== tests/cases/compiler/contextualTyping25.ts ===
function foo(param:{id:number;}){}; foo(<{id:number;}>({}));
>foo : (param: { id: number; }) => void
>foo : (param: { id: number;}) => void
>param : { id: number; }
>id : number
>foo(<{id:number;}>({})) : void
@@ -1,6 +1,6 @@
=== tests/cases/compiler/contextualTyping26.ts ===
function foo(param:{id:number;}){}; foo(<{id:number;}>({}));
>foo : (param: { id: number; }) => void
>foo : (param: { id: number;}) => void
>param : { id: number; }
>id : number
>foo(<{id:number;}>({})) : void
@@ -1,6 +1,6 @@
=== tests/cases/compiler/contextualTyping27.ts ===
function foo(param:{id:number;}){}; foo(<{id:number;}>({}));
>foo : (param: { id: number; }) => void
>foo : (param: { id: number;}) => void
>param : { id: number; }
>id : number
>foo(<{id:number;}>({})) : void
@@ -172,7 +172,7 @@ interface ActionsObjectOr<State> {
}
declare function App4<State, Actions extends ActionsObjectOr<State>>(props: Options<State, Actions>["actions"] & { state: State }): JSX.Element;
>App4 : <State, Actions extends ActionsObjectOr<State>>(props: (string & { state: State; }) | (Actions & { state: State; })) => JSX.Element
>App4 : <State, Actions extends ActionsObjectOr<State>>(props: Options<State, Actions>["actions"] & { state: State;}) => JSX.Element
>props : (string & { state: State; }) | (Actions & { state: State; })
>state : State
>JSX : any
@@ -9,13 +9,13 @@ declare function id2<T extends (x: any) => any>(input: T): T;
>input : T
declare function id3<T extends (x: { foo: any }) => any>(input: T): T;
>id3 : <T extends (x: { foo: any; }) => any>(input: T) => T
>id3 : <T extends (x: { foo: any;}) => any>(input: T) => T
>x : { foo: any; }
>foo : any
>input : T
declare function id4<T extends (x: { foo?: number }) => any>(input: T): T;
>id4 : <T extends (x: { foo?: number | undefined; }) => any>(input: T) => T
>id4 : <T extends (x: { foo?: number;}) => any>(input: T) => T
>x : { foo?: number | undefined; }
>foo : number | undefined
>input : T
@@ -11,8 +11,8 @@ namespace JSX {
}
const FooComponent = (props: { foo: "A" | "B" | "C" }) => <span>{props.foo}</span>;
>FooComponent : (props: { foo: "A" | "B" | "C"; }) => JSX.Element
>(props: { foo: "A" | "B" | "C" }) => <span>{props.foo}</span> : (props: { foo: "A" | "B" | "C"; }) => JSX.Element
>FooComponent : (props: { foo: "A" | "B" | "C";}) => JSX.Element
>(props: { foo: "A" | "B" | "C" }) => <span>{props.foo}</span> : (props: { foo: "A" | "B" | "C";}) => JSX.Element
>props : { foo: "A" | "B" | "C"; }
>foo : "A" | "B" | "C"
><span>{props.foo}</span> : JSX.Element
@@ -34,7 +34,7 @@ declare class List<TData> {
>context : TContext
filter<TResult extends TData>(fn: FilterFn<TData, TResult>): List<TResult>;
>filter : { <TContext, TResult extends TData>(fn: FilterFn<TData, TResult, TContext>, context: TContext): List<TResult>; <TResult extends TData>(fn: FilterFn<TData, TResult, List<TData>>): List<TResult>; <TContext>(fn: IteratorFn<TData, boolean, TContext>, context: TContext): List<TData>; (fn: IteratorFn<TData, boolean, List<TData>>): List<TData>; }
>filter : { <TContext, TResult extends TData>(fn: FilterFn<TData, TResult, TContext>, context: TContext): List<TResult>; <TResult extends TData>(fn: FilterFn<TData, TResult>): List<TResult>; <TContext>(fn: IteratorFn<TData, boolean, TContext>, context: TContext): List<TData>; (fn: IteratorFn<TData, boolean, List<TData>>): List<TData>; }
>fn : FilterFn<TData, TResult, List<TData>>
filter<TContext>(fn: IteratorFn<TData, boolean, TContext>, context: TContext): List<TData>;
@@ -43,7 +43,7 @@ declare class List<TData> {
>context : TContext
filter(fn: IteratorFn<TData, boolean>): List<TData>;
>filter : { <TContext, TResult extends TData>(fn: FilterFn<TData, TResult, TContext>, context: TContext): List<TResult>; <TResult extends TData>(fn: FilterFn<TData, TResult, List<TData>>): List<TResult>; <TContext>(fn: IteratorFn<TData, boolean, TContext>, context: TContext): List<TData>; (fn: IteratorFn<TData, boolean, List<TData>>): List<TData>; }
>filter : { <TContext, TResult extends TData>(fn: FilterFn<TData, TResult, TContext>, context: TContext): List<TResult>; <TResult extends TData>(fn: FilterFn<TData, TResult, List<TData>>): List<TResult>; <TContext>(fn: IteratorFn<TData, boolean, TContext>, context: TContext): List<TData>; (fn: IteratorFn<TData, boolean>): List<TData>; }
>fn : IteratorFn<TData, boolean, List<TData>>
}
interface Test {
@@ -3,7 +3,7 @@ function f() {
>f : () => void
let x: { a?: number | string, b: number | string } = { b: 1 };
>x : { a?: string | number | undefined; b: string | number; }
>x : { a?: string | number | undefined; b: number | string; }
>a : string | number | undefined
>b : string | number
>{ b: 1 } : { b: number; }
@@ -319,8 +319,8 @@ o4.x.y;
>y : boolean
declare const o5: { x?: { y: { z?: { w: boolean } } } };
>o5 : { x?: { y: { z?: { w: boolean; } | undefined; }; } | undefined; }
>x : { y: { z?: { w: boolean; } | undefined; }; } | undefined
>o5 : { x?: { y: { z?: { w: boolean; };}; } | undefined; }
>x : { y: { z?: { w: boolean; };}; } | undefined
>y : { z?: { w: boolean; } | undefined; }
>z : { w: boolean; } | undefined
>w : boolean
@@ -2038,7 +2038,7 @@ let i = 0;
>0 : 0
declare const arr: { tag: ("left" | "right") }[];
>arr : { tag: "left" | "right"; }[]
>arr : { tag: ("left" | "right"); }[]
>tag : "left" | "right"
while (arr[i]?.tag === "left") {
@@ -7,7 +7,7 @@ class ConstantIterator<T> implements AsyncIterator<T, undefined, T | undefined>
>constant : T
}
async next(value?: T): Promise<IteratorResult<T>> {
>next : (value?: T) => Promise<IteratorResult<T, any>>
>next : (value?: T) => Promise<IteratorResult<T>>
>value : T
if (value != null) {
@@ -52,7 +52,7 @@ var b = bar<number>();
>bar : <T>() => { y2: { y2: { y2: { y2: { y2: { y2: { y2: { y2: { y2: { y2: { y2: any; }; }; }; }; }; }; }; }; }; }; }
function test<T>(x: typeof a): void { }
>test : <T>(x: { y2: { y2: { y2: { y2: { y2: { y2: { y2: { y2: { y2: { y2: { y2: any; }; }; }; }; }; }; }; }; }; }; }) => void
>test : <T>(x: typeof a) => void
>x : { y2: { y2: { y2: { y2: { y2: { y2: { y2: { y2: { y2: { y2: { y2: any; }; }; }; }; }; }; }; }; }; }; }
>a : { y2: { y2: { y2: { y2: { y2: { y2: { y2: { y2: { y2: { y2: { y2: any; }; }; }; }; }; }; }; }; }; }; }
@@ -1,18 +1,18 @@
=== tests/cases/compiler/declFileForInterfaceWithRestParams.ts ===
interface I {
foo(...x): typeof x;
>foo : (...x: any[]) => any[]
>foo : (...x: any[]) => typeof x
>x : any[]
>x : any[]
foo2(a: number, ...x): typeof x;
>foo2 : (a: number, ...x: any[]) => any[]
>foo2 : (a: number, ...x: any[]) => typeof x
>a : number
>x : any[]
>x : any[]
foo3(b: string, ...x: string[]): typeof x;
>foo3 : (b: string, ...x: string[]) => string[]
>foo3 : (b: string, ...x: string[]) => typeof x
>b : string
>x : string[]
>x : string[]
Loaded 100 of 636 files, more files were not shown because too many files have changed in this diff. Show more