Types for the new es6 style import statement parsing

This commit is contained in:
Sheetal Nandi 2015-01-27 16:16:18 -08:00
parent e0581899fa
commit 5bd8271f04

View File

@ -230,6 +230,11 @@ module ts {
ModuleBlock,
ImportEqualsDeclaration,
ExportAssignment,
ImportStatement,
ImportClause,
NamespaceImport,
NamedImports,
ImportSpecifier,
// Module references
ExternalModuleReference,
@ -861,6 +866,29 @@ module ts {
expression?: Expression;
}
export interface ImportStatement extends Statement, ModuleElement {
importClause?: ImportClause;
moduleSpecifier: StringLiteralExpression;
}
export interface ImportClause extends Node {
defaultBinding?: Identifier;
bindings?: NamespaceImport | NamedImports;
}
export interface NamespaceImport extends Declaration {
name: Identifier;
}
export interface NamedImports extends Node {
elements: NodeArray<ImportSpecifier>;
}
export interface ImportSpecifier extends Declaration {
propertyName?: Identifier; // Property name to be imported from module
name: Identifier; // element name to be imported in the scope
}
export interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
}