license import { MDCComponent } from '@material/base/component' ; import { MDCTextFieldCharacterCounterAdapter } from './adapter' ; import { MDCTextFieldCharacterCounterFoundation } from './foundation' ; export type MDCTextFieldCharacterCounterFactory = ( el : Element , foundation ? : MDCTextFieldCharacterCounterFoundation ) => MDCTextFieldCharacterCounter ; export class MDCTextFieldCharacterCounter extends MDCComponent < MDCTextFieldCharacterCounterFoundation > { static override attachTo ( root ) { return new MDCTextFieldCharacterCounter ( root ) ; } get foundationForTextField ( ) : MDCTextFieldCharacterCounterFoundation { return this . foundation ; } override getDefaultFoundation ( ) { const adapter = { setContent : ( content ) => { this . root . textContent = content ; } , } ; return new MDCTextFieldCharacterCounterFoundation ( adapter ) ; } }