/**
 * Foundation adapters.
 */ /**
 * Ripple adapter interface
 * Default implementations are noop and returns meaningless value.
 */ export class RippleAdapter { public browserSupportsCssVars ( ) { return false ; } public isUnbounded ( ) { return false ; } public isSurfaceActive ( ) { return false ; } public addClass ( _className ) { } public removeClass ( _className ) { } public registerInteractionHandler ( _evtType , _handler ) { } public deregisterInteractionHandler ( _evtType , _handler ) { } public registerResizeHandler ( _handler ) { } public deregisterResizeHandler ( _handler ) { } public updateCssVariable ( _varName , _value ) { } public computeBoundingRect ( ) { return null ; } public getWindowPageOffset ( ) { return { x : 0 , y : 0 } ; } } /**
 * Composite adapter for MDCRippleFoundation
 */ export class FoundationAdapter { public rippleAdapter : RippleAdapter ; constructor ( ) { this . rippleAdapter = new RippleAdapter ( ) ; } public setRippleAdapter ( rippleAdapter ) { this . rippleAdapter = rippleAdapter ; } public browserSupportsCssVars ( ) { return this . rippleAdapter . browserSupportsCssVars ( ) ; } public isUnbounded ( ) { return this . rippleAdapter . isUnbounded ( ) ; } public isSurfaceActive ( ) { return this . rippleAdapter . isSurfaceActive ( ) ; } public addClass ( className ) { this . rippleAdapter . addClass ( className ) ; } public removeClass ( className ) { this . rippleAdapter . removeClass ( className ) ; } public registerInteractionHandler ( evtType , handler ) { this . rippleAdapter . registerInteractionHandler ( evtType , handler ) ; } public deregisterInteractionHandler ( evtType , handler ) { this . rippleAdapter . deregisterInteractionHandler ( evtType , handler ) ; } public registerResizeHandler ( handler ) { this . rippleAdapter . registerResizeHandler ( handler ) ; } public deregisterResizeHandler ( handler ) { this . rippleAdapter . deregisterResizeHandler ( handler ) ; } public updateCssVariable ( varName , value ) { this . rippleAdapter . updateCssVariable ( varName , value ) ; } public computeBoundingRect ( ) { return this . rippleAdapter . computeBoundingRect ( ) ; } public getWindowPageOffset ( ) { return this . rippleAdapter . getWindowPageOffset ( ) ; } /**
     * 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 ; } }