Allow string for name when creating a TypeAliasDeclaration

This commit is contained in:
Mohsen Azimi
2017-05-01 14:58:36 -07:00
parent f9c46b5f82
commit b27aec2247

View File

@@ -1462,7 +1462,7 @@ namespace ts {
: node;
}
export function createTypeAliasDeclaration(name: Identifier, typeParameters: TypeParameterDeclaration[] | undefined, type: TypeNode) {
export function createTypeAliasDeclaration(name: string | Identifier, typeParameters: TypeParameterDeclaration[] | undefined, type: TypeNode) {
const node = <TypeAliasDeclaration>createSynthesizedNode(SyntaxKind.TypeAliasDeclaration);
node.name = asName(name);
node.typeParameters = asNodeArray(typeParameters);