23.06.2015 Views

TypeScript Language Specification v1.5

TypeScript Language Specification v1.5

TypeScript Language Specification v1.5

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

AmbientModuleDeclaration:<br />

module IdentifierPath { AmbientModuleBody }<br />

AmbientModuleBody:<br />

AmbientModuleElements opt<br />

AmbientModuleElements:<br />

AmbientModuleElement<br />

AmbientModuleElements AmbientModuleElement<br />

AmbientModuleElement:<br />

export opt AmbientVariableDeclaration<br />

export opt AmbientFunctionDeclaration<br />

export opt AmbientClassDeclaration<br />

export opt InterfaceDeclaration<br />

export opt AmbientEnumDeclaration<br />

export opt AmbientModuleDeclaration<br />

export opt ImportDeclaration<br />

Except for ImportDeclarations, AmbientModuleElements always declare exported entities regardless of<br />

whether they include the optional export modifier.<br />

12.2 Ambient External Module Declarations<br />

An AmbientExternalModuleDeclaration declares an external module. This type of declaration is permitted<br />

only at the top level in a source file that contributes to the global module (section 11.1). The StringLiteral<br />

must specify a top-level external module name. Relative external module names are not permitted.<br />

AmbientExternalModuleDeclaration:<br />

declare module StringLiteral { AmbientExternalModuleBody }<br />

AmbientExternalModuleBody:<br />

AmbientExternalModuleElements opt<br />

AmbientExternalModuleElements:<br />

AmbientExternalModuleElement<br />

AmbientExternalModuleElements AmbientExternalModuleElement<br />

AmbientExternalModuleElement:<br />

AmbientModuleElement<br />

ExportAssignment<br />

export opt ExternalImportDeclaration<br />

153

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!