1//@noUnusedLocals:true 2//@noUnusedParameters:true 3 4function greeter(person: string) { 5 var unused = 20; 6} 7 8class Dummy<usedtypeparameter, unusedtypeparameter> { 9 private unusedprivatevariable: string; 10 private greeting: string; 11 public unusedpublicvariable: string; 12 public typedvariable: usedtypeparameter; 13 14 constructor(message: string) { 15 var unused2 = 22; 16 this.greeting = "Dummy Message"; 17 } 18 19 public greeter(person: string) { 20 var unused = 20; 21 this.usedPrivateFunction(); 22 } 23 24 private usedPrivateFunction() { 25 } 26 27 private unUsedPrivateFunction() { 28 } 29} 30 31var user = "Jane User"; 32var user2 = "Jane2 User2"; 33 34namespace Validation { 35 export interface StringValidator { 36 isAcceptable(s: string): boolean; 37 } 38 39 const lettersRegexp = /^[A-Za-z]+$/; 40 const numberRegexp = /^[0-9]+$/; 41 42 export class LettersOnlyValidator implements StringValidator { 43 isAcceptable(s2: string) { 44 return lettersRegexp.test(s2); 45 } 46 47 private unUsedPrivateFunction() { 48 } 49 } 50 51 export class ZipCodeValidator implements StringValidator { 52 isAcceptable(s3: string) { 53 return s3.length === 5; 54 } 55 } 56 57 interface usedLocallyInterface { 58 } 59 60 interface usedLocallyInterface2 { 61 someFunction(s1: string): void; 62 } 63 64 export interface exportedInterface { 65 } 66 67 class dummy implements usedLocallyInterface { 68 } 69 70 interface unusedInterface { 71 } 72} 73 74 75namespace Greeter { 76 class class1 { 77 } 78 79 export class class2 extends class1 { 80 } 81 82 class class3 { 83 } 84 85 export class class4 { 86 } 87 88 interface interface1 { 89 } 90 91 export interface interface2 extends interface1 { 92 } 93 94 interface interface3 { 95 } 96 97 export interface interface4 { 98 } 99 100 export let a: interface3; 101 102 interface interface5 { 103 } 104}