import { textService } from '../text' ; type ChangeDocTitleHandler = ( newTitle : string | string [ ] ) => void ; class DocTitleService { private changeDocTitleHandler : ChangeDocTitleHandler = ( ) => { } ; public setup ( _changeDocTitleHandler ) { this . changeDocTitleHandler = _changeDocTitleHandler ; } public setTitle ( page ? ) { if ( ! page || page === 'home' ) { this . changeDocTitleHandler ( `${ textService . breadcrumbs . home }` ) ; } else if ( textService . breadcrumbs [ page ] ) { this . changeDocTitleHandler ( `${ textService . breadcrumbs [ page ] } - ${ textService . breadcrumbs . home }` ) ; } } } export const docTitleService = new DocTitleService ( ) ;