/**
 * Foundation adapters.
 */ function createEmptyNodeList ( ) { const item = ( ) => { throw new Error ( "This is an empty node list" ) ; } ; return { ... ( [ ] ) , item , } as NodeListOf < Element > ; } /**
 * Container adapter interface
 * Default implementations are noop and returns meaningless value.
 */ export class ContainerAdapter { public addClass ( _className ) { } public removeClass ( _className ) { } public hasClass ( _className ) { return false ; } public registerInteractionHandler ( _evt , _handler ) { } public deregisterInteractionHandler ( _evt , _handler ) { } public registerTransitionEndHandler ( _handler ) { } public deregisterTransitionEndHandler ( _handler ) { } public registerDocumentKeydownHandler ( _handler ) { } public deregisterDocumentKeydownHandler ( _handler ) { } public updateCssVariable ( _value ) { } public saveElementTabState ( _el ) { } public restoreElementTabState ( _el ) { } public makeElementUntabbable ( _el ) { } public isRtl ( ) { return false ; } } /**
 * Drawer adapter interface
 * Default implementations are noop and returns meaningless value.
 */ export class DrawerAdapter { public registerDrawerInteractionHandler ( _evt , _handler ) { } public deregisterDrawerInteractionHandler ( _evt , _handler ) { } public getDrawerWidth ( ) { return 0 ; } public setTranslateX ( _value ) { } public isDrawer ( _el ) { return false ; } public getFocusableElements ( ) { return createEmptyNodeList ( ) ; } public hasNecessaryDom ( ) { return false ; } } /**
 * Composite adapter for MDCTemporaryDrawerFoundation
 */ export class FoundationAdapter { private containerAdapter : ContainerAdapter ; private drawerAdapter : DrawerAdapter ; constructor ( ) { this . containerAdapter = new ContainerAdapter ( ) ; this . drawerAdapter = new DrawerAdapter ( ) ; } public setContainerAdapter ( containerAdapter ) { this . containerAdapter = containerAdapter ; } public setDrawerAdapter ( drawerAdapter ) { this . drawerAdapter = drawerAdapter ; } public addClass ( className ) { this . containerAdapter . addClass ( className ) ; } public removeClass ( className ) { this . containerAdapter . removeClass ( className ) ; } public hasClass ( className ) { return this . containerAdapter . hasClass ( className ) ; } public registerInteractionHandler ( evt , handler ) { this . containerAdapter . registerInteractionHandler ( evt , handler ) ; } public deregisterInteractionHandler ( evt , handler ) { this . containerAdapter . deregisterInteractionHandler ( evt , handler ) ; } public registerTransitionEndHandler ( handler ) { this . containerAdapter . registerTransitionEndHandler ( handler ) ; } public deregisterTransitionEndHandler ( handler ) { this . containerAdapter . deregisterTransitionEndHandler ( handler ) ; } public registerDocumentKeydownHandler ( handler ) { this . containerAdapter . registerDocumentKeydownHandler ( handler ) ; } public deregisterDocumentKeydownHandler ( handler ) { this . containerAdapter . deregisterDocumentKeydownHandler ( handler ) ; } public updateCssVariable ( value ) { this . containerAdapter . updateCssVariable ( value ) ; } public saveElementTabState ( el ) { this . containerAdapter . saveElementTabState ( el ) ; } public restoreElementTabState ( el ) { this . containerAdapter . restoreElementTabState ( el ) ; } public makeElementUntabbable ( el ) { this . containerAdapter . makeElementUntabbable ( el ) ; } public isRtl ( ) { return this . containerAdapter . isRtl ( ) ; } public registerDrawerInteractionHandler ( evt , handler ) { this . drawerAdapter . registerDrawerInteractionHandler ( evt , handler ) ; } public deregisterDrawerInteractionHandler ( evt , handler ) { this . drawerAdapter . deregisterDrawerInteractionHandler ( evt , handler ) ; } public getDrawerWidth ( ) { return this . drawerAdapter . getDrawerWidth ( ) ; } public setTranslateX ( value ) { this . drawerAdapter . setTranslateX ( value ) ; } public isDrawer ( el ) { return this . drawerAdapter . isDrawer ( el ) ; } public getFocusableElements ( ) { return this . drawerAdapter . getFocusableElements ( ) ; } public hasNecessaryDom ( ) { return this . drawerAdapter . hasNecessaryDom ( ) ; } /**
     * 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 ; } }