import { inject , inlineView , customElement } from 'aurelia-framework' ; import { MDCTextFieldCharacterCounterFoundation , MDCTextFieldCharacterCounterAdapter , characterCountCssClasses } from '@material/textfield' ; import { MdcComponent } from '@aurelia-mdc-web/base' ; @ inject ( Element ) @ inlineView ( `<template class="${ characterCountCssClasses . ROOT }"></template>` ) @ customElement ( characterCountCssClasses . ROOT ) export class MdcTextFieldCharacterCounter extends MdcComponent < MDCTextFieldCharacterCounterFoundation > { get foundationForTextField ( ) : MDCTextFieldCharacterCounterFoundation { return this . foundation ! ; } getDefaultFoundation ( ) { const adapter = { setContent : ( content ) => { this . root . textContent = content ; } , } ; return new MDCTextFieldCharacterCounterFoundation ( adapter ) ; } } hidden export interface IMdcTextFieldCharacterCounterElement extends HTMLElement { au : { controller : { viewModel : MdcTextFieldCharacterCounter ; } ; } ; }