import BitMatrix from './common/BitMatrix' ; import QRCodeWriter from './qrcode/QRCodeWriter' ; import Writer from './Writer' ; import BarcodeFormat from './BarcodeFormat' ; import EncodeHintType from './EncodeHintType' ; import Exception from './Exception' ; author dswitkin google export default class MultiFormatWriter implements Writer { public encode ( contents , format , width , height , hints ) { let writer ; switch ( format ) { case BarcodeFormat . QR_CODE : writer = new QRCodeWriter ( ) ; break ; default : throw new Exception ( Exception . IllegalArgumentException , "No encoder available for format " + format ) ; } return writer . encode ( contents , format , width , height , hints ) ; } }