Skip to content

Commit 5bd8271

Browse files
committed
Types for the new es6 style import statement parsing
1 parent e058189 commit 5bd8271

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Diff for: src/compiler/types.ts

+28
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ module ts {
230230
ModuleBlock,
231231
ImportEqualsDeclaration,
232232
ExportAssignment,
233+
ImportStatement,
234+
ImportClause,
235+
NamespaceImport,
236+
NamedImports,
237+
ImportSpecifier,
233238

234239
// Module references
235240
ExternalModuleReference,
@@ -861,6 +866,29 @@ module ts {
861866
expression?: Expression;
862867
}
863868

869+
export interface ImportStatement extends Statement, ModuleElement {
870+
importClause?: ImportClause;
871+
moduleSpecifier: StringLiteralExpression;
872+
}
873+
874+
export interface ImportClause extends Node {
875+
defaultBinding?: Identifier;
876+
bindings?: NamespaceImport | NamedImports;
877+
}
878+
879+
export interface NamespaceImport extends Declaration {
880+
name: Identifier;
881+
}
882+
883+
export interface NamedImports extends Node {
884+
elements: NodeArray<ImportSpecifier>;
885+
}
886+
887+
export interface ImportSpecifier extends Declaration {
888+
propertyName?: Identifier; // Property name to be imported from module
889+
name: Identifier; // element name to be imported in the scope
890+
}
891+
864892
export interface ExportAssignment extends Statement, ModuleElement {
865893
exportName: Identifier;
866894
}

0 commit comments

Comments
 (0)