ts-sample.ts (501B)
1 // TSEnumDeclaration 2 enum Color { 3 // TSEnumMember 4 Red, 5 Green, 6 Blue, 7 } 8 9 class Example<T> { 10 // TSParameterProperty 11 constructor(public foo) { 12 13 } 14 15 method(): never { 16 throw new Error(); 17 } 18 } 19 20 // TSTypeAssertion 21 var foo = <any>window; 22 23 // TSAsExpression 24 (window as any); 25 26 // TSNonNullExpression 27 (window!); 28 29 // TSModuleDeclaration 30 namespace TheSpace { 31 function fn() { 32 33 } 34 } 35 36 // TSImportEqualsDeclaration 37 import ImportedClass = require("mod"); 38 39 // TSExportAssignment 40 export = Example;