/**
 * Foundation adapters.
 */ /**
 * Container adapter interface
 * Default implementations are noop and returns meaningless value.
 */ export class ContainerAdapter { public addClass ( _className ) { } public removeClass ( _className ) { } } /**
 * Input adapter interface
 * Default implementations are noop and returns meaningless value.
 */ export class InputAdapter { public registerInputFocusHandler ( _handler ) { } public deregisterInputFocusHandler ( _handler ) { } public registerInputBlurHandler ( _handler ) { } public deregisterInputBlurHandler ( _handler ) { } public registerInputInputHandler ( _handler ) { } public deregisterInputInputHandler ( _handler ) { } public registerInputKeydownHandler ( _handler ) { } public deregisterInputKeydownHandler ( _handler ) { } public getNativeInput ( ) { return null ; } } /**
 * Label adapter interface
 * Default implementations are noop and returns meaningless value.
 */ export class LabelAdapter { public addClassToLabel ( _className ) { } public removeClassFromLabel ( _className ) { } } /**
 * Helptext adapter interface
 * Default implementations are noop and returns meaningless value.
 */ export class HelptextAdapter { public addClassToHelptext ( _className ) { } public removeClassFromHelptext ( _className ) { } public helptextHasClass ( _className ) { return false ; } public setHelptextAttr ( _name , _value ) { } public removeHelptextAttr ( _name ) { } } /**
 * Composite adapter for MDCRadioFoundation
 */ export class FoundationAdapter { private containerAdapter : ContainerAdapter ; private inputAdapter : InputAdapter ; private labelAdapter : LabelAdapter ; private helptextAdapter : HelptextAdapter ; constructor ( ) { this . containerAdapter = new ContainerAdapter ( ) ; this . inputAdapter = new InputAdapter ( ) ; this . labelAdapter = new LabelAdapter ( ) ; this . helptextAdapter = new HelptextAdapter ( ) ; } public setContainerAdapter ( containerAdapter ) { this . containerAdapter = containerAdapter ; } public setInputAdapter ( inputAdapter ) { this . inputAdapter = inputAdapter ; } public setLabelAdapter ( labelAdapter ) { this . labelAdapter = labelAdapter ; } public setHelptextAdapter ( helptextAdapter ) { this . helptextAdapter = helptextAdapter ; } public addClass ( className ) { this . containerAdapter . addClass ( className ) ; } public removeClass ( className ) { this . containerAdapter . removeClass ( className ) ; } public addClassToLabel ( className ) { this . labelAdapter . addClassToLabel ( className ) ; } public removeClassFromLabel ( className ) { this . labelAdapter . removeClassFromLabel ( className ) ; } public addClassToHelptext ( className ) { this . helptextAdapter . addClassToHelptext ( className ) ; } public removeClassFromHelptext ( className ) { this . helptextAdapter . removeClassFromHelptext ( className ) ; } public helptextHasClass ( className ) { return this . helptextAdapter . helptextHasClass ( className ) ; } public setHelptextAttr ( name , value ) { this . helptextAdapter . setHelptextAttr ( name , value ) ; } public removeHelptextAttr ( name ) { this . helptextAdapter . removeHelptextAttr ( name ) ; } public registerInputFocusHandler ( handler ) { this . inputAdapter . registerInputFocusHandler ( handler ) ; } public deregisterInputFocusHandler ( handler ) { this . inputAdapter . deregisterInputFocusHandler ( handler ) ; } public registerInputBlurHandler ( handler ) { this . inputAdapter . registerInputBlurHandler ( handler ) ; } public deregisterInputBlurHandler ( handler ) { this . inputAdapter . deregisterInputBlurHandler ( handler ) ; } public registerInputInputHandler ( handler ) { this . inputAdapter . registerInputInputHandler ( handler ) ; } public deregisterInputInputHandler ( handler ) { this . inputAdapter . deregisterInputInputHandler ( handler ) ; } public registerInputKeydownHandler ( handler ) { this . inputAdapter . registerInputKeydownHandler ( handler ) ; } public deregisterInputKeydownHandler ( handler ) { this . inputAdapter . deregisterInputKeydownHandler ( handler ) ; } public getNativeInput ( ) { return this . inputAdapter . getNativeInput ( ) ; } /**
     * MDCFoundation accepts only object as adapter
     * So we create object-proxy of instance.
     */ public toObject ( ) { const keys = Object . getOwnPropertyNames ( Object . getPrototypeOf ( this ) ) ; const object = { } ; keys . forEach ( ( key ) => { object [ key ] = ( ... args ) => this [ key ] ( ... args ) ; } ) ; return object ; } }