import { I18nStart } from '../i18n' ; import { IUiSettingsClient } from '../ui_settings' ; import { OverlayBannersStart , OverlayBannersService } from './banners' ; import { FlyoutService , OverlayFlyoutStart } from './flyout' ; import { ModalService , OverlayModalStart } from './modal' ; interface StartDeps { i18n : I18nStart ; targetDomElement : HTMLElement ; uiSettings : IUiSettingsClient ; } internal export class OverlayService { private bannersService = new OverlayBannersService ( ) ; private modalService = new ModalService ( ) ; private flyoutService = new FlyoutService ( ) ; public start ( { i18n , targetDomElement , uiSettings } ) { const flyoutElement = document . createElement ( 'div' ) ; targetDomElement . appendChild ( flyoutElement ) ; const flyouts = this . flyoutService . start ( { i18n , targetDomElement : flyoutElement } ) ; const banners = this . bannersService . start ( { i18n , uiSettings } ) ; const modalElement = document . createElement ( 'div' ) ; targetDomElement . appendChild ( modalElement ) ; const modals = this . modalService . start ( { i18n , targetDomElement : modalElement } ) ; return { banners , openFlyout : flyouts . open . bind ( flyouts ) , openModal : modals . open . bind ( modals ) , openConfirm : modals . openConfirm . bind ( modals ) , } ; } } public export interface OverlayStart { /**  OverlayBannersStart banners : OverlayBannersStart ; /**  OverlayFlyoutStart openFlyout : OverlayFlyoutStart [ 'open' ] ; /**  OverlayModalStart openModal : OverlayModalStart [ 'open' ] ; /**  OverlayModalStart openConfirm : OverlayModalStart [ 'openConfirm' ] ; }