namespace CarWashStrategy { class Car { } interface IWashingStrategy { wash ( car ) : void ; } class StandardWash implements IWashingStrategy { wash ( car ) { } } class PremiumWash implements IWashingStrategy { wash ( car ) { } } class CarWash { service ( car , premium ) { let washingStrategy ; if ( premium ) { washingStrategy = new PremiumWash ( ) ; } else { washingStrategy = new StandardWash ( ) ; } washingStrategy . wash ( car ) ; } } }