Skip to content

Commit

Permalink
Types for the new es6 style import statement parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
sheetalkamat committed Jan 28, 2015
1 parent e058189 commit 5bd8271
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ module ts {
ModuleBlock,
ImportEqualsDeclaration,
ExportAssignment,
ImportStatement,
ImportClause,
NamespaceImport,
NamedImports,
ImportSpecifier,

// Module references
ExternalModuleReference,
Expand Down Expand Up @@ -861,6 +866,29 @@ module ts {
expression?: Expression;
}

export interface ImportStatement extends Statement, ModuleElement {

This comment has been minimized.

Copy link
@yuit

yuit Jan 29, 2015

Contributor

Could we add a comment to give example of each case especially the one from ES6?

importClause?: ImportClause;
moduleSpecifier: StringLiteralExpression;
}

export interface ImportClause extends Node {
defaultBinding?: Identifier;
bindings?: NamespaceImport | NamedImports;

This comment has been minimized.

Copy link
@JsonFreeman

JsonFreeman Jan 28, 2015

Contributor

namedBindings

}

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;
}
Expand Down

1 comment on commit 5bd8271

@JsonFreeman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Please sign in to comment.